/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* Sticky Header */
.sticky-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(255,255,255,0.95);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

/* Override container ONLY inside header */
.sticky-header .container {
    max-width: 100%;
    padding-left: 30px;     /* LOGO GAP FROM LEFT */
    padding-right: 30px;
    padding-bottom:10px;
    padding-top: 10px;
}

/* Header layout */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo block */
.logo {
    display: flex;
    align-items: center;
}

/* Logo image */
.logo-image {
    height: 50px;
    width: auto;
    display: block;
}

/* Navigation */
.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: #3498db;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #3498db;
    transition: width 0.3s;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: #2c3e50;
    cursor: pointer;
}

/* Responsive logo */
@media (max-width:1024px){
    .logo-image{height:45px;}
}
@media (max-width:768px){
    .logo-image{height:40px;}
}
@media (max-width:480px){
    .logo-image{height:35px;}
}

/*Header Menus and Buttons Style*/
/* Header Right Buttons */
.header-actions {
    display: flex;
    gap: 12px;
}

.login-btn,
.signup-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Login Button */
.login-btn {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.login-btn:hover {
    background: #3498db;
    color: white;
}

/* Sign Up Button */
.signup-btn {
    background: #3498db;
    border: 2px solid #3498db;
    color: white;
}

.signup-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-actions {
        display: none;
    }
}

/* ==================== AUTHENTICATION STYLES ==================== */
/* ==================== AUTHENTICATION STYLES ==================== */
/* Add these styles to your existing header.css */

.header-auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
}

.profile-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 50px;
    background: #f5f7fa;
    border: 2px solid #e0e6f0;
    transition: all 0.3s ease;
}

.profile-toggle:hover .profile-avatar {
    border-color: #3498db;
    background: #e8f4fc;
}

.profile-avatar i:first-child {
    font-size: 22px;
    color: #3498db;
}

.profile-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 10px;
    color: #7f8c8d;
    transition: transform 0.3s ease;
}

.profile-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 260px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    margin-top: 10px;
    display: none;
    z-index: 1002;
    overflow: hidden;
    border: 1px solid #eaeaea;
    animation: fadeInDropdown 0.25s ease;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    display: block;
}

.dropdown-user-info {
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-icon {
    font-size: 36px;
    opacity: 0.9;
}

.dropdown-user-info div {
    flex: 1;
    min-width: 0;
}

.dropdown-user-info strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-info small {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 6px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: #f8fafd;
    color: #3498db;
    border-left-color: #3498db;
    padding-left: 23px;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: #7f8c8d;
    font-size: 16px;
}

.dropdown-item:hover i {
    color: #3498db;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.95rem;
    color: #2c3e50;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.logout-btn:hover {
    background: #fef2f2;
    color: #e74c3c;
    border-left-color: #e74c3c;
    padding-left: 23px;
}

.logout-btn:hover i {
    color: #e74c3c;
}

/* Mobile Navigation Overlay & Menu */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.mobile-overlay.active {
    display: block;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
}

.mobile-nav-menu.active {
    right: 0;
}

.mobile-nav-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mobile-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: #f0f7ff;
    color: #3498db;
}

.mobile-nav-link i {
    width: 24px;
    text-align: center;
    font-size: 18px;
    color: #7f8c8d;
}

.mobile-nav-link:hover i,
.mobile-nav-link.active i {
    color: #3498db;
}

.mobile-user-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.mobile-user-info i {
    font-size: 40px;
    color: #3498db;
}

.mobile-user-info div {
    flex: 1;
    min-width: 0;
}

.mobile-user-info strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-info small {
    display: block;
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-logout-form {
    margin-top: 15px;
}

.mobile-logout-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    width: 100%;
    background: none;
    border: none;
    color: #e74c3c;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mobile-logout-btn:hover {
    background: #ffeaea;
}

.mobile-logout-btn i {
    width: 24px;
    text-align: center;
    font-size: 18px;
}

.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.mobile-login-btn,
.mobile-signup-btn {
    padding: 16px;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mobile-login-btn {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.mobile-login-btn:hover {
    background: #3498db;
    color: white;
}

.mobile-signup-btn {
    background: #3498db;
    border: 2px solid #3498db;
    color: white;
}

.mobile-signup-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-name {
        display: none;
    }
    
    .profile-avatar {
        padding: 8px 10px;
    }
    
    .dropdown-menu {
        width: 240px;
        right: -10px;
    }
    
    .header-actions {
        display: none !important;
    }
    
    /* Ensure mobile menu button is visible */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        color: #2c3e50;
        cursor: pointer;
        padding: 10px;
        border-radius: 50%;
        transition: background 0.2s ease;
    }
    
    .mobile-menu-btn:hover {
        background: #f0f0f0;
    }
}

@media (min-width: 769px) {
    .mobile-nav-menu,
    .mobile-overlay {
        display: none !important;
    }
    
    /* Hide mobile menu button on desktop if using new mobile menu */
    .mobile-menu-btn[data-new-menu="true"] {
        display: none !important;
    }
}

/* Fix for existing mobile menu compatibility *
.main-nav.active {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.main-nav.active ul {
    flex-direction: column;
    gap: 15px;
}*/

/* Ensure proper z-index layering */
.sticky-header {
    z-index: 1000;
}

.dropdown-menu {
    z-index: 1002;
}

.mobile-nav-menu {
    z-index: 1001;
}

.mobile-overlay {
    z-index: 1000;
}

/* ==================== FIX FOR STICKY HEADER ==================== */
/* Add this to ensure sticky header works properly */
html, body {
    overflow-x: hidden;
}

.sticky-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
}

/* Add padding to body to prevent content from hiding behind fixed header */
body {
    padding-top: 70px !important;
}

/* Remove the red debug border (optional - you can keep it if you want) */
.sticky-header {
    border-bottom: none !important;
}

/* ================= HEADER RESPONSIVE FIX ================= */

@media (max-width: 1024px) {
    .main-nav ul {
        gap: 20px;
    }

    .main-nav a {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {

    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .header-container {
        justify-content: space-between;
    }

}

@media (max-width: 480px) {

    .logo-image {
        height: 32px;
    }

    .profile-avatar {
        padding: 6px 8px;
    }

}