/**
 * Tree-Ripe Fruit Stop Calendar — Customer-Facing
 * Split-panel: sticky mini calendar left, stop detail right.
 * Shortcode: [tr_fruit_stop_calendar]
 *
 * @package TreeRipeEcosystem
 * @since 6.5.7
 */

/* ─── VARIABLES ─── */
.tr-fsc-split {
    --fsc-green: #0F5E41;
    --fsc-green-dk: #0A4730;
    --fsc-green-md: #408469;
    --fsc-green-lt: #f0f9f5;
    --fsc-white: #ffffff;
    --fsc-text: #1a1a1a;
    --fsc-sub: #444444;
    --fsc-gray: #666666;
    --fsc-border: #e0e5e8;
}

/* ─── SPLIT LAYOUT ─── */
.tr-fsc-split {
    display: flex;
    min-height: 0;
    font-family: 'Avenir Next', 'Avenir', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--fsc-text);
    -webkit-font-smoothing: antialiased;
}

/* ─── LEFT SIDEBAR: MINI CALENDAR ─── */
.tr-fsc-sidebar {
    width: clamp(300px, 36vw, 420px);
    background: var(--fsc-white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 0;
    padding-bottom: clamp(24px, 4vh, 48px);
}

/* Month navigation row */
.tr-fsc-month-nav {
    padding: clamp(16px, 2.5vh, 24px) clamp(16px, 2vw, 24px) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tr-fsc-month-label {
    font-family: 'Avenir Next', 'Avenir', -apple-system, sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 2.5vw, 22px);
    color: var(--fsc-green);
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tr-fsc-nav-btn {
    width: 36px;
    height: 36px;
    min-width: 44px;
    min-height: 44px;
    border: 1.5px solid var(--fsc-green);
    border-radius: 999px;
    background: transparent;
    color: var(--fsc-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
    padding: 0;
}

.tr-fsc-nav-btn:hover {
    background: var(--fsc-green);
    color: var(--fsc-white);
}

.tr-fsc-nav-btn i {
    font-size: 13px;
    line-height: 1;
}

/* Mini calendar grid */
.tr-fsc-mini-cal {
    padding: clamp(12px, 2vh, 20px) clamp(16px, 2vw, 24px);
}

.tr-fsc-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.tr-fsc-dow-cell {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--fsc-gray);
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tr-fsc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px 4px;
}

/* Day cell — flex wrapper keeps the inner circle centered */
.tr-fsc-day {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

/* Inner circle — fixed size, not stretched by grid column */
.tr-fsc-day-inner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--fsc-sub);
    cursor: default;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.tr-fsc-day--empty {
    visibility: hidden;
}

.tr-fsc-day--past .tr-fsc-day-inner {
    color: #cccccc;
}

/* Days with stops: dark green fill */
.tr-fsc-day--stops .tr-fsc-day-inner {
    background: var(--fsc-green);
    color: var(--fsc-white);
    cursor: pointer;
    font-weight: 700;
}

.tr-fsc-day--stops:hover .tr-fsc-day-inner {
    background: var(--fsc-green-dk);
}

/* Today without stops: ring border */
.tr-fsc-day--today:not(.tr-fsc-day--stops) .tr-fsc-day-inner {
    border: 2px solid var(--fsc-green);
    color: var(--fsc-green);
}

/* Selected stop day: medium green fill — visually distinct from today ring */
.tr-fsc-day--selected .tr-fsc-day-inner {
    background: var(--fsc-green-md) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

/* ─── SIDEBAR LEGEND ─── */
.tr-fsc-legend {
    padding: 0 clamp(16px, 2vw, 24px) clamp(16px, 2.5vh, 24px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.tr-fsc-leg-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--fsc-gray);
    font-weight: 500;
}

.tr-fsc-leg-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--fsc-green);
    flex-shrink: 0;
}

.tr-fsc-leg-ring {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid var(--fsc-green);
    flex-shrink: 0;
}

/* ─── RIGHT: DETAIL PANEL ─── */
.tr-fsc-detail {
    flex: 1;
    padding: clamp(24px, 4vh, 48px) clamp(24px, 4vw, 56px);
    min-width: 0;
}

/* Date header */
.tr-fsc-detail-header {
    margin-bottom: clamp(20px, 3vh, 32px);
    padding-bottom: clamp(16px, 2.5vh, 24px);
    border-bottom: 2px solid var(--fsc-green);
}

.tr-fsc-detail-date {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(22px, 3vw, 32px);
    color: var(--fsc-green);
    line-height: 1;
    letter-spacing: -0.01em;
}

.tr-fsc-detail-count {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--fsc-sub);
    margin-top: 8px;
    font-weight: 600;
}

