/* 
 * HEADER STYLES - ZGODNE Z RZECZYWISTĄ STRUKTURĄ HTML
 * Naprawione aby działać z header.html
 */

:root {
    --starfleet-blue: #00b8ff;
    --starfleet-blue-dark: #0066cc;
    --starfleet-blue-light: #66e0ff;
    --starfleet-gold: #ffd700;
    --starfleet-silver: #c0c0c0;
    --starfleet-red: #ff3366;
    --starfleet-green: #00ff9d;
    --starfleet-purple: #9d4edd;
    --starfleet-black: #0a0a1a;
    --starfleet-gray: #1a1a2e;
    --starfleet-white: #f0f8ff;
    
    /* WYSOKOŚCI NAGŁÓWKA */
    --header-height-desktop: 130px;
    --header-height-tablet: 120px;
    --header-height-mobile: 70px;
    --mobile-nav-height: 65px;
}

/* RESET MARGINÓW I PADDINGÓW */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* ========== KOSMICZNE TŁO ========== */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 184, 255, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(157, 78, 221, 0.08) 0%, transparent 30%),
        linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 25%, #1e3c72 50%, #0066cc 75%, #0a0a1a 100%);
    background-size: 300% 300%;
    animation: warp 30s ease infinite;
    pointer-events: none;
}

/* ========== GŁÓWNY NAGŁÓWEK - SOLIDNE TŁO ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    background: linear-gradient(180deg, 
        rgba(10, 10, 26, 1) 0%, 
        rgba(15, 15, 35, 1) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 184, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(0, 184, 255, 0.2);
    height: var(--header-height-desktop);
    margin: 0;
    padding: 0;
}

/* Efekt świetlnej belki */
.header::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--starfleet-blue-light) 20%,
        var(--starfleet-green) 50%,
        var(--starfleet-blue-light) 80%,
        transparent);
    box-shadow: 0 0 15px var(--starfleet-blue);
    animation: pulse 2s infinite;
}

/* ========== HEADER CONTAINER ========== */
.header-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* ========== ROW 1 - LOGO I NAWIGACJA ========== */
.header-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
}

/* ========== LOGO ========== */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid rgba(0, 184, 255, 0.4);
    transition: all 0.3s ease;
    min-width: 220px;
    height: 50px;
    box-sizing: border-box;
}

.logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 255, 0.4);
    border-color: var(--starfleet-blue-light);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--starfleet-blue) 0%, var(--starfleet-blue-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    border: 2px solid var(--starfleet-gold);
    box-shadow: 0 0 15px var(--starfleet-blue);
    flex-shrink: 0;
}

.logo-text {
    flex: 1;
    min-width: 0;
    padding: 2px 0;
}

.logo-text h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(90deg, 
        var(--starfleet-blue-light) 0%,
        var(--starfleet-white) 50%,
        var(--starfleet-blue-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
    line-height: 1.2;
}

.logo-text p {
    margin: 3px 0 0 0;
    font-size: 11px;
    color: var(--starfleet-silver);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.1;
}

/* ========== DESKTOP NAVIGATION ========== */
.nav {
    display: flex;
    gap: 6px;
    background: rgba(0, 10, 20, 0.7);
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 184, 255, 0.4);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
    flex: 1;
    justify-content: center;
    max-width: 900px;
    height: 50px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--starfleet-silver);
    text-decoration: none;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: rgba(0, 20, 40, 0.7);
    min-width: 110px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
    height: 36px;
    box-sizing: border-box;
}

.nav-link:hover {
    color: white;
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.4) 0%,
        rgba(157, 78, 221, 0.4) 100%);
    border-color: var(--starfleet-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 184, 255, 0.4);
}

.nav-link.active {
    color: white;
    background: linear-gradient(135deg, 
        var(--starfleet-blue) 0%,
        var(--starfleet-purple) 100%);
    border-color: var(--starfleet-gold);
    box-shadow: 0 0 20px rgba(0, 184, 255, 0.6),
                inset 0 0 15px rgba(255, 255, 255, 0.1);
}

.nav-link i {
    font-size: 14px;
    flex-shrink: 0;
}

.nav-link span {
    font-size: 12px;
    line-height: 1;
}

/* ========== ROW 2 - INFO FIRMOWE I PANEL UŻYTKOWNIKA ========== */
.header-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(0, 184, 255, 0.2);
}

/* ========== INFO FIRMOWE ========== */
.company-info {
    display: flex;
    gap: 20px;
    flex: 1;
    background: rgba(0, 10, 20, 0.5);
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 184, 255, 0.3);
    height: 38px;
    align-items: center;
    box-sizing: border-box;
}

