/* --- IMPORT CZCIONKI --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

/* --- ZMIENNE KOLORÓW --- */
:root {
    --primary-blue: #4a90e2;
    --secondary-blue: #357abd;
    --accent-green: #4CAF50;
    --accent-orange: #ff9800;
    --accent-red: #e74c3c;
    --accent-purple: #9b59b6;
    --dark-bg: #1a2a4a;
    --glass-bg: rgba(30, 40, 60, 0.65);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-light: #e0e0e0;
    --text-white: #ffffff;
}

body {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--dark-bg);
    background-image: url('../img/IMG_0774.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- GŁÓWNY KONTENER --- */
.main-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

.main-header {
    text-align: center;
    margin-bottom: 30px;
}

.main-header h1 {
    color: var(--text-white);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    font-size: 2.8em;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.main-header h1 i {
    color: var(--primary-blue);
    margin-right: 15px;
}

/* Przycisk Wolne Terminy */
.calendar-btn {
    background: linear-gradient(90deg, var(--secondary-blue), var(--primary-blue));
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    font-weight: 600;
}

.calendar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.6);
}

.calendar-btn i {
    margin-right: 8px;
}

/* --- EFEKT SZKŁA --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px) saturate(120%);
    -webkit-backdrop-filter: blur(15px) saturate(120%);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    padding: 40px;
}

/* --- MODAL (OKNO KALENDARZA) --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.8); 
    overflow: auto;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #1e283c; 
    background: rgba(30, 40, 60, 0.95);
    margin: 5% auto; 
    padding: 30px;
    border: 1px solid var(--glass-border);
    width: 90%; 
    max-width: 700px;
    position: relative;
    border-radius: 15px;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-white);
}

.modal-content h2 {
    text-align: center;
    color: var(--text-white);
    margin-top: 0;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

/* Kontrolki Kalendarza */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.nav-btn.small {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
}

#cal-month-display {
    color: var(--primary-blue);
    font-size: 1.4em;
    margin: 0;
    text-transform: capitalize;
}

/* Legenda */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.legend-item {
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.dot.free { background-color: rgba(76, 175, 80, 0.6); border: 1px solid var(--accent-green); }
.dot.busy { background-color: rgba(231, 76, 60, 0.6); border: 1px solid var(--accent-red); }
.dot.holiday { background-color: rgba(155, 89, 182, 0.6); border: 1px solid var(--accent-purple); }
.dot.mixed { 
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.6) 50%, rgba(155, 89, 182, 0.6) 50%); 
    border: 1px solid var(--text-light); 
}

/* Siatka Kalendarza */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
}

.cal-header {
    font-weight: bold;
    color: var(--text-light);
    padding: 10px 0;
    text-transform: uppercase;
    font-size: 0.85em;
}

.cal-day {
    padding: 5px; 
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    font-weight: 500;
    position: relative;
    transition: all 0.2s;
    font-size: 0.9em;
}

.cal-day.empty {
    background: transparent;
}

/* Kolorowanie dni */
.day-free {
    background-color: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #81c784;
}

.day-busy {
    background-color: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e57373;
}

.day-holiday {
    background-color: rgba(155, 89, 182, 0.25);
    border: 1px solid rgba(155, 89, 182, 0.5);
    color: #ba68c8;
}

.day-holiday i {
    font-size: 0.8em;
    margin-top: 4px;
}

/* NOWY STYL: MIESZANY (Konwój + Urlop) */
.day-mixed {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3) 50%, rgba(155, 89, 182, 0.3) 50%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-white);
}

.day-mixed .day-number {
    font-weight: bold;
    text-shadow: 0 1px 2px black;
}

.day-icons {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.8em;
}

.cal-loading {
    grid-column: 1 / -1;
    padding: 30px;
    font-size: 1.2em;
    color: var(--primary-blue);
}

/* --- NAWIGACJA MIESIĘCY --- */
.month-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

/* --- PODSUMOWANIE MIESIĄCA --- */
.month-summary {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
}

.month-summary:empty { display: none; }

.summary-title {
    margin: 0 0 10px 0;
    color: var(--accent-orange);
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.summary-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-badge {
    background: rgba(74, 144, 226, 0.15);
    color: var(--text-light);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    border: 1px solid rgba(74, 144, 226, 0.3);
    display: flex;
    align-items: center;
}

.stat-badge strong { color: var(--text-white); margin-left: 5px; }
.stat-badge i { color: var(--primary-blue); margin-right: 6px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

#month-display {
    font-size: 1.6em;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Przyciski nawigacji */
.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--primary-blue);
    font-size: 1.5em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.month-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.1em;
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary-blue);
    color: var(--text-white);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
}

.nav-btn:disabled {
    color: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- KARTY KONWOJÓW --- */
.convoy-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.convoy-card {
    background: rgba(40, 50, 70, 0.6);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.convoy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-blue);
}

.card-header {
    background: linear-gradient(90deg, rgba(74, 144, 226, 0.2) 0%, rgba(40, 50, 70, 0.1) 100%);
    padding: 15px 25px;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-white);
    font-weight: 600;
}

.card-body { padding: 25px; }

.info-grid p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    font-size: 1.05em;
}

.info-grid i {
    color: var(--primary-blue);
    width: 25px;
    margin-right: 10px;
    text-align: center;
}

.info-grid strong {
    color: var(--text-white);
    font-weight: 600;
    margin-right: 8px;
}

.event-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.event-link i { margin-left: 8px; font-size: 0.9em; width: auto; }
.event-link:hover { color: var(--secondary-blue); text-decoration: underline; }

/* --- LICZNIK CZASU --- */
.countdown-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.countdown-timer { margin: 0; font-size: 1.2em; }
.countdown-timer i { color: var(--accent-orange); margin-right: 10px; }
.highlight-days { color: var(--accent-orange); font-weight: bold; font-size: 1.3em; }

.badge-ended { background: var(--accent-red); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.9em; font-weight: bold; text-transform: uppercase; }
.badge-today { background: var(--accent-green); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.9em; font-weight: bold; text-transform: uppercase; box-shadow: 0 0 10px rgba(76, 175, 80, 0.5); }
.text-success { color: var(--accent-green); font-weight: 600; }
.text-warning { color: var(--accent-orange); font-weight: 600; }

/* --- SEKCJA OBECNOŚCI --- */
.attendance-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.attendance-title {
    margin: 0 0 15px 0;
    font-size: 1em;
    color: var(--accent-green);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.attendee-list { display: flex; flex-wrap: wrap; gap: 10px; }
.attendee-badge {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.1));
    color: var(--text-white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.95em;
    border: 1px solid rgba(76, 175, 80, 0.5);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.attendee-badge:hover { background: rgba(76, 175, 80, 0.4); transform: translateY(-2px); }
.attendee-badge i { color: var(--accent-green); margin-right: 8px; font-size: 1.1em; }

footer {
    max-width: 900px;
    margin: 30px auto;
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

#loading, .no-data, .error-message { text-align: center; font-size: 1.5em; padding: 40px; color: rgba(255,255,255,0.8); }
.error-message { color: var(--accent-red); }
.no-data i, #loading i { margin-bottom: 15px; display: block; font-size: 2em; color: var(--primary-blue); }

@media (max-width: 600px) {
    .glass-panel { padding: 25px 15px; }
    .card-body { padding: 15px; }
    .month-display { font-size: 1.3em; }
    .main-header h1 { font-size: 2em; }
    
    .calendar-btn {
        width: 100%;
        margin-bottom: 15px;
    }
}