/* =========================================================
   Yoga Planning — Styles frontend
   Palette Maison Yoga&Flow
   ========================================================= */

:root {
    --mf-cream:        #f5f0eb;
    --mf-brown:        #8B6B4A;
    --mf-brown-light:  #e8ddd4;
    --mf-brown-mid:    #b08d6e;
    --mf-brown-dark:   #5c4430;
    --mf-admin:        #c4956a;
    --mf-admin-bg:     #f5ede4;
    --mf-dark:         #1a1a1a;
    --mf-muted:        #6b6056;
    --mf-border:       #ece4dc;
    --mf-bg:           #faf7f4;
    --mf-white:        #ffffff;
    --mf-radius:       12px;
    --mf-radius-sm:    8px;
    --mf-radius-pill:  50px;
}

/* ── Base ──────────────────────────────────────────────────── */

.yp-not-logged {
    color: var(--mf-muted);
    font-style: italic;
}

/* ── Wrapper calendrier ────────────────────────────────────── */

.yp-calendar-wrap {
    max-width: 860px;
    margin: 2rem auto;
    font-family: inherit;
}

.yp-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.yp-calendar-header h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--mf-dark);
    margin: 0;
    letter-spacing: .01em;
}

/* ── Barre de navigation semaine / mois ────────────────────── */

.yp-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 12px;
    flex-wrap: wrap;
}

.yp-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.yp-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0.5px solid var(--mf-border);
    background: var(--mf-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mf-muted);
    font-size: 15px;
    transition: border-color .2s;
}
.yp-nav-btn:hover { border-color: var(--mf-brown); color: var(--mf-brown); }

.yp-nav-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--mf-dark);
    letter-spacing: .01em;
    min-width: 160px;
    text-align: center;
}

.yp-today-btn {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
    padding: 6px 14px;
    border-radius: var(--mf-radius-pill);
    border: 0.5px solid var(--mf-border);
    background: var(--mf-white);
    color: var(--mf-muted);
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.yp-today-btn:hover { border-color: var(--mf-brown); color: var(--mf-brown); }

/* ── Toggle vue semaine / mois ─────────────────────────────── */

.yp-view-tabs {
    display: flex;
    gap: 0;
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius-pill);
    padding: 3px;
    background: var(--mf-white);
}

.yp-view-tab {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .03em;
    padding: 5px 16px;
    border: none;
    border-radius: var(--mf-radius-pill);
    cursor: pointer;
    background: none;
    color: var(--mf-muted);
    transition: all .2s;
}
.yp-view-tab.active {
    background: var(--mf-brown);
    color: var(--mf-white);
}

/* ── VUE SEMAINE ───────────────────────────────────────────── */

.yp-week-view {
    background: var(--mf-white);
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius);
    overflow: hidden;
}

.yp-day-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--mf-border);
    transition: background .15s;
}
.yp-day-row:last-child { border-bottom: none; }

.yp-day-label {
    width: 70px;
    flex-shrink: 0;
    padding-top: 2px;
}

.yp-day-name {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--mf-muted);
    margin-bottom: 3px;
}

.yp-day-num {
    font-size: 24px;
    font-weight: 300;
    color: var(--mf-dark);
    line-height: 1;
}

.yp-day-num.today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mf-brown);
    color: var(--mf-white);
    font-size: 18px;
    font-weight: 500;
}

.yp-day-sessions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yp-day-empty {
    font-size: 12px;
    color: #ccc;
    padding-top: 6px;
    font-style: italic;
}

/* ── Carte séance ──────────────────────────────────────────── */

.yp-session-date-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--mf-muted);
    margin-bottom: 5px;
}

.yp-session-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--mf-white);
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s;
    border-left-width: 2px;
}
.yp-session-card:hover { border-color: var(--mf-brown-mid); }
.yp-session-card.source-member { border-left-color: var(--mf-brown); }
.yp-session-card.source-admin  { border-left-color: var(--mf-admin); }

.yp-session-thumb {
    width: 163px;
    height: 109px;
    border-radius: 6px;
    background: var(--mf-brown-light);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.yp-session-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.yp-session-thumb-placeholder {
    opacity: .3;
    font-size: 18px;
}

.yp-session-info { flex: 1; min-width: 0; }

.yp-session-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--mf-dark);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 600px) {
    .yp-session-title {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        word-break: break-word;
        max-width: calc(100vw - 180px);
    }
}

.yp-session-meta {
    font-size: 11px;
    color: var(--mf-muted);
    letter-spacing: .01em;
}