.company-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--starfleet-silver);
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
    line-height: 1;
    height: 22px;
}

.company-info-item i {
    color: var(--starfleet-blue-light);
    font-size: 13px;
    flex-shrink: 0;
}

/* ========== PANEL UŻYTKOWNIKA ========== */
.user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(0, 20, 40, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 184, 255, 0.4);
    min-width: 200px;
    height: 38px;
    box-sizing: border-box;
}

.user-info:hover {
    background: rgba(0, 30, 60, 0.95);
    border-color: var(--starfleet-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 255, 0.4);
}

.user-info > i {
    font-size: 18px;
    color: var(--starfleet-blue-light);
    flex-shrink: 0;
    margin-right: 2px;
}

.user-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    justify-content: center;
    height: 24px;
}

#usernameDisplay {
    font-size: 13px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Orbitron', sans-serif;
    line-height: 1.1;
    margin: 0;
    padding: 0;
    height: 14px;
}

#userRole {
    font-size: 9px;
    color: var(--starfleet-gold);
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    width: fit-content;
    line-height: 1.1;
    height: 12px;
    margin-top: 1px;
}

#sessionTimer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    background: rgba(0, 255, 157, 0.15);
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--starfleet-green);
    font-family: 'Orbitron', sans-serif;
    margin-left: auto;
    line-height: 1;
    height: 20px;
    flex-shrink: 0;
}

#sessionTimer.warning {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
    color: var(--starfleet-gold);
}

#sessionTimer.danger {
    background: rgba(255, 51, 102, 0.15);
    border-color: rgba(255, 51, 102, 0.3);
    color: var(--starfleet-red);
    animation: pulse 1s infinite;
}

#sessionTimer i {
    font-size: 11px;
    flex-shrink: 0;
}

/* ========== PRZYCISKI AKCJI ========== */
.user-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(0, 20, 40, 0.9);
    border: 1px solid rgba(0, 184, 255, 0.4);
    color: var(--starfleet-blue-light);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    box-sizing: border-box;
}

.action-btn:hover {
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.4) 0%,
        rgba(157, 78, 221, 0.4) 100%);
    border-color: var(--starfleet-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 255, 0.4);
    color: white;
}

.action-btn:last-child {
    border-color: rgba(255, 51, 102, 0.5);
    color: var(--starfleet-red);
}

.action-btn:last-child:hover {
    background: rgba(255, 51, 102, 0.4);
    border-color: var(--starfleet-red);
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.4);
}

/* ========== MOBILE BOTTOM NAVIGATION ========== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, 
        rgba(10, 10, 26, 1) 0%, 
        rgba(15, 15, 35, 1) 100%);
    backdrop-filter: blur(15px);
    border-top: 2px solid rgba(0, 184, 255, 0.5);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(0, 184, 255, 0.2);
    z-index: 1000;
    display: none;
    height: var(--mobile-nav-height);
    padding: 8px 0;
}

.mobile-nav-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 10px;
}

.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    color: var(--starfleet-silver);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 10px;
    background: rgba(0, 20, 40, 0.5);
    margin: 0 2px;
    min-width: 0;
    height: 100%;
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
    color: white;
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.5) 0%,
        rgba(157, 78, 221, 0.5) 100%);
    box-shadow: 0 0 15px rgba(0, 184, 255, 0.5);
}

.mobile-nav-btn.active {
    border: 1px solid var(--starfleet-gold);
}

.mobile-nav-btn i {
    font-size: 16px;
}

.mobile-nav-btn span {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1;
}

/* ========== RESPONSIVE - DESKTOP (1025px+) ========== */
@media (min-width: 1025px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0 !important;
        padding-top: var(--header-height-desktop) !important;
    }
    
    .header-container {
        padding-top: 15px;
        padding-bottom: 15px;
    }
}

