/* ================================
   Header, Navigation & Footer Styles
   Rollenplanner - Global Layout Components
   ================================ */

/* ===== GLOBAL FONT OVERRIDES ===== */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

h1, h2, h3, h4, h5, h6, .fw-bold, .fw-800 {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    font-weight: 800;
}

/* ===== PRIMARY BUTTON OVERRIDE ===== */
.btn-primary-custom {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

/* ===== EMOJI FIX VOOR WINDOWS ===== */
.emoji-icon {
    font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    font-size: 1.5em;
    margin-right: 10px;
    display: inline-block;
    line-height: 1;
}

.logo-icon {
    font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    font-size: 1.8rem;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

/* ===== LOGO STYLING ===== */
.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo .logo-text,
.logo-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* ===== TOKEN DISPLAY ===== */
.token-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-radius: 50px;
    font-weight: 600;
    color: var(--warning);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

.token-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    background: linear-gradient(135deg, #FFE0B2, #FFCC80);
    color: #E65100;
}

a.token-display {
    text-decoration: none;
}

.token-display .btn-buy-tokens {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--warning);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.3s ease;
}

.token-display:hover .btn-buy-tokens {
    background: var(--accent-dark);
    transform: scale(1.1);
}

/* ===== BUTTON STYLES ===== */
.btn-outline-primary {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Universele button link styling - geen underlines */
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active,
a.btn:visited,
a[class*="btn-"],
a[class*="btn-"]:hover,
a[class*="btn-"]:focus,
a[class*="btn-"]:active,
a[class*="btn-"]:visited {
    text-decoration: none;
}

/* ===== USER MENU ===== */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: white;
    border: 2px solid #E8F4F8;
    border-radius: 50px;
    padding: 8px 15px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu-toggle:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 99999;
    display: block;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-link:hover {
    background: #F8F9FA;
    color: var(--primary);
    padding-left: 25px;
}

/* Admin link styling */
.dropdown-link.admin-link {
    background: linear-gradient(135deg, #FFE5E5, #FFF0F0);
    color: #dc3545;
    font-weight: 600;
}

.dropdown-link.admin-link:hover {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.dropdown-link.admin-link i {
    color: inherit;
}

/* ===== USER AVATAR ===== */
.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--orange));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-avatar.admin-avatar {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

/* ===== GUEST NAV ===== */
.guest-nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.guest-nav .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.guest-nav .nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* ===== BREADCRUMBS ===== */
.breadcrumb-nav {
    background: rgba(248, 251, 253, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 20px;
    margin: 20px 0;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.breadcrumb {
    margin: 0;
    background: none;
    padding: 0;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: #6c757d;
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #667eea;
    font-weight: 600;
    margin: 0 8px;
    opacity: 0.7;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.breadcrumb-item a:hover {
    color: #4ECDC4;
    background: rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--dark);
    font-weight: 600;
}

/* Keep first-page containers flush with the global header/breadcrumb spacing */
.main-content > .container.my-4,
.main-content > .container.my-5,
.main-content > .container.mt-4,
.main-content > .container.mt-5 {
    margin-top: 0 !important;
}

.breadcrumbs-container {
    margin-top: 6px;
}

/* ===== Z-INDEX HIERARCHY ===== */
.cookie-banner {
    z-index: 10000;
}

.user-dropdown {
    z-index: 99999;
}

.main-nav,
.guest-nav {
    z-index: 9998;
}

.mobile-nav {
    z-index: 9997;
}

.main-footer {
    z-index: 100;
}

.hero-section,
.version-banner,
section {
    position: relative;
    z-index: 1;
}

/* Ensure Bootstrap overlays stay above nav/dropdowns/footer layers */
.modal-backdrop {
    z-index: 100000 !important;
}

.modal {
    z-index: 100001 !important;
}

.offcanvas-backdrop {
    z-index: 100000 !important;
}

.offcanvas {
    z-index: 100001 !important;
}

/* ===== MEDIUM-LARGE SCREENS: Compact nav, iconen + highlight (1201px - 1400px) ===== */
@media (min-width: 1201px) and (max-width: 1400px) {
    .nav-container {
        height: 56px;
        padding: 0 15px;
    }

    .nav-left {
        gap: 20px;
    }

    .nav-logo {
        gap: 6px;
        font-size: 1.15rem;
    }

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

    .nav-link {
        padding: 7px 14px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .nav-menu {
        gap: 3px;
    }

    .nav-right {
        gap: 12px;
    }

    .token-display {
        padding: 6px 12px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .btn-buy-tokens {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .user-menu-toggle {
        padding: 5px 10px;
        gap: 6px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .user-name {
        display: none;
    }
}

/* ===== MEDIUM SCREENS: Compact nav, iconen only (769px - 1200px) ===== */
@media (min-width: 769px) and (max-width: 1200px) {
    .nav-container {
        height: 56px;
        padding: 0 15px;
    }

    .nav-left {
        gap: 20px;
    }

    .nav-logo {
        gap: 6px;
        font-size: 1.15rem;
    }

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

    .nav-link {
        padding: 7px 14px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .nav-menu {
        gap: 3px;
    }

    .nav-right {
        gap: 12px;
    }

    .token-display {
        padding: 6px 12px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .btn-buy-tokens {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .user-menu-toggle {
        padding: 5px 10px;
        gap: 6px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .user-name {
        font-size: 0.85rem;
    }
}

/* ===== DESKTOP FOOTER (min-width: 769px) ===== */
@media (min-width: 769px) {
    .main-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(248, 251, 253, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.05);
        padding: 10px 0;
        border-top: 1px solid rgba(0, 0, 0, 0.03);
        transition: transform 0.3s ease;
    }

    .main-content {
        padding-top: 0;
        padding-bottom: 70px;
    }

    .main-footer .footer-content {
        padding: 0;
        margin: 0;
        gap: 8px;
    }

    .main-footer .footer-text {
        margin-bottom: 3px;
        font-size: 0.85rem;
    }

    .main-footer .footer-links {
        font-size: 0.85rem;
        gap: 15px;
        display: flex;
    }
}

/* ===== MOBILE STYLES (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Main nav mobile layout */
    .main-nav {
        display: block;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        padding: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9997;
        min-height: auto;
        height: auto;
    }

    .main-nav .nav-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10px 15px;
        height: auto;
        background: white;
        max-width: 100%;
        gap: 10px;
    }

    .main-nav .nav-left {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 0;
    }

    .main-nav .nav-logo {
        display: flex;
        align-items: center;
        gap: 6px;
        text-decoration: none;
    }

    .main-nav .logo-icon {
        font-size: 1.6rem;
        font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    }

    .main-nav .logo-text {
        font-size: 1.25rem;
        font-family: 'Plus Jakarta Sans', sans-serif;
        font-weight: 800;
        background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        display: inline-block;
        line-height: 1.2;
        color: transparent;
    }

    /* Hide desktop menu on mobile */
    .main-nav .nav-menu {
        display: none;
    }

    /* Right side items on second row */
    .main-nav .nav-right {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .main-nav .token-display {
        padding: 6px 12px;
        font-size: 0.85rem;
        background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
        border-radius: 50px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .main-nav .token-display .btn-buy-tokens {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .main-nav .user-menu-toggle {
        padding: 6px 12px;
        background: white;
        border: 2px solid #E8F4F8;
        border-radius: 50px;
    }

    .main-nav .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .main-nav .user-name {
        display: none;
    }

    /* Guest nav mobile */
    .guest-nav {
        display: block;
        padding: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9997;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        min-height: auto;
    }

    .guest-nav .nav-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10px 15px;
        height: auto;
        background: white;
        max-width: 100%;
        gap: 10px;
    }

    .guest-nav .nav-logo {
        display: flex;
        align-items: center;
        gap: 6px;
        justify-content: center;
        width: 100%;
    }

    .guest-nav .nav-actions {
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .guest-nav .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .guest-nav .btn i {
        margin-right: 4px;
        font-size: 0.8rem;
    }

    .guest-nav .logo-icon {
        font-size: 1.6rem;
        font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    }

    .guest-nav .logo-text {
        font-size: 1.25rem;
        font-family: 'Plus Jakarta Sans', sans-serif;
        font-weight: 800;
        background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        display: inline-block;
        line-height: 1.2;
        color: transparent;
    }

    /* Dynamic header offset: JS sets --mobile-header-offset from rendered nav height */
    body {
        padding-top: var(--mobile-header-offset, 96px);
    }

    .main-content {
        padding-top: 8px;
        padding-bottom: 16px;
    }

    /* Footer mobile base (final compact behavior is defined in footer.php CSS) */
    .main-footer-static {
        display: block;
        margin-bottom: 0;
    }

    .main-footer {
        position: static;
        bottom: auto;
        left: auto;
        right: auto;
        margin-bottom: 0;
        background: #f8fbfd;
        padding: 8px 0;
        box-shadow: none;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        z-index: auto;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Mobile nav */
    .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
        z-index: 1000;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding: 0;
        height: 60px;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 5px;
        text-decoration: none;
        color: #6c757d;
        transition: all 0.2s ease;
        position: relative;
        height: 100%;
    }

    .mobile-nav-item i {
        font-size: 1.2rem;
        margin-bottom: 2px;
        transition: all 0.2s ease;
    }

    .mobile-nav-item span {
        font-size: 0.6rem;
        font-weight: 600;
        opacity: 0.9;
        white-space: nowrap;
    }

    .mobile-nav-item.active {
        color: var(--primary);
    }

    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 3px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-radius: 0 0 3px 3px;
    }

    /* Admin item mobile */
    .mobile-nav-item.admin-item {
        color: #dc3545;
    }

    .mobile-nav-item.admin-item.active {
        color: #dc3545;
    }

    .mobile-nav-item.admin-item.active::before {
        background: linear-gradient(135deg, #dc3545, #c82333);
    }

    /* Highlight button (Plus button) */
    .mobile-nav-item.highlight {
        position: relative;
        margin-top: -20px;
        padding-top: 0;
        background: none;
        background-color: transparent;
        border: none;
        box-shadow: none;
    }

    .mobile-nav-item.highlight::before,
    .mobile-nav-item.highlight::after {
        display: none;
    }

    .mobile-nav-item.highlight:hover,
    .mobile-nav-item.highlight:active,
    .mobile-nav-item.highlight:focus {
        background: none;
        background-color: transparent;
        border: none;
        box-shadow: none;
    }

    .mobile-nav-item.highlight i {
        background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
        color: white;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
        margin-bottom: 0;
        transition: all 0.3s ease;
        border: none;
    }

    .mobile-nav-item.highlight span {
        display: none;
    }

    .mobile-nav-item.highlight:active i {
        transform: scale(0.95);
    }

    /* Hover effects for mobile (for devices with hover) */
    @media (hover: hover) {
        .mobile-nav-item:hover {
            color: var(--primary);
        }

        .mobile-nav-item.admin-item:hover {
            color: #dc3545;
        }

        .mobile-nav-item:hover i {
            transform: translateY(-2px);
        }

        .mobile-nav-item.highlight:hover i {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
        }
    }

    /* Touch feedback */
    .mobile-nav-item:active {
        transform: scale(0.95);
    }

    /* Breadcrumb mobile */
    .breadcrumb-nav {
        margin: 6px 0;
        padding: 8px 15px;
        border-radius: 8px;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 6px;
    }

    .main-content > .container.my-5 {
        margin-bottom: 1.5rem !important;
    }
}