/* Stop cards grid */
.tr-fsc-detail-stops {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.tr-fsc-detail-stop {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border: 1.5px solid var(--fsc-border);
    border-radius: 12px;
    padding: 16px;
    background: var(--fsc-white);
    transition: border-color 0.18s, background 0.15s;
}

.tr-fsc-detail-stop:hover {
    border-color: var(--fsc-green);
}

/* Time at top */
.tr-fsc-stop-time {
    font-size: 15px;
    font-weight: 700;
    color: var(--fsc-green);
    margin-bottom: 4px;
}

/* Stop name */
.tr-fsc-stop-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--fsc-text);
    line-height: 1.25;
    margin-bottom: 2px;
}

/* Location */
.tr-fsc-stop-loc {
    font-size: 14px;
    color: var(--fsc-sub);
    margin-bottom: 16px;
}

/* Primary button — full-width green pill */
.tr-fsc-reserve {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--fsc-green);
    color: var(--fsc-white);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 8px;
}

.tr-fsc-reserve i {
    font-size: 14px;
}

.tr-fsc-reserve:hover {
    background: var(--fsc-green-dk);
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Payment note */
.tr-fsc-reserve-note {
    text-align: center;
    font-size: 13px;
    color: var(--fsc-gray);
}

/* Secondary button — outlined */
.tr-fsc-view-stop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--fsc-green);
    font-family: 'Avenir Next', 'Avenir', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 100px;
    border: 2px solid var(--fsc-green);
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 8px;
}

.tr-fsc-view-stop:hover {
    background: var(--fsc-green-lt);
    transform: translateY(-1px);
    color: var(--fsc-green);
}

.tr-fsc-view-stop i {
    font-size: 13px;
}

/* Alert inside calendar stop cards */
.tr-fsc-detail-stop .tr-fs-card-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--fsc-green-lt) !important;
    border: none !important;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--fsc-green);
}

.tr-fsc-detail-stop .tr-fs-card-alert i {
    color: var(--fsc-green-md);
    font-size: 14px;
    flex-shrink: 0;
}

/* ─── EMPTY STATE ─── */
.tr-fsc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    color: var(--fsc-gray);
}

.tr-fsc-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: var(--fsc-green-lt);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--fsc-green-md);
}

.tr-fsc-empty-icon i {
    font-size: 28px;
}

.tr-fsc-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fsc-text);
    margin-bottom: 8px;
}

.tr-fsc-empty-sub {
    font-size: 16px;
    max-width: 340px;
    line-height: 1.6;
}

/* ─── FOCUS STATES ─── */
.tr-fsc-nav-btn:focus-visible,
.tr-fsc-reserve:focus-visible {
    outline: 3px solid var(--fsc-green);
    outline-offset: 2px;
}

/* ─── RESPONSIVE: TABLET ─── */
@media (max-width: 1024px) {
    .tr-fsc-split {
        flex-direction: column;
    }

    .tr-fsc-sidebar {
        width: 100%;
        position: static;
    }

    .tr-fsc-detail {
        padding: clamp(16px, 3vh, 28px) clamp(16px, 5vw, 32px);
    }

    .tr-fsc-detail-stops {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* ─── RESPONSIVE: MOBILE ─── */
@media (max-width: 600px) {
    .tr-fsc-detail-stops {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tr-fsc-detail-stop {
        padding: 12px;
        gap: 10px;
    }
}

/* ─── POP-UP "WALK-UP ONLY" PILL ─── */
/* Pop-Up stops show in the calendar detail but cannot be reserved. */
/* Styled to match the green design language. */
.tr-fsc-split .tr-fsc-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--fsc-green-lt);
    color: var(--fsc-green);
    border: none;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 8px;
    line-height: 1.3;
}

.tr-fsc-split .tr-fsc-pill i {
    font-size: 14px;
    color: var(--fsc-green-md);
}
