/* ============================================================
   AST Roissy Booking — Styles Frontend
   Tout est scope sous .arb-wrapper pour eviter les conflits BeTheme
   Mobile-first, responsive
   ============================================================ */

.arb-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    box-sizing: border-box;
}

.arb-wrapper *,
.arb-wrapper *::before,
.arb-wrapper *::after {
    box-sizing: border-box;
}

.arb-loading {
    text-align: center;
    padding: 30px;
    color: #888;
}

/* ─── Zone authentification tireur ─────────────────────── */

.arb-auth-area {
    margin-bottom: 20px;
}

.arb-auth-logged {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px 16px;
    gap: 10px;
    flex-wrap: wrap;
}

.arb-auth-welcome {
    font-size: 15px;
    color: #155724;
}

.arb-btn-small {
    padding: 5px 14px;
    font-size: 12px;
}

.arb-btn-outline {
    background: transparent;
    border: 1px solid #666;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.arb-btn-outline:hover {
    background: #666;
    color: #fff;
}

.arb-login-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.arb-login-form h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
    color: #2c3e50;
}

.arb-login-fields {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.arb-login-fields input[type="email"],
.arb-login-fields input[type="password"] {
    padding: 10px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    flex: 1 1 180px;
    min-width: 0;
}

.arb-login-fields input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.arb-login-fields .arb-btn {
    flex: 0 0 auto;
}

.arb-login-error {
    margin-top: 10px;
    color: #e74c3c;
    font-size: 14px;
    font-weight: 600;
}

/* ─── Mes reservations ─────────────────────────────────── */

.arb-my-bookings {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.arb-my-bookings h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
    color: #2c3e50;
}

.arb-booking-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    margin-bottom: 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.arb-booking-card-info {
    flex: 1 1 200px;
    min-width: 0;
}

.arb-booking-card-date {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.arb-booking-card-slot {
    color: #666;
    font-size: 14px;
}

.arb-booking-card-extra {
    color: #888;
    font-size: 13px;
}

.arb-btn-cancel {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.2s;
}

.arb-btn-cancel:hover {
    background: #c0392b;
}

.arb-no-bookings {
    color: #888;
    font-style: italic;
}

/* ─── Navigation calendrier ────────────────────────────── */

.arb-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #4a6fa5;
    border-radius: 8px 8px 0 0;
    padding: 10px 16px;
}

.arb-month-title {
    margin: 0;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
    text-transform: capitalize;
}

.arb-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.arb-nav-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.arb-nav-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ─── En-tete jours ────────────────────────────────────── */

.arb-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #3d5d8a;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arb-day-header {
    padding: 8px 4px;
    text-align: center;
}

.arb-day-header.arb-weekend {
    background: rgba(0, 0, 0, 0.1);
}

/* ─── Grille calendrier ────────────────────────────────── */

.arb-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #e0e0e0;
    border-top: none;
    background: #fff;
}

/* ─── Cellule jour ─────────────────────────────────────── */