.yp-session-tag {
    font-size: 10px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: var(--mf-radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
}
.yp-session-tag.source-member {
    background: var(--mf-brown-light);
    color: var(--mf-brown-dark);
}
.yp-session-tag.source-admin {
    background: var(--mf-admin-bg);
    color: var(--mf-admin);
}

.yp-session-delete {
    background: none;
    border: none;
    color: #d5ccc5;
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.yp-session-delete:hover { color: var(--mf-brown); }

/* ── VUE MOIS ──────────────────────────────────────────────── */

.yp-month-view {
    background: var(--mf-white);
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius);
    overflow: hidden;
}

.yp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    table-layout: fixed;
}

.yp-cal-dow {
    background: var(--mf-bg);
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--mf-muted);
    padding: 10px 0;
    border-bottom: 0.5px solid var(--mf-border);
}

.yp-cal-cell {
    min-height: 80px;
    padding: 8px 5px 6px;
    border-right: 0.5px solid var(--mf-border);
    border-bottom: 0.5px solid var(--mf-border);
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}
.yp-cal-cell:nth-child(7n) { border-right: none; }
.yp-cal-last-row .yp-cal-cell { border-bottom: none; }

.yp-cal-cell.other-month { background: var(--mf-bg); }
.yp-cal-cell.other-month .yp-cal-day-num { color: #ccc; }

.yp-cal-day-num {
    font-size: 12px;
    color: var(--mf-muted);
    margin-bottom: 5px;
    line-height: 1;
    display: inline-block;
    width: 22px;
    height: 22px;
    text-align: center;
    line-height: 22px;
    border-radius: 50%;
}

.yp-cal-cell.today .yp-cal-day-num {
    background: var(--mf-brown);
    color: var(--mf-white);
    font-weight: 500;
    font-size: 11px;
}

.yp-cal-event {
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: opacity .15s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.yp-cal-event:hover { opacity: .8; }
.yp-cal-event.source-member {
    background: var(--mf-brown-light);
    color: var(--mf-brown-dark);
}
.yp-cal-event.source-admin {
    background: var(--mf-admin-bg);
    color: var(--mf-admin);
}

/* ── Légende ───────────────────────────────────────────────── */

.yp-legend {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.yp-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--mf-muted);
}
.yp-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ── Bouton "Ajouter à mon planning" ───────────────────────── */

.yp-add-wrap { margin: 1.5rem 0; }

.yp-btn-add {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--mf-brown);
    color: var(--mf-white);
    border: none;
    border-radius: var(--mf-radius-pill);
    padding: .6rem 1.4rem;
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s;
}
.yp-btn-add:hover { background: var(--mf-brown-dark); }

.yp-picker {
    background: var(--mf-bg);
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius);
    padding: 1.2rem;
    margin-top: .75rem;
    max-width: 320px;
}

.yp-picker label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: var(--mf-muted);
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: .3rem;
    margin-top: .8rem;
}
.yp-picker label:first-child { margin-top: 0; }

.yp-picker input[type="date"],
.yp-picker input[type="time"] {
    width: 100%;
    padding: .5rem .7rem;
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius-sm);
    font-size: .9rem;
    background: var(--mf-white);
    color: var(--mf-dark);
    box-sizing: border-box;
}

.yp-picker-actions {
    display: flex;
    gap: .6rem;
    margin-top: 1rem;
}

.yp-btn-confirm {
    flex: 1;
    background: var(--mf-brown);
    color: var(--mf-white);
    border: none;
    border-radius: var(--mf-radius-pill);
    padding: .55rem;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}
.yp-btn-confirm:hover { background: var(--mf-brown-dark); }

.yp-btn-cancel {
    flex: 1;
    background: transparent;
    color: var(--mf-muted);
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius-pill);
    padding: .55rem;
    font-size: .88rem;
    cursor: pointer;
}

.yp-feedback {
    font-size: .82rem;
    margin: .6rem 0 0;
    min-height: 1.2em;
    color: var(--mf-brown);
}
.yp-feedback.error { color: #c0392b; }

/* ── Notifications — cloche ────────────────────────────────── */

.yp-notif-wrap {
    position: relative;
    display: inline-block;
}

.yp-notif-bell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px 7px 12px;
    background: var(--mf-white);
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius-pill);
    cursor: pointer;
    color: var(--mf-brown);
    position: relative;
    transition: border-color .2s;
    font-size: 13px;
    font-weight: 500;
    color: var(--mf-dark);
    letter-spacing: .01em;
}
.yp-notif-bell:hover { border-color: var(--mf-brown); }
.yp-notif-bell svg { color: var(--mf-brown); }

