/* ============================================================
   FRONTEND - UJEDNOLICONY Z BACKENDEM
   ============================================================ */

/* Dziedzicz czcionkę z motywu WordPress */
#esr-reservation-container,
#esr-reservation-container *,
.esr-modal,
.esr-modal * {
    font-family: inherit !important;
}

#esr-reservation-container {
    width: fit-content;
    margin: 40px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.esr-stage {
    background: #2271b1;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 30px;
    border-radius: 4px;
    width: 30%;
}

#esr-seating-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
}

.esr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.esr-row-label {
    font-weight: bold;
    width: 40px;
    text-align: center;
    color: #1d2327;
    font-size: 16px;
}

/* MIEJSCA - KWADRATOWE JAK W BACKENDIE */
.esr-seat {
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: white;
    border-radius: 50%;
    transition: transform 0.2s, opacity 0.2s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.esr-seat:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.esr-seat:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
    transform: scale(1.1);
}

.esr-seat:focus:not(:focus-visible) {
    outline: none;
    transform: scale(1.05);
}

.esr-seat:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
    transform: scale(1.1);
}

.esr-seat.available {
    background-color: #28a745;
}

.esr-seat.reserved {
    background-color: #dc3545;
    cursor: not-allowed;
}

.esr-seat.reserved:hover {
    transform: none;
    opacity: 1;
}

.esr-seat.unconfirmed {
    background-color: #ffc107;
    color: #333;
    cursor: not-allowed;
}

.esr-seat.unconfirmed:hover {
    transform: none;
    opacity: 1;
}

.esr-seat.blocked {
    background-color: #6c757d;
    cursor: not-allowed;
}

.esr-seat.blocked:hover {
    transform: none;
    opacity: 1;
}

/* LEGENDA */
.esr-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 20px;
}

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

.esr-legend-box {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.esr-legend-box.available {
    background-color: #28a745;
}

.esr-legend-box.reserved {
    background-color: #dc3545;
}

.esr-legend-box.unconfirmed {
    background-color: #ffc107;
}

.esr-legend-box.blocked {
    background-color: #6c757d;
}

/* MODAL */
.esr-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.esr-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.esr-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.3s;
}

.esr-close:hover,
.esr-close:focus {
    color: #000;
}

.esr-modal-content h2 {
    margin-top: 0;
    color: #1d2327;
    font-size: 22px;
}

#esr-seat-info {
    background-color: #E3F2FD;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #1565C0;
    font-weight: 500;
}

.esr-form-group {
    margin-bottom: 18px;
}

.esr-form-group label {
    display: block;
    margin-bottom: 6px;
    color: #1d2327;
    font-weight: 600;
    font-size: 14px;
}

.esr-form-group input[type="text"],
.esr-form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.esr-form-group input[type="text"]:focus,
.esr-form-group input[type="email"]:focus {
    outline: none;
    border-color: #2271b1;
}

.esr-optional-section {
    margin-top: 25px;
    padding: 18px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.esr-optional-section h3 {
    margin: 0 0 15px 0;
    color: #2271b1;
    font-size: 16px;
    font-weight: 600;
}

.esr-submit-btn {
    background: #2271b1;
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.esr-submit-btn:hover {
    background: #135e96;
}

.esr-submit-btn:active {
    background: #0a4d7d;
}

.esr-back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 22px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.esr-back-btn:hover {
    background: #5a6268;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #esr-reservation-container {
        padding: 15px;
    }
    
    .esr-stage {
        font-size: 16px;
        padding: 12px;
    }
    
    .esr-row-label {
        width: 32px;
        font-size: 14px;
    }
    
    .esr-seat {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }
    
    #esr-seating-chart {
        gap: 6px;
    }
    
    .esr-row {
        gap: 6px;
    }
    
    .esr-legend {
        gap: 18px;
    }
    
    .esr-legend-box {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .esr-row-label {
        width: 28px;
        font-size: 12px;
    }
    
    .esr-seat {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
    
    #esr-seating-chart {
        gap: 5px;
    }
    
    .esr-row {
        gap: 5px;
    }
    
    .esr-legend-box {
        width: 26px;
        height: 26px;
    }
}

/* ZGODY I FORMULARZE */
.esr-consent-step {
    max-width: 700px;
}

.esr-consent-item {
    margin: 18px 0;
    padding: 18px;
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.esr-consent-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.6;
}

.esr-consent-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    margin-top: 3px;
    flex-shrink: 0;
    cursor: pointer;
}

.esr-data-step {
    max-width: 600px;
}

/* ============================================================
   SYSTEM SEKTORÓW
   ============================================================ */

.esr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.esr-sector {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.esr-sector:empty {
    min-width: 600px;
    visibility: hidden;
}

.esr-sector-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* Kontener sektora z etykietą */
.esr-sector-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 20px;
    margin-right: 20px;
}

/* RESPONSIVE dla sektorów */
@media (max-width: 768px) {
    .esr-row {
        gap: 10px;
    }
    
    .esr-sector {
        gap: 5px;
    }
    
    .esr-sector:empty {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .esr-row {
        gap: 8px;
    }
    
    .esr-sector {
        gap: 4px;
    }
    
    .esr-sector:empty {
        min-width: 600px;
    }
}