.arb-day-cell {
    min-height: 80px;
    padding: 6px;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.arb-day-cell:hover:not(.arb-day-empty):not(.arb-day-past):not(.arb-day-closed) {
    background: #eaf2f8;
}

.arb-day-cell.arb-day-empty {
    background: #f8f8f8;
    cursor: default;
}

.arb-day-cell.arb-day-past {
    background: #f5f5f5;
    cursor: default;
    opacity: 0.5;
}

.arb-day-cell.arb-day-selected {
    background: #dbeafe;
    box-shadow: inset 0 0 0 2px #3498db;
}

.arb-day-cell.arb-day-closed {
    background: #f9f9f9;
    cursor: default;
}

.arb-day-number {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.arb-day-cell.arb-day-today .arb-day-number {
    background: #3498db;
    color: #fff;
    font-weight: 700;
}

.arb-day-cell.arb-day-weekend .arb-day-number {
    color: #e74c3c;
}

.arb-day-cell.arb-day-past .arb-day-number {
    color: #aaa;
}

.arb-day-indicators {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.arb-day-badge {
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.arb-badge-available { background: #d4edda; color: #155724; }
.arb-badge-full      { background: #f8d7da; color: #721c24; }
.arb-badge-my-booking { background: #cce5ff; color: #004085; }
.arb-badge-closed    { background: #e9ecef; color: #6c757d; }
.arb-badge-blocked   { background: #fff3cd; color: #856404; }

/* ─── Detail des creneaux ──────────────────────────────── */

.arb-day-detail {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 16px;
}

.arb-day-detail h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 15px;
}

.arb-slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.arb-slot-time {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    white-space: nowrap;
}

.arb-slot-time .arb-slot-icon {
    margin-right: 6px;
}

.arb-slot-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.arb-status-available { background: #d4edda; color: #155724; }
.arb-status-booked    { background: #f8d7da; color: #721c24; }
.arb-status-blocked   { background: #fff3cd; color: #856404; }
.arb-status-past      { background: #e9ecef; color: #6c757d; }
.arb-status-mine      { background: #cce5ff; color: #004085; }

/* ─── Nom du tireur sur creneau reserve ───────────────── */

.arb-slot-shooter-name {
    font-size: 13px;
    color: #555;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.arb-slot-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.arb-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.arb-btn-primary {
    background: #7ab648;
    color: #fff;
}

.arb-btn-primary:hover {
    background: #5e9a2f;
}

.arb-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ─── Modal ────────────────────────────────────────────── */

.arb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.arb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.arb-modal-content {
    position: relative;
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.arb-modal-header {
    background: #7ab648;
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.arb-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.arb-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.arb-modal-close:hover {
    opacity: 1;
}

.arb-modal-body {
    padding: 20px;
}

#arb-modal-slot-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.5;
}

.arb-form-group {
    margin-bottom: 16px;
}

.arb-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 14px;
}

.arb-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.arb-checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}

.arb-checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.arb-checkbox-group span {
    font-size: 14px;
    line-height: 1.4;
    color: #e74c3c;
    font-weight: 600;
}

.arb-form-actions {
    margin-top: 16px;
}

.arb-form-actions .arb-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

/* ─── Flash message ────────────────────────────────────── */

.arb-flash {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    text-align: center;
    animation: arb-flash-in 0.3s ease;
}

.arb-flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.arb-flash-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.arb-flash-info    { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }

@keyframes arb-flash-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Responsive : tablette ────────────────────────────── */

@media (max-width: 768px) {
    .arb-day-cell {
        min-height: 60px;
        padding: 4px;
    }

    .arb-day-number {
        font-size: 13px;
        width: 24px;
        height: 24px;
    }

    .arb-day-badge {
        font-size: 8px;
        padding: 1px 3px;
    }

    .arb-month-title {
        font-size: 16px;
    }

    .arb-slot-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .arb-slot-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .arb-slot-shooter-name {
        max-width: 100%;
        white-space: normal;
    }

    .arb-login-fields {
        flex-direction: column;
    }

    .arb-login-fields input[type="email"],
    .arb-login-fields input[type="password"] {
        flex: 1 1 100%;
    }
}

/* ─── Responsive : mobile ──────────────────────────────── */

@media (max-width: 480px) {
    .arb-wrapper {
        font-size: 14px;
    }

    .arb-calendar-nav {
        padding: 8px 12px;
    }

    .arb-month-title {
        font-size: 14px;
    }

    .arb-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .arb-day-header {
        font-size: 10px;
        padding: 6px 2px;
        letter-spacing: 0;
    }

    .arb-day-cell {
        min-height: 48px;
        padding: 3px 2px;
    }

    .arb-day-number {
        font-size: 12px;
        width: 22px;
        height: 22px;
    }

    /* Sur petit ecran, masquer les badges texte, garder un point colore */
    .arb-day-indicators {
        flex-direction: row;
        gap: 3px;
        margin-top: 2px;
    }

    .arb-day-badge {
        font-size: 0;
        width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 50%;
        display: inline-block;
    }

    .arb-booking-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .arb-btn-cancel {
        width: 100%;
        text-align: center;
    }

    .arb-day-detail {
        padding: 12px;
    }

    .arb-my-bookings,
    .arb-login-form {
        padding: 12px;
    }

    .arb-modal {
        padding: 10px;
        align-items: flex-end;
    }

    .arb-modal-content {
        border-radius: 10px 10px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    .arb-slot-shooter-name {
        font-size: 12px;
        max-width: 100%;
        white-space: normal;
    }

    .arb-auth-logged {
        flex-direction: column;
        text-align: center;
    }
}
