/* ============================================================================
   HAMBURGER SLIDE-OUT MENU
   ============================================================================ */

/* Overlay backdrop */
.hamburger-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hamburger-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Slide-out menu panel */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 40%;
    min-width: 320px;
    max-width: 600px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.hamburger-menu.active {
    right: 0;
}

/* Mobile: wider menu */
@media (max-width: 768px) {
    .hamburger-menu {
        width: 85%;
        max-width: 400px;
    }
}

/* Menu Header - User Profile Section */
.hamburger-menu-header {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #4caac9, #3d98b3);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hamburger-user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger-profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.hamburger-user-info {
    flex: 1;
    min-width: 0;
}

.hamburger-user-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hamburger-user-email {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close button */
.hamburger-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 1.2rem;
}

.hamburger-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Menu Body */
.hamburger-menu-body {
    flex: 1;
    padding: 0;
}

/* Menu Items */
.hamburger-menu-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.hamburger-menu-item {
    margin: 0;
}

.hamburger-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;              
    background: transparent;  
    border: none;            
    cursor: pointer;         
    text-align: left;        
}

.hamburger-menu-link:hover {
    background: #f8f9fa;
    color: #4caac9;
}

.hamburger-menu-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    color: #4caac9;
    flex-shrink: 0;  /* ADD THIS - prevent icon from shrinking */
}

.hamburger-menu-link,
button.hamburger-menu-link {
    font-family: inherit;        /* Use the same font family */
    font-size: inherit;          /* Same font size */
}

.hamburger-menu-link > span:first-of-type {
    font-size: 0.95rem;
    font-weight: 500;
    flex: 1;  /* Only the first span (the text) should grow */
}

.hamburger-menu-link > span:not(:first-of-type) {
    flex: 0 0 auto;  /* Other spans (like badges) should not grow */
}

/* ADD THIS NEW RULE - style for chevron icon on right */
.hamburger-menu-link .fa-chevron-right {
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.5;
    color: #6c757d;
}

/* Coming Soon badge */
/* Coming Soon badge */
.coming-soon-badge-menu {
    font-size: 0.9rem;           /* Bigger font */
    padding: 3px 8px;            /* More horizontal padding */
    background: #e9ecef;
    color: #6c757d;
    border-radius: 12px;         /* Slightly larger radius */
    font-weight: 600;
    flex-shrink: 0;
    min-width: fit-content;
}

/* Divider */
.hamburger-menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.5rem 0;
}

/* Logout button special styling */
.hamburger-menu-link.logout {
    color: #e74c3c;
    margin-top: 0.5rem;
}

.hamburger-menu-link.logout i {
    color: #e74c3c;
}

.hamburger-menu-link.logout:hover {
    background: #ffeaea;
}

/* Menu Footer (optional for version/credits) */
.hamburger-menu-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.hamburger-menu-footer p {
    margin: 0;
    font-size: 0.75rem;
    color: #6c757d;
}

/* Animation for menu items */
.hamburger-menu.active .hamburger-menu-link {
    animation: slideInRight 0.3s ease forwards;
    opacity: 0;
}

.hamburger-menu.active .hamburger-menu-link:nth-child(1) { animation-delay: 0.05s; }
.hamburger-menu.active .hamburger-menu-link:nth-child(2) { animation-delay: 0.1s; }
.hamburger-menu.active .hamburger-menu-link:nth-child(3) { animation-delay: 0.15s; }
.hamburger-menu.active .hamburger-menu-link:nth-child(4) { animation-delay: 0.2s; }
.hamburger-menu.active .hamburger-menu-link:nth-child(5) { animation-delay: 0.25s; }
.hamburger-menu.active .hamburger-menu-link:nth-child(6) { animation-delay: 0.3s; }
.hamburger-menu.active .hamburger-menu-link:nth-child(7) { animation-delay: 0.35s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* ============================================================================
   SLIDE-OUT PANELS (Profile, Password, Security Question)
   ============================================================================ */

/* Panel-specific styles */
.hamburger-panel {
    right: -100%;
    z-index: 10000; /* Higher than main menu */
}

.hamburger-panel.active {
    right: 0;
}

/* Back button at top of panels */
.hamburger-back-btn {
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(135deg, #4caac9, #3d98b3);
    color: white;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.hamburger-back-btn:hover {
    background: linear-gradient(135deg, #3d98b3, #4caac9);
}

.hamburger-back-btn i {
    font-size: 1.25rem;
}

/* Panel content area */
.panel-content {
    padding: 1.5rem;
    overflow-y: auto;
    height: calc(100vh - 70px); /* Account for back button */
}

.panel-info-item.editable {
    cursor: pointer;
}

.panel-info-item.editable:hover {
    background: #f1f5f9;
    border-color: rgba(76, 170, 201, 0.3);
}

.panel-info-item.editing {
    background: white;
    border-color: #4caac9;
    box-shadow: 0 0 0 3px rgba(76, 170, 201, 0.1);
}

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

/* Flash messages in panels */
.panel-content .flash-messages {
    margin-bottom: 1rem;
}

.panel-content .flash-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideInDown 0.3s ease;
}

.panel-content .flash-message.flash-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.panel-content .flash-message.flash-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.panel-content .flash-message.flash-info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.panel-content .flash-message.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Ensure consistent styling across all pages */
.hamburger-menu,
.hamburger-panel {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Fix for security question display after update */
.panel-info-item .info-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.panel-info-item .panel-edit-link {
    margin-left: auto;
    white-space: nowrap;
}

.hamburger-user-credits {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
}

.hamburger-user-credits i.fa-coins {
    font-size: 0.85rem;
    color: #fbbf24;
}

.hamburger-user-credits .credits-amount {
    font-weight: 600;
    white-space: nowrap;
}

.credits-add-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 0.25rem;
}

.credits-add-btn i {
    font-size: 0.7rem;
}

.credits-add-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.credits-add-btn:active {
    transform: scale(0.95);
}

/* Notification Badge on Bell Icon */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}


/* Mobile adjustments */
@media (max-width: 768px) {
    .hamburger-panel {
        width: 100%;
        max-width: 100%;
    }
    .panel-content {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .panel-btn {
        width: 100%;
    }
}