/* Header Component Styles */
/* ======================== */
/* Primary: #9745b8 | Dark: #7a3499 | Light: #ab5ed0 */

html {
    background-color: #0a0a0f;
}

body {
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
}

/* Background Image */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.35;
    z-index: -2;
}

/* Dark overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(10, 10, 18, 0.85) 0%, rgba(14, 10, 22, 0.92) 100%);
    z-index: -1;
}

/* Main Header */
.app-header {
    background: rgba(16, 14, 24, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(151, 69, 184, 0.15);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

/* Logo Section */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo:hover .header-logo-img {
    transform: scale(1.05);
}

.header-logo-fallback {
    width: 44px;
    height: 44px;
    background: #9745b8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.3s ease;
}

.header-logo:hover .header-logo-fallback {
    transform: scale(1.05);
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.header-title .page-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

/* Navigation and Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    background: rgba(151, 69, 184, 0.06);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid rgba(151, 69, 184, 0.1);
}

.header-nav-link {
    padding: 7px 16px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.header-nav-link:hover {
    background: rgba(151, 69, 184, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

.header-nav-link.active {
    background: #9745b8;
    color: #fff;
}

.header-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(200, 60, 60, 0.08);
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(200, 60, 60, 0.12);
    white-space: nowrap;
    margin-left: 4px;
}

.header-btn:hover {
    background: rgba(200, 60, 60, 0.2);
    border-color: rgba(200, 60, 60, 0.35);
    color: #ff8a8a;
}

.header-btn-admin {
    background: #c0392b;
    color: white;
    border: none;
}

.header-btn-admin:hover {
    background: #a93226;
}

/* Admin Badge */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #c0392b;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

/* Content Area */
.app-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Popup overlay */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.popup-box {
    background: rgba(20, 18, 30, 0.97);
    border: 1px solid rgba(151, 69, 184, 0.2);
    border-radius: 16px;
    padding: 28px;
    max-width: 420px;
    width: 100%;
    animation: popupSlide 0.25s ease-out;
}

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

.popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.popup-header img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.popup-title {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.popup-body {
    color: #c0c0c0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
}

.popup-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-btn-close {
    background: #9745b8;
    color: white;
}

.popup-btn-close:hover {
    background: #ab5ed0;
}

.popup-success {
    border-color: rgba(46, 204, 113, 0.3);
}

.popup-success .popup-title {
    color: #2ecc71;
}

.popup-error {
    border-color: rgba(231, 76, 60, 0.3);
}

.popup-error .popup-title {
    color: #e74c3c;
}

.popup-info {
    border-color: rgba(151, 69, 184, 0.3);
}

.popup-info .popup-title {
    color: #ab5ed0;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .header-container {
        gap: 16px;
    }
    
    .header-title h1 {
        font-size: 16px;
    }
    
    .header-nav-link {
        padding: 7px 12px;
        font-size: 12px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .app-header {
        padding: 10px 16px;
    }
    
    .header-container {
        gap: 12px;
    }
    
    .header-logo {
        width: 100%;
        margin-bottom: 6px;
    }
    
    .header-actions {
        width: 100%;
        gap: 6px;
    }
    
    .header-nav {
        width: 100%;
        gap: 4px;
    }
    
    .header-nav-link {
        flex: 1;
        min-width: 100px;
        padding: 7px 10px;
        font-size: 12px;
        text-align: center;
    }
    
    .header-btn {
        padding: 7px 10px;
        font-size: 12px;
    }
    
    .header-title h1 {
        font-size: 15px;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .app-header {
        padding: 8px 12px;
    }
    
    .header-container {
        gap: 8px;
    }
    
    .header-logo {
        gap: 8px;
    }
    
    .header-logo-img,
    .header-logo-fallback {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .header-logo-fallback {
        font-size: 18px;
    }
    
    .header-title h1 {
        font-size: 13px;
    }
    
    .header-title .page-name {
        font-size: 10px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 4px;
    }
    
    .header-nav {
        width: 100%;
        gap: 3px;
    }
    
    .header-nav-link {
        flex: 1;
        min-width: auto;
        padding: 6px 6px;
        font-size: 10px;
        border: none;
        background: rgba(151, 69, 184, 0.12);
    }
    
    .header-nav-link:hover {
        background: rgba(151, 69, 184, 0.25);
    }
    
    .header-btn {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .header-user-name {
        display: none;
    }
}
