/**
 * MindForge Button Components
 * Extracted from front-page.php inline styles
 * Provides consistent button styling across the application
 */

/* Base Button Styles */
.btn {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    min-width: 120px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Button-specific hover lift effect */
.btn:hover {
    transform: translateY(-2px);
}

/* Ensure only buttons get hover lift, not other elements */
.btn:not(:disabled):not(.loading):hover {
    transform: translateY(-2px);
}

/* NeuGrey Button - Neumorphic with Grey Text */
.btn-primary,
.btn-neugrey {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    border-radius: 0.5rem;
    border: none !important;
    outline: none !important;
    box-shadow: 
        5px 5px 10px rgba(0, 0, 0, 0.3),
        -5px -5px 10px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-neugrey:hover {
    transform: translateY(-2px);
    box-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.3),
        -4px -4px 8px rgba(255, 255, 255, 0.1);
}

.btn-primary:active,
.btn-neugrey:active {
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.1);
}

/* NeuOrange Button - Bright Standard, Shrink on Hover */
.btn-neuorange {
    background: var(--color-bg-primary);
    color: var(--color-accent-orange);
    border-radius: 0.5rem;
    border: none !important;
    outline: none !important;
    box-shadow: 
        5px 5px 10px rgba(0, 0, 0, 0.4),
        -5px -5px 10px rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.btn-neuorange:hover {
    color: var(--color-accent-orange-hover);
    transform: translateY(-2px);
    box-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.4),
        -4px -4px 8px rgba(255, 255, 255, 0.15);
}

.btn-neuorange:active {
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.1);
}

/* Accent Orange Button (solid background) */
.btn-accent {
    background: var(--color-accent-orange);
    color: white;
    border-radius: 0.5rem;
}

.btn-accent:hover {
    background: var(--color-accent-orange-hover);
}

/* Smooth Button - Clean Tab-style */
.btn-smooth {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: all 0.2s ease;
    min-width: auto;
}

.btn-smooth:hover,
.btn-smooth.active {
    color: var(--color-text-primary);
    border-bottom-color: var(--color-primary);
    transform: none; /* Override base button lift */
}

.btn-smooth:active {
    color: var(--color-text-primary);
    border-bottom-color: var(--color-primary-light);
}

/* Smooth Accent Button - Clean Tab-style with Orange Accent */
.btn-smooth-accent {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: all 0.2s ease;
    min-width: auto;
}

.btn-smooth-accent:hover,
.btn-smooth-accent.active {
    color: var(--color-accent-orange);
    border-bottom-color: var(--color-accent-orange);
    transform: none; /* Override base button lift */
}

.btn-smooth-accent:active {
    color: var(--color-accent-orange-hover);
    border-bottom-color: var(--color-accent-orange-hover);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(229, 231, 235, 0.3);
    border-radius: 0.5rem;
}

.btn-ghost:hover {
    background: rgba(229, 231, 235, 0.1);
    border-color: rgba(229, 231, 235, 0.5);
}

/* Neumorphic Button */
.neumorphic-raised {
    border: none !important;
    outline: none !important;
    box-shadow: 
        8px 8px 16px rgba(0, 0, 0, 0.3),
        -8px -8px 16px rgba(255, 255, 255, 0.1);
}

.neumorphic-raised:focus {
    outline: none !important;
    border: none !important;
}

.neumorphic-raised:hover {
    border: none !important;
    box-shadow: 
        6px 6px 12px rgba(0, 0, 0, 0.4),
        -6px -6px 12px rgba(255, 255, 255, 0.15);
}

.neumorphic-raised:active {
    border: none !important;
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.1);
}

/* Button Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading .signin-btn__text::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 33% { content: ''; }
    34%, 66% { content: '.'; }
    67%, 100% { content: '..'; }
}

/* Button Rows and Layouts */
.auth-button-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.5rem 0;
}

.auth-button-row.single-centered {
    justify-content: center;
}

.auth-button-row.dual {
    justify-content: center;
    gap: 1rem;
}

.auth-button-row .btn {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    min-width: 120px;
}

.auth-button-row .btn:hover {
    transform: translateY(-2px);
}

/* Apply neumorphic styling to buttons in single-centered layout */
.auth-button-row.single-centered .btn {
    border: none !important;
    outline: none !important;
    border-radius: 0.5rem;
    box-shadow: 
        5px 5px 10px rgba(0, 0, 0, 0.3),
        -5px -5px 10px rgba(255, 255, 255, 0.1);
}

.auth-button-row.single-centered .btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.3),
        -4px -4px 8px rgba(255, 255, 255, 0.1);
}

.auth-button-row.single-centered .btn:active {
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.1);
}

/* Color variations for single-centered buttons */
.auth-button-row.single-centered .btn-primary {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
}

.auth-button-row.single-centered .btn-neuorange,
.auth-button-row.single-centered .btn.neuorange {
    background: var(--color-bg-primary);
    color: var(--color-accent-orange);
}

.auth-button-row.single-centered .btn-neuorange:hover,
.auth-button-row.single-centered .btn.neuorange:hover {
    color: var(--color-accent-orange-hover);
}

/* Auth Actions Row */
.auth-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-actions .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 150px;
}

.auth-actions .btn:hover {
    transform: translateY(-2px);
}

/* Sign-in Button Variants */
.signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
}

.signin-btn--google {
    background: white !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 2rem !important;
}

.signin-btn--google:hover {
    background: #f9fafb !important;
    color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 2rem !important;
}

.signin-btn--google:focus {
    background: #f9fafb !important;
    color: #374151 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 2rem !important;
}

.signin-btn__icon {
    flex-shrink: 0;
}

.signin-btn__text {
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .auth-actions .btn {
        max-width: none;
    }
    
    .auth-button-row.dual {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .auth-button-row .btn {
        min-width: 100px;
        width: 100%;
    }
    
    .btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }
}

/* Icon Button — square, glyph-only (filter / view toggles).
   `.btn` sets `min-width: 120px` (and 100px in the mobile block above), which
   stretches any square icon button into an oval. `.btn.btn-icon` outranks both
   so the button stays exactly as wide as it is tall. Combine with a skin class:
   `<button class="btn btn-neugrey btn-icon">`. */
.btn.btn-icon {
    position: relative;
    min-width: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    gap: 0;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

.btn.btn-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Active/engaged icon button (e.g. a view toggle that is currently on) */
.btn.btn-icon--on {
    color: var(--color-accent-orange);
}

/* Keyboard focus ring. The neumorphic skins (`.btn-neugrey`, `.btn-neuorange`)
   set `outline: none !important`, which leaves a glyph-only button with no
   visible focus state at all — there is no text to underline and no border to
   brighten. Put one back for icon buttons, `!important` to beat the skin, and
   only on :focus-visible so a mouse click doesn't draw it. */
.btn.btn-icon:focus-visible {
    outline: 2px solid var(--color-accent-orange) !important;
    outline-offset: 2px;
}

/* Header Button Styles */
.header .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    min-width: auto;
}

.header__signin-btn,
.header__logout-btn {
    border-radius: 0.375rem;
}