:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2d2d2d;
    --accent-orange: #ffcc00;
    --accent-orange-dark: #e6b800;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #888888;
    --border-dark: #333333;
}

/* Custom animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 204, 0, 0.3), 0 0 10px rgba(255, 204, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.5), 0 0 20px rgba(255, 204, 0, 0.3);
    }
}

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

.header-container {
    position: relative;
    z-index: 1001;
    width: 100%;
}

.header-container:has(.notification-panel.show) {
    position: sticky;
    top: 0;
    z-index: 1001;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.slide-out-left {
    animation: slideOutLeft 0.3s ease-in;
}

.notification-pulse {
    animation: notificationPulse 1.5s infinite;
}

.spin-animation {
    animation: spin 1s linear infinite;
}

.glow-effect {
    animation: glow 2s infinite;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 3px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 2px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 204, 0, 0.3);
    border-radius: 2px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 204, 0, 0.5);
}

/* Enhanced menu button animation */
.enhanced-menu-line {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.enhanced-menu-button.active .enhanced-menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.enhanced-menu-button.active .enhanced-menu-line:nth-child(2) {
    opacity: 0;
}

.enhanced-menu-button.active .enhanced-menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Glassmorphism effect */
.glass-effect {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced hover effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Gradient background */
.gradient-bg {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Enhanced side menu styling */
.enhanced-side-nav {
    background: linear-gradient(180deg, #151515 0%, #1a1a1a 100%);
    border-right: 1px solid rgba(255, 204, 0, 0.1);
}

.enhanced-nav-item {
    position: relative;
    overflow: hidden;
}

.enhanced-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.1), transparent);
    transition: left 0.5s;
}

.enhanced-nav-item:hover::before {
    left: 100%;
}

/* Enhanced notification styles */
.enhanced-notification-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin-bottom: 2px;
    background: rgba(45, 45, 45, 0.3);
    border: 1px solid rgba(255, 204, 0, 0.1);
}

.enhanced-notification-item:hover {
    background: rgba(45, 45, 45, 0.6);
    border-color: rgba(255, 204, 0, 0.2);
    transform: translateX(2px);
}

.enhanced-notification-item.unread {
    border-left: 2px solid var(--accent-orange);
    background: rgba(255, 204, 0, 0.05);
}

/* Modern badge styling */
.modern-badge {
    position: relative;
    overflow: hidden;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification indicator positioning */
.enhanced-notification-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-bg);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    z-index: 10;
}

/* Modern notification panel */
.notification-panel {
    background: rgba(45, 45, 45, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notification-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 204, 0, 0.1);
    background: rgba(45, 45, 45, 0.5);
    border-radius: 12px 12px 0 0;
}

.notification-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-orange);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-header h3 span {
    font-size: 12px;
}

.notification-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.notification-content:empty::before {
    content: '';
    display: block;
    padding: 20px;
}

/* Loading state */
.notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.notification-loading .loading-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 204, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.notification-loading h4 {
    font-size: 13px;
    font-weight: 500;
    color: white;
    margin: 0 0 6px 0;
}

.notification-loading p {
    font-size: 11px;
    color: #888;
    margin: 0;
}

/* Auto-load more indicator */
.auto-load-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 11px;
    color: #888;
    border-top: 1px solid rgba(255, 204, 0, 0.1);
}