.yp-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--mf-brown);
    color: var(--mf-white);
    font-size: 9px;
    font-weight: 500;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--mf-bg, #fff);
}
.yp-notif-badge--hidden { display: none; }

/* ── Notifications — panneau ───────────────────────────────── */

.yp-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--mf-white);
    border: 0.5px solid var(--mf-border);
    border-radius: 16px;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(139,107,74,.1);
}

.yp-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px 11px;
    border-bottom: 0.5px solid var(--mf-border);
}
.yp-notif-header-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--mf-dark);
    letter-spacing: .01em;
}
.yp-notif-count {
    font-size: 10px;
    font-weight: 500;
    background: var(--mf-cream);
    color: var(--mf-brown);
    padding: 3px 10px;
    border-radius: var(--mf-radius-pill);
    border: 0.5px solid var(--mf-border);
}

.yp-notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.yp-notif-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--mf-muted);
    font-size: .88rem;
    font-style: italic;
}

.yp-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--mf-border);
    transition: background .15s;
}
.yp-notif-item:last-child { border-bottom: none; }
.yp-notif-item:hover { background: var(--mf-bg); }
.yp-notif-item.yp-notif-item--imported { opacity: .7; }

.yp-notif-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mf-brown);
    flex-shrink: 0;
    margin-top: 4px;
}
.yp-notif-dot.read { background: var(--mf-border); }

.yp-notif-body { flex: 1; min-width: 0; }
.yp-notif-body strong {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--mf-dark);
    margin-bottom: 2px;
    line-height: 1.4;
}
.yp-notif-item--imported .yp-notif-body strong { color: var(--mf-muted); }
.yp-notif-body p {
    font-size: 11px;
    color: var(--mf-muted);
    margin: 0 0 3px;
    line-height: 1.4;
}
.yp-notif-date {
    font-size: 10px;
    color: #bbb;
}

.yp-notif-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.yp-notif-import-btn,
a.yp-notif-import-btn {
    display: inline-block !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: .03em !important;
    color: var(--mf-white) !important;
    background: var(--mf-brown) !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 4px 11px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    line-height: 1.6 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    transition: background .2s;
}
.yp-notif-import-btn:hover,
a.yp-notif-import-btn:hover { background: var(--mf-brown-dark) !important; }

.yp-notif-delete-btn,
a.yp-notif-delete-btn {
    display: inline-block !important;
    background: none !important;
    border: none !important;
    color: #bbb !important;
    font-size: 11px !important;
    cursor: pointer !important;
    padding: 2px 4px !important;
    line-height: 1 !important;
    text-decoration: none !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    transition: color .15s;
}
.yp-notif-delete-btn:hover,
a.yp-notif-delete-btn:hover { color: var(--mf-brown) !important; }

/* ── Message flash import ──────────────────────────────────── */

.yp-import-success {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mf-brown);
    color: var(--mf-white);
    padding: .85rem 2rem;
    border-radius: var(--mf-radius-pill);
    font-size: .92rem;
    font-weight: 500;
    letter-spacing: .01em;
    z-index: 9999;
    transition: opacity .5s ease;
    white-space: nowrap;
}

/* ── Info bouton & tooltip ─────────────────────────────────── */

.yp-header-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.yp-info-wrap {
    position: relative;
    display: inline-flex;
}

.yp-info-btn {
    background: none;
    border: 1px solid var(--mf-border);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--mf-muted);
    padding: 0;
    transition: border-color .2s, color .2s;
    flex-shrink: 0;
}
.yp-info-btn:hover {
    border-color: var(--mf-brown);
    color: var(--mf-brown);
}

.yp-info-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 300px;
    background: var(--mf-white);
    border: 0.5px solid var(--mf-border);
    border-radius: var(--mf-radius);
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(139,107,74,.12);
    z-index: 100;
}

.yp-info-tooltip p {
    font-size: 12px;
    color: var(--mf-muted);
    line-height: 1.6;
    margin: 0 0 8px;
}
.yp-info-tooltip p:last-child { margin-bottom: 0; }
.yp-info-tooltip strong {
    color: var(--mf-dark);
    font-weight: 500;
}

/* ── Cartes séance +20% ────────────────────────────────────── */

