/* ==================== SHARED COMPONENT STYLES ==================== */
/* This file contains reusable component styles used across multiple pages */

/* ==================== BUTTONS ==================== */

.btn-primary {
    background: var(--orange-500);
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary:hover:not(:disabled) {
    background: var(--orange-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: white;
    color: var(--orange-500);
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid var(--orange-500);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--orange-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:disabled {
    border-color: var(--gray-300);
    color: var(--gray-400);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Profile Button in Header */
.btn-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    background-color: var(--gray-100);
    color: var(--gray-800);
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-profile:hover {
    background-color: var(--orange-100);
    color: var(--orange-600);
    transform: translateY(-1px);
}

.btn-profile svg {
    width: 20px;
    height: 20px;
    color: inherit;
}

/* Hero Page Buttons (Landing) */
.btn-primary-hero {
    display: inline-block;
    background: var(--orange-500);
    color: white;
    padding: 20px 48px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary-hero:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    background: var(--orange-600);
}

.btn-secondary-hero {
    display: inline-block;
    background: var(--orange-300);
    color: var(--blue-900);
    padding: 20px 48px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-secondary-hero:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    background: var(--gray-50);
}

/* ==================== CONTAINERS ==================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== CARDS ==================== */

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ==================== BADGES ==================== */

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--orange-100);
    color: var(--orange-700);
}

.badge-secondary {
    background: var(--blue-100);
    color: var(--blue-700);
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success-dark);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.hide {
    transform: translateY(100px);
    opacity: 0;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    font-weight: 500;
    color: var(--gray-700);
}

/* ==================== LOADING SPINNER ==================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--orange-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== RESPONSIVE UTILITIES ==================== */

@media (max-width: 768px) {

    .container,
    .container-narrow,
    .container-wide {
        padding: 0 16px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
        font-size: 0.9375rem;
    }

    .btn-primary-hero,
    .btn-secondary-hero {
        padding: 16px 32px;
        font-size: 1rem;
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: calc(100% - 32px);
    }

}

/* ==================== MOBILE NAVIGATION (CONSOLIDATED) ==================== */

/* Mobile Menu Toggle Button (Hamburger) */
.header-mobile-toggle {
    display: none;
    /* Hidden on desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
    padding: 0;
}

.header-mobile-toggle:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .header-mobile-toggle {
        display: flex;
        /* Show on mobile/tablet */
    }
}

/* Mobile Navigation Overlay - The Backdrop */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none !important;
    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show state controlled by JS */
.mobile-nav-overlay.show {
    display: block !important;
    opacity: 1;
}

/* The Grid/Drawer Container */
.mobile-nav-modal {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 85%;
    max-width: 360px;
    height: 100dvh;
    height: 100vh;
    /* Fallback */
    background: white;
    display: flex !important;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    z-index: 2001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

/* Slide in when overlay is shown */
.mobile-nav-overlay.show .mobile-nav-modal {
    right: 0 !important;
}

/* Mobile Nav Header (Logo + Close) */
.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.mobile-nav-logo {
    height: 40px;
    width: auto;
}

.mobile-nav-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-nav-close:hover {
    background: var(--gray-100);
    color: var(--error);
    border-color: var(--gray-300);
}

/* Mobile Nav Categories (Accordion) */
.mobile-nav-categories {
    padding: 16px 20px;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0 20px;
}

/* Mobile Nav Links Container */
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    gap: 8px;
}

/* Mobile Nav Link Item */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: var(--gray-50);
}

.mobile-nav-link:hover {
    background: var(--orange-50);
    color: var(--orange-600);
    transform: translateX(4px);
}

.mobile-nav-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

/* Mobile Nav CTA Button */
.mobile-nav-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin-top: 8px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--orange-500) 0%, var(--orange-700) 100%);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.mobile-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Hamburger Animation - Active State (X) */
.header-mobile-toggle.active .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header-mobile-toggle.active .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.header-mobile-toggle.active .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hide Desktop Nav on Mobile/Tablet */
@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }

    .nav-auth {
        display: none !important;
    }
}