.auto-load-indicator .spinner {
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-top: 1px solid var(--accent-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mobile-optimized styles */
@media (max-width: 640px) {
    /* Header adjustments */
    .tw-header {
        padding: 0 12px;
        min-height: 56px;
    }

    .tw-header-left {
        gap: 8px;
        min-width: auto;
    }

    /* Menu button - smaller and more proportional */
    .enhanced-menu-button {
        padding: 8px;
        border-radius: 8px;
    }

    .enhanced-menu-line {
        width: 18px;
        height: 2px;
        margin: 3px 0;
    }

    /* Notification bell - properly sized and positioned */
    .enhanced-notification-bell {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px;
        border-radius: 8px;
        position: relative;
    }

    .enhanced-notification-bell svg {
        width: 18px;
        height: 18px;
    }

    /* Logo mobile adjustments */
    .tw-header-center h1 {
        font-size: 18px !important;
        line-height: 24px;
        font-weight: 500;
    }

    /* Auth placeholder mobile adjustments */
    .header-right .auth-placeholder {
        max-width: 100px;
        font-size: 12px;
    }

    .header-right .auth-placeholder .login-btn,
    .header-right .auth-placeholder .user-btn {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 6px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Compact notification panel for mobile */
    .notification-panel {
        width: calc(100vw - 24px);
        max-width: 320px;
        left: 12px;
        position: fixed;
        top: 64px;
        z-index: 1050;
        border-radius: 8px;
        max-height: calc(100vh - 80px);
    }

    .notification-container .notification-panel.show {
        position: fixed;
        top: 64px;
        left: 12px;
        right: auto;
        width: calc(100vw - 24px);
        max-width: 320px;
        z-index: 1050;
    }

    /* Compact notification content */
    .notification-header {
        padding: 10px 12px;
    }

    .notification-header h3 {
        font-size: 13px;
    }

    .notification-content {
        max-height: 240px;
        padding: 6px;
    }

    /* Compact notification items */
    .enhanced-notification-item {
        padding: 8px 10px;
        margin-bottom: 1px;
        border-radius: 6px;
        font-size: 12px;
        line-height: 1.4;
    }

    .enhanced-notification-item .notification-title {
        font-size: 12px;
        font-weight: 500;
        margin-bottom: 2px;
    }

    .enhanced-notification-item .notification-body {
        font-size: 11px;
        color: #ccc;
        line-height: 1.3;
    }

    .enhanced-notification-item .notification-time {
        font-size: 9px;
        color: #888;
        margin-top: 4px;
    }

    /* Auto-load indicator compact */
    .auto-load-indicator {
        padding: 8px;
        font-size: 10px;
    }

    .auto-load-indicator .spinner {
        width: 10px;
        height: 10px;
    }

    /* Loading state compact */
    .notification-loading {
        padding: 16px;
    }

    .notification-loading .loading-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 8px;
    }

    .notification-loading h4 {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .notification-loading p {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    /* Extra compact for very small screens */
    .tw-header {
        padding: 0 10px;
        min-height: 52px;
    }

    .tw-header-center h1 {
        font-size: 16px !important;
        line-height: 20px;
    }

    .enhanced-menu-button {
        padding: 6px;
    }

    .enhanced-menu-line {
        width: 16px;
        height: 1.5px;
        margin: 2.5px 0;
    }

    .enhanced-notification-bell {
        width: 28px;
        height: 28px;
        padding: 5px;
    }

    .enhanced-notification-bell svg {
        width: 16px;
        height: 16px;
    }

    .enhanced-notification-indicator {
        min-width: 14px;
        height: 14px;
        font-size: 9px;
        top: -1px;
        right: -1px;
    }

    .notification-panel {
        width: calc(100vw - 20px);
        max-width: 280px;
        left: 10px;
        top: 60px;
        border-radius: 6px;
    }

    .notification-container .notification-panel.show {
        left: 10px;
        width: calc(100vw - 20px);
        max-width: 280px;
        top: 60px;
    }

    .notification-header {
        padding: 8px 10px;
    }

    .notification-header h3 {
        font-size: 12px;
    }

    .notification-content {
        max-height: 200px;
        padding: 5px;
    }

    .enhanced-notification-item {
        padding: 6px 8px;
        font-size: 11px;
    }

    .enhanced-notification-item .notification-title {
        font-size: 11px;
    }

    .enhanced-notification-item .notification-body {
        font-size: 10px;
    }

    .enhanced-notification-item .notification-time {
        font-size: 8px;
        margin-top: 3px;
    }
}

/* Dark theme enhancements */
@media (prefers-color-scheme: dark) {
    .notification-panel {
        background: rgba(26, 26, 26, 0.98);
        border-color: rgba(255, 204, 0, 0.15);
    }
    
    .notification-header {
        background: rgba(26, 26, 26, 0.8);
    }
    
    .enhanced-notification-item {
        background: rgba(45, 45, 45, 0.4);
    }
    
    .enhanced-notification-item:hover {
        background: rgba(45, 45, 45, 0.7);
    }
}