/* ===== ZMIENNE ===== */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e1e8ed;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --radius: 8px;
}

/* ===== RESET I PODSTAWY ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

header h1 {
    font-size: 2rem;
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 500;
    margin: 0;
}

/* ===== SEKCJE ===== */
section {
    background: var(--card-bg);
    padding: 25px;
    margin-bottom: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

/* ===== FORMULARZ ===== */
.reservation-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

.input-with-button .btn-small {
    padding: 0 12px;
    font-size: 1.2rem;
    height: auto;
    min-height: 46px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* ===== PRZYCISKI ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #d1d9e0;
}

.btn-danger {
    background-color: var(--accent-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 0 4px;
    font-size: 0.6rem;
    margin-top: 1px;
    height: 16px;
    line-height: 1;
}

/* ===== POWIADOMIENIA ===== */
.computer3-notice {
    background-color: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 15px;
    text-align: center;
    color: #e65100;
    font-size: 0.95rem;
}

.computer3-notice strong {
    font-weight: 700;
}

.selection-info {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: var(--radius);
    padding: 10px 15px;
    margin-bottom: 15px;
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
}

.limit-info {
    background-color: #fff8e1;
    border: 1px solid #ffcc80;
    border-radius: var(--radius);
    padding: 6px 15px;
    margin-bottom: 15px;
    text-align: center;
    color: #e65100;
    font-size: 0.9rem;
}

.limit-info strong {
    font-weight: 700;
}

.selection-actions {
    margin-top: 20px;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.selection-preview {
    background-color: #f5f5f5;
    border-radius: var(--radius);
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.selection-preview strong {
    color: var(--primary-color);
}

/* ===== KOMUNIKATY ===== */
.message {
    margin-top: 15px;
    padding: 15px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    display: none;
}

.message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== KALENDARZ - NAGŁÓWEK ===== */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

.week-range {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    min-width: 200px;
    text-align: center;
}

/* ===== KALENDARZ ===== */
.calendar-container {
    overflow-x: auto;
}

.calendar {
    display: grid;
    grid-template-columns: 80px repeat(4, 1fr);
    gap: 2px;
    background-color: var(--border-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    min-width: 800px;
}

/* Nagłówki kolumn (komputery) */
.calendar-header-cell {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 5px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Nagłówki wierszy (godziny) */
.calendar-time-cell {
    background-color: #ecf0f1;
    padding: 1px 4px;
    text-align: center;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    max-height: 24px;
}

/* Komórki kalendarza */
.calendar-cell {
    background-color: white;
    min-height: 28px;
    max-height: 32px;
    position: relative;
    transition: background-color 0.2s;
    padding: 2px 4px;
    cursor: pointer;
    user-select: none;
}

.calendar-cell.selected {
    background-color: #90caf9 !important;
    border: 2px solid var(--secondary-color);
}

.calendar-cell.available {
    background-color: #e8f5e9;
}

.calendar-cell.available:hover {
    background-color: #c8e6c9;
    cursor: pointer;
}

.calendar-cell.reserved {
    background-color: #ffcdd2;
}

.calendar-cell.reserved:hover {
    background-color: #ffcdd2;
}

/* Informacje o rezerwacji w komórce */
.reservation-info {
    padding: 1px;
    font-size: 0.7rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.reservation-info .user-name {
    font-weight: 700;
    color: #000;
    margin-bottom: 1px;
    font-size: 0.85rem;
    line-height: 1.1;
}

.reservation-info .time-range {
    font-size: 0.65rem;
    color: #555;
    margin-bottom: 1px;
}

/* Nagłówki dni w wersji mobilnej/dniowej */
.day-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    grid-column: 1 / -1;
}

.day-header .day-name {
    font-size: 1rem;
}

.day-header .day-date {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ===== LEGENDA ===== */
.legend {
    padding: 20px;
}

.legend h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.legend-items {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.legend-color.available {
    background-color: #e8f5e9;
}

.legend-color.reserved {
    background-color: #ffebee;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.modal-content p {
    margin-bottom: 25px;
    color: var(--text-light);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 5px;
}

/* ===== RESPONSYWNOŚĆ ===== */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-title {
        gap: 3px;
    }

    .calendar-header {
        flex-direction: column;
        align-items: stretch;
    }

    .week-navigation {
        justify-content: center;
    }

    .calendar {
        grid-template-columns: 45px repeat(4, 1fr);
    }

    .calendar-header-cell {
        font-size: 0.75rem;
        padding: 5px 2px;
    }

    .calendar-time-cell {
        font-size: 0.65rem;
        padding: 1px;
        min-height: 20px;
        max-height: 22px;
    }

    .calendar-cell {
        min-height: 20px;
        max-height: 22px;
        padding: 0 1px;
    }

    .reservation-info {
        padding: 0 1px;
        font-size: 0.6rem;
    }

    .reservation-info .user-name {
        font-size: 0.65rem;
    }

    .reservation-info .time-range {
        font-size: 0.55rem;
    }

    .btn-small {
        padding: 0 2px;
        font-size: 0.55rem;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    section {
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .legend-items {
        flex-direction: column;
        gap: 10px;
    }
}
