/* ============================================================
   PAGE — Créer une règle de récurrence
   Palette site : #4A90E2 / #357ABD, fond #FFFEFC, inputs #f5f7fa
   ============================================================ */

/* Conteneur principal centré, comme .login_container */
.rdv-admin-container {
    max-width: 640px;
    margin: 110px auto 60px auto; /* 110px pour compenser le header fixe */
    padding: 0 1rem;
}

.rdv-admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 36px 40px;
}

.rdv-admin-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #357ABD;
    margin: 0 0 1.6rem 0;
}

.rdv-admin-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4A90E2;
    margin: 1.8rem 0 0.8rem 0;
    border-bottom: 1.5px solid #dbe3ef;
    padding-bottom: 0.4rem;
}

/* Séparateur */
.rdv-admin-divider {
    border: none;
    border-top: 1.5px solid #dbe3ef;
    margin: 1.6rem 0;
}

/* ===== CHAMP FORMULAIRE ===== */
.field-group {
    margin-bottom: 1.3rem;
}

.field-label {
    display: block;
    font-size: 15px;
    color: #357ABD;
    font-weight: 500;
    margin-bottom: 6px;
}

/* Tous les inputs texte, number, select */
.admin-input {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    background-color: #f5f7fa;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.admin-input:focus {
    border-color: #4A90E2;
    outline: none;
    box-shadow: 0 0 0 2px #eaf4ff;
}

/* Select natif */
select.admin-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A90E2' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Number sans spinner */
input[type="number"].admin-input {
    width: 140px;
}

/* ===== PICKERS — INPUT VISIBLE ===== */
.picker-input {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    background-color: #f5f7fa;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    width: 150px;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
}

.picker-input:focus {
    border-color: #4A90E2;
    outline: none;
    box-shadow: 0 0 0 2px #eaf4ff;
}

/* Conteneur relatif pour positionner le popup */
.picker-wrapper {
    position: relative;
    display: inline-block;
}

/* ===== POPUP COMMUNE ===== */
.picker-popup {
    display: none;
    position: absolute;
    z-index: 200;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1.5px solid #dbe3ef;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(74, 144, 226, 0.12);
    padding: 1rem;
}

.picker-popup.open {
    display: block;
}

/* ===== CALENDRIER ===== */
.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
}

.cal-nav {
    background: none;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 10px;
    color: #4A90E2;
    line-height: 1.6;
    box-shadow: none;
    min-width: 0;
    transition: background 0.15s;
}

.cal-nav:hover {
    background: #eaf4ff;
    border-color: #4A90E2;
}

.cal-month-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #357ABD;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 34px);
    gap: 2px;
    text-align: center;
}

.cal-day-name {
    font-size: 0.72rem;
    color: #4A90E2;
    padding: 4px 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.cal-day {
    padding: 6px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    border: none;
    background: none;
    width: 100%;
    color: #333;
    transition: background 0.15s;
    box-shadow: none;
    min-width: 0;
    font-family: inherit;
}

.cal-day:hover:not(:disabled) {
    background: #eaf4ff;
    color: #357ABD;
}

.cal-day.today {
    font-weight: 700;
    color: #4A90E2;
}

.cal-day.selected {
    background: linear-gradient(90deg, #4A90E2 60%, #357ABD 100%);
    color: #fff;
    font-weight: 600;
}

.cal-day.other-month {
    color: #ccc;
}

.cal-day:disabled {
    color: #d0d0d0;
    cursor: default;
}

/* ===== SÉLECTIONNEUR D'HEURE ===== */
.time-picker-inner {
    width: 190px;
}

.time-columns {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: flex-start;
}

.time-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.time-col-label {
    font-size: 0.72rem;
    color: #4A90E2;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.time-colon {
    align-self: center;
    margin-top: 1.4rem;
    font-size: 1.3rem;
    color: #aaa;
    font-weight: 300;
}

.time-scroll {
    height: 160px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: thin;
    scrollbar-color: #dbe3ef transparent;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    width: 52px;
    background: #f5f7fa;
}

.time-option {
    scroll-snap-align: start;
    padding: 8px 0;
    text-align: center;
    cursor: pointer;
    font-size: 1.05rem;
    user-select: none;
    color: #333;
    transition: background 0.12s;
}

.time-option:hover {
    background: #eaf4ff;
    color: #357ABD;
}

.time-option.selected {
    background: linear-gradient(90deg, #4A90E2 60%, #357ABD 100%);
    color: #fff;
    font-weight: 700;
}

.time-confirm {
    display: block;
    margin-top: 0.8rem;
    width: 100%;
    padding: 9px 0;
    background: linear-gradient(90deg, #4A90E2 60%, #357ABD 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.12);
    transition: background 0.2s, box-shadow 0.2s;
}

.time-confirm:hover {
    background: linear-gradient(90deg, #357ABD 60%, #4A90E2 100%);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.16);
}

/* ===== PLAGES HORAIRES ===== */
.time-ranges-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}

.time-range-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.time-range-arrow {
    font-size: 1.2rem;
    color: #aaa;
    flex-shrink: 0;
}

.btn-remove-range {
    background: #fff0f0;
    border: 1.5px solid #fcc;
    color: #c00;
    border-radius: 6px;
    padding: 7px 13px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    box-shadow: none;
    transition: background 0.15s;
}

.btn-remove-range:hover {
    background: #ffd0d0;
    border-color: #e88;
}

/* ===== BOUTONS D'ACTION ===== */
.btn-add-range {
    background: #f0f7ee;
    border: 1.5px solid #a8d5a2;
    color: #2a6b24;
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    box-shadow: none;
    transition: background 0.15s;
}

.btn-add-range:hover {
    background: #d8efd4;
}

.btn-submit {
    background: linear-gradient(90deg, #4A90E2 60%, #357ABD 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.10);
    transition: background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.btn-submit:hover {
    background: linear-gradient(90deg, #357ABD 60%, #2381ec 100%);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.16);
}

/* ===== MESSAGES DJANGO ===== */
.messages-container {
    margin-bottom: 1.2rem;
}

.message-success {
    background: #f0faf0;
    border: 1.5px solid #a8d5a2;
    color: #2a6b24;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 500;
}

.message-error {
    background: linear-gradient(90deg, #d0021b 80%, #a80000 100%);
    border-radius: 8px;
    padding: 12px 18px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ===== OVERLAY (ferme les popups) ===== */
.picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
}

.picker-overlay.open {
    display: block;
}

/* ===== Vue téléphone ===== */
@media (max-width: 700px) {
    .rdv-admin-container {
        margin-top: 90px;
        padding: 0 0.75rem;
    }
    .rdv-admin-card {
        padding: 22px 18px;
    }
    .rdv-admin-card h1 {
        font-size: 1.3rem;
    }
    /* Les champs largeur fixe passent en pleine largeur */
    input[type="number"].admin-input,
    .picker-input {
        width: 100%;
    }
    /* Le popup calendrier ne déborde pas de l'écran */
    .picker-popup {
        left: 0;
        right: 0;
        max-width: calc(100vw - 2rem);
    }
}

/* ============================================================
   Semaines du mois (récurrence style Outlook)
   ============================================================ */
.week-ordinals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.week-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f5f7fa;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.week-chip:hover {
    border-color: #4A90E2;
}

.week-chip input {
    accent-color: #4A90E2;
    cursor: pointer;
    margin: 0;
}

/* Met en évidence la case cochée */
.week-chip:has(input:checked) {
    background: #eaf4ff;
    border-color: #4A90E2;
    color: #357ABD;
    font-weight: 600;
}
