/* Header Styles */
header { 
    position: fixed; 
    top: 0; 
    left: 0;
    right: 0;
    z-index: 10000; 
    background: #ffffff; 
    border-bottom: 1px solid var(--border);
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 64px;
}

.header-inner { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    height: 64px; 
}

/* Menu Button */
.menu-btn { 
    border: none; 
    background: transparent; 
    font-size: 20px; 
    padding: 6px; 
    cursor: pointer; 
}

.menu-btn .icon-placeholder {
    font-size: 20px;
    color: var(--text);
}

/* Brand/Logo */
.brand { 
    display: inline-flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: 700; 
    font-size: 18px; 
    white-space: nowrap; 
}

.brand-logo { 
    height: 24px; 
    width: auto; 
    display: block; 
}

/* Search Bar */
.search { 
    flex: 1; 
    display: flex; 
}

.search-form {
    flex: 1;
    display: flex;
    position: relative;
}

.search input { 
    flex: 1; 
    height: 40px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    padding: 0 50px 0 36px; 
    outline: none; 
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%239ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>') no-repeat 10px center; 
}

.search input:focus {
    border-color: #000;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    width: 40px;
    border: none;
    background: #000;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: #333;
}

.search-btn svg {
    width: 16px;
    height: 16px;
}

/* Navigation */
.nav { 
    display: flex; 
    align-items: center; 
    gap: 18px; 
}

.nav a { 
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    transition: color 0.2s ease;
    text-decoration: none;
    font-size: 14px;
}

.nav a:hover {
    color: var(--brand);
}

.nav .btn { 
    padding: 8px 14px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
}

.nav .btn-primary {
    background: #fff;
    border-color: #d1d5db;
    font-weight: 600;
    box-shadow: none;
}

/* Custom Icon Styling */
.custom-icon {
    display: inline-block;
    color: var(--text);
    vertical-align: middle;
    transition: color 0.2s ease;
}

.nav a:hover .custom-icon {
    color: var(--brand);
}

.nav .btn-primary .custom-icon {
    color: var(--brand);
}

.nav .btn-primary:hover .custom-icon {
    color: #fff;
}

/* Responsive Header */
@media (max-width: 900px) {
    .nav { 
        display: none; 
    }
}

@media (max-width: 768px) {
    .header-inner { 
        display: flex;
        align-items: center;
        gap: 8px; 
        height: 64px;
        padding: 0 8px;
    }

    .menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 4px;
    }

    .brand {
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    .brand a {
        display: flex;
        align-items: center;
        height: 100%;
    }

    .brand-logo {
        height: 20px;
        width: auto;
        display: block;
    }

    .search { 
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
    }
    
    .search-form {
        width: 100%;
        display: flex;
        align-items: center;
    }

    .search input { 
        height: 38px; 
        min-width: 0; 
        width: 100%; 
        padding: 0 38px 0 28px;
        font-size: 12px;
        background-position: 6px center;
        background-size: 12px;
    }

    .search-btn {
        right: 4px;
        width: 30px;
        height: 30px;
    }
}

/* Mobile Navigation Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px; /* Start hidden on the left */
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 10002;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.open {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text, #1f2937);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text, #1f2937);
    text-decoration: none;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.drawer-nav a:hover {
    background: #f3f4f6;
    color: var(--brand, #4f46e5);
}

.drawer-link-with-lottie {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-divider {
    height: 1px;
    background: var(--border, #e5e7eb);
    margin: 8px 0;
}

.drawer-user-info {
    padding: 8px 12px;
    font-size: 14px;
    color: #4b5563;
}

.drawer-logout-form {
    margin: 0;
    width: 100%;
}

.drawer-logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    color: #ef4444;
    text-align: left;
    font-size: 16px;
    padding: 8px 12px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.drawer-logout-btn:hover {
    background: #fee2e2;
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
    font-size: 14px;
    color: var(--text);
}

.user-menu-btn:hover {
    background: #f3f4f6;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #2d3748;
    text-decoration: none;
    transition: background 0.3s;
    border-bottom: 1px solid #e2e8f0;
}

.user-dropdown a:hover {
    background: #f7fafc;
}

.user-dropdown a i {
    margin-right: 8px;
}

.user-dropdown .logout-btn {
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    color: #e53e3e;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
    font-family: inherit;
}

.user-dropdown .logout-btn:hover {
    background: #fff5f5;
}

.user-dropdown .logout-btn i {
    margin-right: 8px;
}

.user-dropdown form {
    margin: 0;
}