/* ========== RESPONSIVE - TABLET (769px-1024px) ========== */
@media (max-width: 1024px) and (min-width: 769px) {
    .header {
        height: var(--header-height-tablet);
    }
    
    .header-container {
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .mobile-bottom-nav {
        display: block;
    }
    
    body {
        padding-bottom: var(--mobile-nav-height) !important;
        padding-top: var(--header-height-tablet) !important;
    }
    
    .header-row-1 {
        height: 45px;
        min-height: 45px;
        max-height: 45px;
    }
    
    .logo {
        height: 45px;
        min-width: 200px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .nav {
        height: 45px;
        max-width: 700px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 90px;
        height: 34px;
    }
    
    .header-row-2 {
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        margin-top: 4px;
    }
    
    .company-info {
        height: 34px;
        padding: 6px 12px;
        gap: 15px;
    }
    
    .company-info-item {
        font-size: 11px;
        height: 20px;
    }
    
    .user-info {
        min-width: 180px;
        height: 34px;
        padding: 5px 10px;
    }
    
    #usernameDisplay {
        font-size: 12px;
    }
    
    #userRole {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    #sessionTimer {
        font-size: 10px;
        padding: 2px 6px;
        height: 18px;
    }
    
    .action-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
}

/* ========== RESPONSIVE - MOBILE (≤768px) ========== */
@media (max-width: 768px) {
    .header {
        height: var(--header-height-mobile);
    }
    
    .header-container {
        padding: 0 12px;
        gap: 6px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    
    /* Ukryj nawigację desktop */
    .nav {
        display: none !important;
    }
    
    /* Ukryj row 2 całkowicie */
    .header-row-2 {
        display: none !important;
    }
    
    /* Row 1 - tylko logo i ikony */
    .header-row-1 {
        gap: 10px;
        justify-content: space-between;
        height: 54px;
        min-height: 54px;
        max-height: 54px;
    }
    
    .logo {
        min-width: auto;
        padding: 6px 10px;
        flex: 1;
        height: 54px;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .logo-text h1 {
        font-size: 15px;
    }
    
    .logo-text p {
        font-size: 9px;
        margin-top: 2px;
    }
    
    /* Pokaż mobile nav */
    .mobile-bottom-nav {
        display: block;
    }
    
    body {
        padding-bottom: var(--mobile-nav-height) !important;
        padding-top: var(--header-height-mobile) !important;
    }
}

/* ========== BARDZO MAŁE EKRANY (≤480px) ========== */
@media (max-width: 480px) {
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .logo-text h1 {
        font-size: 13px;
    }
    
    .logo-text p {
        font-size: 8px;
    }
    
    .mobile-nav-btn span {
        font-size: 8px;
    }
    
    .mobile-nav-btn i {
        font-size: 14px;
    }
}

/* ========== MODALS ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-content {
    background: linear-gradient(180deg, 
        rgba(15, 15, 35, 0.98) 0%, 
        rgba(10, 10, 26, 0.98) 100%);
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(0, 184, 255, 0.4);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    border: 2px solid var(--starfleet-blue);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 2px solid rgba(0, 184, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.2) 0%,
        rgba(157, 78, 221, 0.2) 100%);
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 184, 255, 0.4);
    color: var(--starfleet-blue-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 51, 102, 0.3);
    border-color: var(--starfleet-red);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    color: var(--starfleet-silver);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid rgba(0, 184, 255, 0.3);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0, 10, 20, 0.5);
}

/* Form styles w modalu */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--starfleet-blue-light);
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 30, 60, 0.6);
    border: 2px solid rgba(0, 184, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    color: white;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--starfleet-blue);
    background: rgba(0, 40, 80, 0.8);
    box-shadow: 0 0 20px rgba(0, 184, 255, 0.3);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--starfleet-silver);
    font-style: italic;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    display: none;
}

.message.active {
    display: block;
}

.message-error {
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid var(--starfleet-red);
    color: var(--starfleet-red);
}

.message-success {
    background: rgba(0, 255, 157, 0.15);
    border: 1px solid var(--starfleet-green);
    color: var(--starfleet-green);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--starfleet-blue) 0%, var(--starfleet-purple) 100%);
    border-color: var(--starfleet-gold);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border-color: rgba(0, 184, 255, 0.4);
    color: var(--starfleet-blue-light);
}

.btn-outline:hover {
    background: rgba(0, 184, 255, 0.2);
    border-color: var(--starfleet-blue);
    color: white;
}

/* ========== ANIMACJE ========== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes warp {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== BODY PADDING DLA FIXED HEADER ========== */
body {
    padding-top: var(--header-height-desktop) !important;
    margin: 0 !important;
    min-height: 100vh;
    background: #0a0a1a;
}

/* Główny kontener treści */
.container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px 25px;
    box-sizing: border-box;
    background: rgba(10, 10, 26, 0.7);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 184, 255, 0.2);
    min-height: calc(100vh - 150px);
}

@media (max-width: 768px) {
    .container {
        padding: 15px 12px;
        min-height: calc(100vh - 145px);
    }
}