.yp-session-card {
    padding: 13px 15px !important;
}

.yp-session-thumb {
    width: 163px !important;
    height: 109px !important;
}

.yp-session-title {
    font-size: 14px !important;
    white-space: normal !important;
    word-break: break-word;
    overflow: visible !important;
    text-overflow: unset !important;
    display: block;
}

.yp-session-meta {
    font-size: 12px !important;
}

.yp-day-row {
    padding: 18px 22px !important;
}

/* ── Divi compatibility — forcer les événements souris ─────── */

.yp-notif-wrap,
.yp-notif-bell,
.yp-notif-panel,
.yp-info-wrap,
.yp-info-btn {
    pointer-events: all !important;
    position: relative;
}

.yp-notif-panel {
    pointer-events: all !important;
    position: absolute !important;
}

/* ── Mobile (< 600px) ──────────────────────────────────────── */

@media (max-width: 600px) {

    /* Navigation */
    .yp-nav-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .yp-nav-title {
        font-size: 13px;
        min-width: 0;
    }

    /* Vue semaine */
    .yp-day-row {
        flex-direction: column;
        gap: 8px;
        padding: 12px 14px !important;
    }

    .yp-day-label {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .yp-day-name {
        font-size: 11px;
        margin-bottom: 0;
    }

    .yp-day-num {
        font-size: 18px;
    }

    /* Carte séance mobile */
    .yp-session-card {
        padding: 10px 10px !important;
        gap: 8px;
    }

    .yp-session-thumb {
        width: 80px !important;
        height: 54px !important;
    }

    .yp-session-title {
        font-size: 12px !important;
    }

    .yp-session-meta {
        font-size: 11px !important;
    }

    .yp-session-tag {
        display: none;
    }

    /* Vue mois mobile */
    .yp-cal-cell {
        min-height: 48px;
        padding: 5px 3px 3px;
    }

    .yp-cal-day-num {
        font-size: 10px;
        width: 18px;
        height: 18px;
        line-height: 18px;
    }

    .yp-cal-event {
        font-size: 8px;
        padding: 1px 3px;
    }

    .yp-cal-dow {
        font-size: 8px;
        padding: 6px 0;
    }

    /* Notifications */
    .yp-notif-panel {
        width: calc(100vw - 32px);
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        position: fixed !important;
        top: auto !important;
        bottom: 16px !important;
        max-height: 70vh;
        overflow-y: auto;
    }

    /* Info tooltip */
    .yp-info-tooltip {
        width: calc(100vw - 48px);
        left: auto;
        right: 0;
    }
}

/* ── Tablette (600–900px) ──────────────────────────────────── */

@media (min-width: 601px) and (max-width: 900px) {

    .yp-session-thumb {
        width: 100px !important;
        height: 68px !important;
    }

    .yp-cal-event {
        font-size: 9px;
    }

    .yp-notif-panel {
        width: 300px;
    }
}

/* ── Textes en gras sur la page Mon Planning ───────────────── */

.yp-calendar-wrap,
.yp-calendar-wrap * {
    font-weight: 500;
}

.yp-calendar-wrap .yp-day-empty,
.yp-calendar-wrap .yp-session-meta,
.yp-calendar-wrap .yp-legend-item,
.yp-calendar-wrap .yp-cal-event,
.yp-calendar-wrap .yp-notif-date {
    font-weight: 400;
}

/* ── Fix nth-child border sur la grille mois ───────────────── */

.yp-cal-grid .yp-cal-dow:nth-child(7n),
.yp-cal-grid .yp-cal-cell:nth-child(7n) {
    border-right: none;
}

/* ── Divi override — bouton Ajouter ───────────────────────── */

a.yp-btn-add,
a.yp-btn-add:hover,
a.yp-btn-add:visited {
    display: inline-flex !important;
    align-items: center !important;
    gap: .5rem !important;
    background: var(--mf-brown) !important;
    color: var(--mf-white) !important;
    border: none !important;
    border-radius: var(--mf-radius-pill) !important;
    padding: .6rem 1.4rem !important;
    font-size: .88rem !important;
    font-weight: 500 !important;
    letter-spacing: .02em !important;
    cursor: pointer !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
}

a.yp-btn-cancel {
    display: flex !important;
    flex: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    color: var(--mf-muted) !important;
    border: 0.5px solid var(--mf-border) !important;
    border-radius: var(--mf-radius-pill) !important;
    padding: .55rem !important;
    font-size: .88rem !important;
    cursor: pointer !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
}
