/* =============================================
   ATR Rambam Yomi — Styles
   Matches AskTheRav.com design system
   ============================================= */

.rambam-yomi-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
}

/* Page header */
.rambam-page-header {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0 0 24px;
}

/* Loading state */
.rambam-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 0;
    color: #999;
    font-size: 14px;
}

.rambam-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e5ea;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: rambam-spin 0.6s linear infinite;
}

@keyframes rambam-spin {
    to { transform: rotate(360deg); }
}

/* Track toggle */
.rambam-track-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
}

.rambam-track-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #0073aa;
    background: #fff;
    color: #0073aa;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.rambam-track-btn:first-child {
    border-radius: 25px 0 0 25px;
    border-right: 1px solid #0073aa;
}

.rambam-track-btn:last-child {
    border-radius: 0 25px 25px 0;
    border-left: 1px solid #0073aa;
}

.rambam-track-btn.active {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
}

.rambam-track-btn:hover:not(.active) {
    background: #f0f7fc;
}

/* Date nav */
.rambam-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.rambam-date-arrow {
    width: 36px;
    height: 36px;
    border: 2px solid #e2e5ea;
    border-radius: 50%;
    background: #fff;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.rambam-date-arrow:hover {
    border-color: #0073aa;
    color: #0073aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,115,170,0.15);
}

.rambam-date-display {
    text-align: center;
    min-width: 180px;
}

.rambam-date-hebrew {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    unicode-bidi: plaintext;
    text-align: center;
}

.rambam-today-btn {
    font-size: 11px;
    font-weight: 500;
    color: #0073aa;
    cursor: pointer;
    border: none;
    background: none;
    padding: 2px 8px;
    margin-top: 2px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rambam-today-btn:hover {
    color: #005a87;
}

/* Calendar toggle */
.rambam-calendar-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.rambam-calendar-toggle-btn {
    font-size: 12px;
    font-weight: 500;
    color: #0073aa;
    cursor: pointer;
    border: 1px solid #e2e5ea;
    background: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.rambam-calendar-toggle-btn:hover {
    border-color: #0073aa;
    background: #f0f7fc;
}

.rambam-calendar-toggle-btn.open {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Calendar */
.rambam-calendar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 16px;
    margin-bottom: 24px;
    display: none;
}

.rambam-calendar.open {
    display: block;
}

.rambam-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rambam-cal-month {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    unicode-bidi: plaintext;
    text-align: center;
}

.rambam-cal-nav {
    width: 30px;
    height: 30px;
    border: 1px solid #e2e5ea;
    border-radius: 50%;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.rambam-cal-nav:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.rambam-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.rambam-cal-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    padding: 4px 0;
}

.rambam-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.rambam-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    padding: 2px;
}

.rambam-cal-day:hover {
    background: #f0f7fc;
}

.rambam-cal-day.empty {
    cursor: default;
}

.rambam-cal-day.empty:hover {
    background: transparent;
}

.rambam-cal-day.selected {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

.rambam-cal-day.today {
    border: 2px solid #0073aa;
    font-weight: 600;
}

.rambam-cal-dots {
    display: flex;
    gap: 3px;
    margin-top: 1px;
    height: 5px;
}

.rambam-cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.rambam-cal-dot.track-3 {
    background: #0073aa;
}

.rambam-cal-dot.track-1 {
    background: #f59e0b;
}

.rambam-cal-day.selected .rambam-cal-dot.track-3 {
    background: #fff;
}

.rambam-cal-day.selected .rambam-cal-dot.track-1 {
    background: #fde68a;
}

/* Quota card */
.rambam-quota-card {
    background: linear-gradient(135deg, #f8fbff 0%, #eef4fa 100%);
    border: 2px solid #d0e2f0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,115,170,0.08);
    padding: 28px 32px;
    margin-bottom: 24px;
    text-align: center;
}

.rambam-quota-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 12px;
}

.rambam-quota-cycle {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.rambam-quota-text {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    unicode-bidi: plaintext;
    text-align: center;
    direction: rtl;
}

.rambam-quota-text .halacha-line {
    display: block;
}

/* Posts section */
.rambam-posts-section {
    margin-bottom: 24px;
}

.rambam-posts-header {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e5ea;
}

.rambam-post-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

.rambam-post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.rambam-post-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    unicode-bidi: plaintext;
    text-align: start;
}

.rambam-post-card:hover .rambam-post-title {
    color: #0073aa;
}

.rambam-post-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    unicode-bidi: plaintext;
    text-align: start;
}

.rambam-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.rambam-post-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f0f7fc;
    color: #0073aa;
}

.rambam-no-posts {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 14px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Legend */
.rambam-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #999;
}

.rambam-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rambam-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.rambam-legend-dot.track-3 {
    background: #0073aa;
}

.rambam-legend-dot.track-1 {
    background: #f59e0b;
}

/* Mobile */
@media (max-width: 768px) {
    .rambam-yomi-wrapper {
        padding: 0 10px;
    }

    .rambam-page-header {
        font-size: 22px;
    }

    .rambam-quota-card {
        padding: 18px 20px;
    }

    .rambam-quota-text {
        font-size: 16px;
    }

    .rambam-date-hebrew {
        font-size: 16px;
    }

    .rambam-track-btn {
        padding: 7px 16px;
        font-size: 13px;
    }

    .rambam-post-card {
        padding: 14px 16px;
    }

    .rambam-cal-day {
        font-size: 12px;
    }
}
