/* ============================================================
   Mahapuran Panchang – Frontend CSS
   Classic Hindu Calendar Look
   ============================================================ */

/* Google Font import handled inline via PHP template */

/* ── Root / CSS Variables ────────────────────────────────── */
:root {
    --mp-saffron:    #ff6b00;
    --mp-gold:       #ffd700;
    --mp-deep-red:   #8b0000;
    --mp-ochre:      #d2691e;
    --mp-cream:      #fff8f0;
    --mp-light-gold: #fff3cd;
    --mp-border:     #e8c97c;
    --mp-text:       #2c1810;
    --mp-text-light: #6b4c3b;
    --mp-shadow:     rgba(139,0,0,0.12);
    --mp-radius:     10px;
    --mp-font:       'Mukta', serif;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.mp-panchang-wrap {
    font-family: var(--mp-font);
    max-width: 900px;
    margin: 0 auto;
    background: var(--mp-calendar-bg, #fff8f0);
    border-radius: var(--mp-radius);
    border: 2px solid var(--mp-border);
    box-shadow: 0 6px 28px var(--mp-shadow);
    overflow: hidden;
}

/* ── Top Bar ─────────────────────────────────────────────── */
.mp-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff3e0;
    border-bottom: 1px solid var(--mp-border);
    flex-wrap: wrap;
    gap: 8px;
}

.mp-location-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mp-location-icon { font-size: 16px; }

.mp-city-select {
    font-family: var(--mp-font);
    padding: 5px 10px;
    border: 1px solid var(--mp-border);
    border-radius: 6px;
    background: white;
    color: var(--mp-text);
    font-size: 14px;
    cursor: pointer;
}

.mp-detect-btn,
.mp-today-btn {
    font-family: var(--mp-font);
    background: var(--mp-deep-red, #8b0000);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.mp-detect-btn:hover,
.mp-today-btn:hover {
    background: var(--mp-ochre);
}

/* ── Calendar Header ─────────────────────────────────────── */
.mp-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--mp-header-bg, #8b0000) 0%, #b22222 100%);
    color: var(--mp-header-text, #ffd700);
    text-align: center;
}

.mp-cal-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--mp-header-text, #ffd700);
}

.mp-samvat {
    font-size: 12px;
    opacity: 0.85;
    display: block;
    margin-top: 2px;
    color: var(--mp-gold);
}

.mp-nav-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--mp-header-text, #ffd700);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.mp-nav-btn:hover { background: rgba(255,255,255,0.3); }

/* ── Day Headers ─────────────────────────────────────────── */
.mp-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #cc7722, #e8943a);
}

.mp-day-header {
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.mp-day-header:last-child { border-right: none; }

/* Sunday color override */
.mp-day-headers .mp-day-header:first-child { color: #ffe0b2; }

/* ── Calendar Grid ───────────────────────────────────────── */
.mp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--mp-calendar-bg, #fff8f0);
}

.mp-cal-cell {
    border-right: 1px solid #e8c97c;
    border-bottom: 1px solid #e8c97c;
    padding: 6px 5px 5px;
    min-height: 80px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    font-family: var(--mp-font);
}

.mp-cal-cell:hover {
    background: #fff3e0;
}

.mp-cal-cell:nth-child(7n) { border-right: none; }

.mp-cal-cell.mp-empty {
    background: #fdf5e6;
    cursor: default;
}

.mp-cal-cell.mp-today {
    background: #fff9e6;
    box-shadow: inset 0 0 0 2px var(--mp-today, #ff6b00);
}

/* Date number */
.mp-date-num {
    font-size: 17px;
    font-weight: 700;
    color: var(--mp-text);
    line-height: 1;
    margin-bottom: 3px;
}

/* Sunday – first column cells */
.mp-cal-cell:nth-child(7n+1) .mp-date-num { color: #c62828; }

.mp-today-tag {
    font-size: 9px;
    background: var(--mp-today, #ff6b00);
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 3px;
}

/* Sunrise in cell */
.mp-sunrise-small {
    font-size: 10px;
    color: var(--mp-sunrise, #ff9800);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tithi in cell */
.mp-tithi-small {
    font-size: 11px;
    color: var(--mp-text-light);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-tithi-link {
    color: inherit;
    text-decoration: none;
}
.mp-tithi-link:hover { color: var(--mp-saffron); text-decoration: underline; }

/* Festival tag in cell */
.mp-festival-tag {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--mp-festival, #ff6b00);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.mp-festival-tag:hover { text-decoration: underline; }

/* Colored dot */
.mp-fest-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: absolute;
    top: 5px;
    right: 5px;
}

/* Loading */
.mp-loading {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--mp-text-light);
    font-size: 16px;
}

/* ── Modal Overlay ───────────────────────────────────────── */
.mp-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mp-modal-overlay.active {
    display: flex;
}

.mp-modal {
    background: var(--mp-cream);
    border-radius: 14px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    border: 2px solid var(--mp-border);
    box-shadow: 0 20px 60px rgba(139,0,0,0.25);
    font-family: var(--mp-font);
}

.mp-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--mp-text-light);
    line-height: 1;
}
.mp-modal-close:hover { color: var(--mp-saffron); }

.mp-modal-date {
    font-size: 17px;
    font-weight: 700;
    color: var(--mp-deep-red);
    border-bottom: 2px solid var(--mp-border);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

/* Detail grid */
.mp-panchang-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .mp-panchang-detail-grid { grid-template-columns: 1fr; }
}

.mp-detail-row {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #ffe0b2;
    border-radius: 8px;
    padding: 8px 12px;
}

.mp-detail-label {
    font-size: 11px;
    color: var(--mp-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mp-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--mp-text);
    margin-top: 2px;
}

.mp-detail-value a {
    color: var(--mp-deep-red);
    text-decoration: none;
}
.mp-detail-value a:hover { text-decoration: underline; }

.mp-sun { font-weight: 700; }
.mp-sun.sunrise { color: var(--mp-sunrise, #ff9800); }
.mp-sun.sunset  { color: var(--mp-sunset, #e91e63); }

/* Timings section */
.mp-timings-section {
    margin-bottom: 14px;
}
.mp-timings-section h4 {
    font-size: 14px;
    margin: 0 0 8px;
    color: var(--mp-text);
}
.mp-timing {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 4px;
}
.mp-timing.shubh   { background: #e8f5e9; color: #2e7d32; }
.mp-timing.ashubh  { background: #fce4ec; color: #b71c1c; }

/* Festival banner in modal */
.mp-modal-festival {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border: 1px solid var(--mp-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.mp-modal-festival h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--mp-deep-red);
}
.mp-modal-festival h3 a { color: inherit; text-decoration: none; }
.mp-modal-festival h3 a:hover { text-decoration: underline; }
.mp-modal-festival p { margin: 4px 0 10px; font-size: 13px; color: var(--mp-text-light); }

.mp-gcal-btn {
    display: inline-block;
    background: #4285f4;
    color: white !important;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    margin-right: 8px;
}

.mp-reminder-btn {
    background: var(--mp-saffron);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.mp-reminder-btn:hover { background: var(--mp-ochre); }

/* Reminder form */
.mp-reminder-form {
    background: white;
    border: 1px solid var(--mp-border);
    border-radius: 8px;
    padding: 14px;
    margin-top: 10px;
}
.mp-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    box-sizing: border-box;
    font-family: var(--mp-font);
}
.mp-reminder-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    font-family: var(--mp-font);
}

.mp-btn-primary {
    background: var(--mp-deep-red);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--mp-font);
}

.mp-modal-seo-link {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}
.mp-modal-seo-link a { color: var(--mp-saffron); }

/* ── Today Widget ────────────────────────────────────────── */
.mp-today-widget {
    background: var(--mp-cream);
    border-radius: var(--mp-radius);
    border: 2px solid var(--mp-border);
    overflow: hidden;
    font-family: var(--mp-font);
    box-shadow: 0 4px 18px var(--mp-shadow);
}

.mp-today-header {
    padding: 18px 20px;
    text-align: center;
}
.mp-today-header h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
}
.mp-today-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.85;
}

.mp-today-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--mp-border);
    border-top: 1px solid var(--mp-border);
}
@media (max-width: 600px) {
    .mp-today-grid { grid-template-columns: repeat(2, 1fr); }
}

.mp-info-card {
    background: white;
    padding: 14px 10px;
    text-align: center;
    transition: background 0.15s;
}
.mp-info-card:hover { background: #fff3e0; }

.mp-info-icon { font-size: 22px; }
.mp-info-label {
    font-size: 11px;
    color: var(--mp-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 4px 0 2px;
    font-weight: 600;
}
.mp-info-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--mp-text);
}
.mp-info-value a { color: var(--mp-deep-red); text-decoration: none; }
.mp-info-value a:hover { text-decoration: underline; }

.mp-timings-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #fdf5e6;
    border-top: 1px solid var(--mp-border);
}

.mp-timing-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}
.mp-timing-item.shubh  { background: #e8f5e9; color: #2e7d32; }
.mp-timing-item.ashubh { background: #fce4ec; color: #b71c1c; }

.mp-festival-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff8e1;
    border-top: 3px solid;
}
.mp-festival-icon { font-size: 24px; }
.mp-festival-banner strong a {
    color: var(--mp-deep-red);
    font-size: 16px;
    text-decoration: none;
}
.mp-festival-banner p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--mp-text-light);
}

.mp-gcal-small {
    margin-left: auto;
    background: #4285f4;
    color: white !important;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

/* ── Compact Widget ──────────────────────────────────────── */
.mp-compact-widget {
    background: var(--mp-cream);
    border: 2px solid var(--mp-border);
    border-radius: var(--mp-radius);
    overflow: hidden;
    font-family: var(--mp-font);
}

.mp-compact-header {
    background: linear-gradient(135deg, var(--mp-deep-red), #b22222);
    color: var(--mp-gold);
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.mp-compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid #ffe0b2;
    font-size: 13px;
    color: var(--mp-text);
}
.mp-compact-row:last-child { border-bottom: none; }
.mp-compact-row a { color: var(--mp-deep-red); text-decoration: none; }
.mp-compact-row a:hover { text-decoration: underline; }

/* ── Festivals List ──────────────────────────────────────── */
.mp-festivals-list {
    font-family: var(--mp-font);
}

.mp-list-title {
    font-size: 20px;
    color: var(--mp-deep-red);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--mp-border);
}

.mp-fest-grid {
    display: grid;
    gap: 8px;
}

.mp-fest-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--mp-cream);
    border: 1px solid var(--mp-border);
    border-radius: 8px;
    padding: 12px 14px;
    transition: box-shadow 0.2s;
}
.mp-fest-card:hover { box-shadow: 0 3px 12px var(--mp-shadow); }

.mp-fest-date {
    min-width: 52px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mp-text-light);
    text-align: center;
}

.mp-fest-info { flex: 1; }

.mp-fest-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--mp-deep-red);
    text-decoration: none;
    display: block;
}
.mp-fest-name:hover { text-decoration: underline; }

.mp-fest-hindi {
    font-size: 14px;
    color: var(--mp-text-light);
    margin-left: 6px;
}

.mp-holiday-tag {
    background: #ffe082;
    color: #5d4037;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}

.mp-gcal-icon {
    font-size: 18px;
    text-decoration: none;
    transition: transform 0.2s;
}
.mp-gcal-icon:hover { transform: scale(1.2); }

.mp-no-data {
    padding: 20px;
    text-align: center;
    color: var(--mp-text-light);
    background: #fff3e0;
    border-radius: 8px;
    border: 1px dashed var(--mp-border);
}

/* ── Ekadashi List ───────────────────────────────────────── */
.mp-ekadashi-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.mp-ekadashi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--mp-cream);
    border: 1px solid var(--mp-border);
    border-radius: 8px;
    padding: 12px 14px;
    transition: box-shadow 0.2s;
    border-left: 4px solid var(--mp-ekadashi, #9c27b0);
}
.mp-ekadashi-card:hover { box-shadow: 0 3px 12px var(--mp-shadow); }

.mp-ek-number {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mp-ekadashi, #9c27b0);
    color: white;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-ek-info { flex: 1; }
.mp-ek-date { font-size: 15px; font-weight: 700; color: var(--mp-text); }
.mp-ek-day  { font-size: 12px; color: var(--mp-text-light); }
.mp-ek-name a { color: var(--mp-deep-red); font-size: 13px; font-weight: 600; text-decoration: none; }
.mp-ek-name a:hover { text-decoration: underline; }
.mp-ek-nakshatra,
.mp-ek-sunrise { font-size: 11px; color: var(--mp-text-light); }

.mp-ekadashi-note {
    text-align: center;
    color: var(--mp-text-light);
    font-size: 13px;
    padding: 12px;
    background: #f3e5f5;
    border-radius: 8px;
    margin-top: 14px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .mp-cal-cell { min-height: 58px; padding: 4px 3px; }
    .mp-date-num { font-size: 14px; }
    .mp-sunrise-small,
    .mp-tithi-small { font-size: 9px; }
    .mp-festival-tag { font-size: 9px; }
    .mp-top-bar { flex-direction: column; align-items: flex-start; }
    .mp-panchang-detail-grid { grid-template-columns: 1fr; }
}

/* ===== v1.3 compact calendar polish ===== */
.mp-cal-title .mp-samvat {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.88);
}

.mp-calendar-grid {
    background: #ece3d4;
}

.mp-loading.mp-load-error {
    color: #b00020;
}

.mp-cal-cell {
    min-height: 96px;
    background: #fffdf9;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mp-cal-cell:hover {
    background: #fff6ea;
}

.mp-cal-cell.mp-empty {
    background: #efebe3;
    background-image: linear-gradient(135deg, rgba(0,0,0,0.025) 25%, transparent 25%, transparent 50%, rgba(0,0,0,0.025) 50%, rgba(0,0,0,0.025) 75%, transparent 75%, transparent);
    background-size: 16px 16px;
}

.mp-cal-cell.mp-no-data {
    background: #f3f3f3;
}

.mp-cal-cell.mp-no-data .mp-date-num {
    color: #8d8d8d;
}

.mp-date-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.mp-cell-meta {
    font-size: 10px;
    line-height: 1.25;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-cell-time {
    color: var(--mp-sunrise, #ff9800);
    font-weight: 600;
}

.mp-cell-tithi {
    color: #444;
    font-weight: 600;
}

.mp-cell-nakshatra {
    color: #666;
}

.mp-cell-badge {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mp-cell-empty-note {
    margin-top: auto;
    font-size: 10px;
    color: #8c8c8c;
}

.mp-detail-head {
    margin: 8px 0 10px;
    font-weight: 700;
    color: var(--mp-saffron, #b85e00);
}

.mp-extra-section {
    margin-top: 16px;
}

.mp-extra-section h4 {
    margin: 0 0 10px;
    color: var(--mp-saffron, #b85e00);
}

.mp-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mp-extra-card {
    background: #fff7ec;
    border: 1px solid #f0d8b4;
    border-radius: 10px;
    padding: 10px 12px;
}

.mp-extra-label {
    display: block;
    font-size: 12px;
    color: #7b5a2a;
    margin-bottom: 4px;
}

.mp-extra-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #36250e;
}

.mp-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.mp-open-full-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--mp-saffron, #ff8c00);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.mp-open-full-btn.alt {
    background: #fff3df;
    color: #8a4c00;
    border: 1px solid #efc27e;
}

@media (max-width: 640px) {
    .mp-cal-cell {
        min-height: 74px;
        gap: 2px;
    }

    .mp-cell-meta,
    .mp-cell-badge,
    .mp-cell-empty-note {
        font-size: 9px;
    }

    .mp-extra-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== v1.3.1 hindu-style month cell redesign ===== */
.mp-calendar-grid {
    background: #d9534f;
    gap: 1px;
}

.mp-cal-cell.mp-hindu-style {
    min-height: 136px;
    padding: 6px 6px 4px;
    border: none;
    background: #fff;
    position: relative;
    overflow: hidden;
    gap: 0;
}

.mp-cal-cell.mp-hindu-style::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(135deg, rgba(214,43,43,0.05) 0, rgba(214,43,43,0.05) 20%, transparent 20%, transparent 40%, rgba(214,43,43,0.04) 40%, rgba(214,43,43,0.04) 60%, transparent 60%, transparent 100%);
    pointer-events: none;
}

.mp-cal-cell.mp-hindu-style:hover {
    background: #fffdf8;
}

.mp-cal-cell.mp-hindu-style.mp-empty,
.mp-cal-cell.mp-hindu-style.mp-no-data {
    background: #efefef;
}

.mp-cal-cell.mp-hindu-style.mp-empty::before,
.mp-cal-cell.mp-hindu-style.mp-no-data::before {
    background: linear-gradient(135deg, rgba(0,0,0,0.03) 25%, transparent 25%, transparent 50%, rgba(0,0,0,0.03) 50%, rgba(0,0,0,0.03) 75%, transparent 75%, transparent);
    background-size: 16px 16px;
}

.mp-cal-cell.mp-hindu-style.mp-today {
    box-shadow: inset 0 0 0 3px #ff8a00;
}

.mp-cell-top,
.mp-big-date-wrap,
.mp-cell-mid,
.mp-cell-bottom {
    position: relative;
    z-index: 1;
}

.mp-cell-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    min-height: 16px;
    font-size: 10px;
    line-height: 1.15;
    color: #0f79d0;
    font-weight: 600;
}

.mp-cell-top-left,
.mp-cell-top-right {
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-big-date-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 58px;
    margin-top: 2px;
}

.mp-big-date {
    font-size: 58px;
    line-height: 0.95;
    font-weight: 800;
    color: #0c67c6;
    letter-spacing: -1px;
}

.mp-hindu-today {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 9px;
    background: #ff8a00;
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
}

.mp-cell-mid {
    min-height: 38px;
    margin-top: 2px;
}

.mp-mid-line,
.mp-mid-festival {
    font-size: 11px;
    line-height: 1.18;
    color: #111;
    font-weight: 600;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.mp-mid-line.muted {
    color: #616161;
    font-weight: 500;
}

.mp-mid-festival {
    color: #b40000;
}

.mp-cell-bottom {
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #d6eef9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: #0f79d0;
}

.mp-cal-cell.mp-hindu-style.mp-no-data .mp-big-date,
.mp-cal-cell.mp-hindu-style.mp-empty .mp-big-date {
    color: #a1a1a1;
}

@media (max-width: 640px) {
    .mp-cal-cell.mp-hindu-style {
        min-height: 92px;
        padding: 4px 4px 3px;
    }

    .mp-cell-top {
        font-size: 8px;
        min-height: 12px;
    }

    .mp-big-date-wrap {
        min-height: 40px;
    }

    .mp-big-date {
        font-size: 34px;
    }

    .mp-mid-line,
    .mp-mid-festival {
        font-size: 8px;
    }

    .mp-cell-bottom {
        font-size: 8px;
    }

    .mp-hindu-today {
        font-size: 7px;
        padding: 1px 3px;
    }
}


/* ===== v1.3.2 spacing + non-cutting top labels ===== */
.mp-cal-cell.mp-hindu-style {
    min-height: 124px;
    padding: 5px 6px 3px;
}

.mp-cell-top {
    min-height: 22px;
    font-size: 9px;
    line-height: 1.08;
    gap: 4px;
}

.mp-cell-top-left,
.mp-cell-top-right {
    max-width: 49%;
    white-space: normal;
    overflow: hidden;
    text-overflow: initial;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mp-big-date-wrap {
    min-height: 50px;
    margin-top: 0;
}

.mp-big-date {
    font-size: 54px;
    line-height: 0.9;
}

.mp-cell-mid {
    min-height: 24px;
    margin-top: 0;
}

.mp-mid-line,
.mp-mid-festival {
    font-size: 10px;
    line-height: 1.12;
}

.mp-cell-bottom {
    margin-top: 3px;
    padding-top: 2px;
    font-size: 9px;
}

@media (max-width: 640px) {
    .mp-cal-cell.mp-hindu-style {
        min-height: 84px;
        padding: 3px 3px 2px;
    }

    .mp-cell-top {
        min-height: 16px;
        font-size: 7px;
        gap: 2px;
    }

    .mp-big-date-wrap {
        min-height: 34px;
    }

    .mp-big-date {
        font-size: 30px;
    }

    .mp-cell-mid {
        min-height: 18px;
    }

    .mp-mid-line,
    .mp-mid-festival,
    .mp-cell-bottom {
        font-size: 7px;
    }
}


/* ===== v1.3.3 premium daily popup ===== */
.mp-modal {
    max-width: 820px;
    width: min(94vw, 820px);
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
}

.mp-modal-close {
    z-index: 5;
    top: 10px;
    right: 12px;
    background: rgba(255,255,255,0.85);
    border-radius: 999px;
    width: 34px;
    height: 34px;
}

.mp-day-card-pro {
    font-family: var(--mp-font, 'Mukta', serif);
    background: #fff;
    color: #1f1f1f;
}

.mp-day-hero {
    background: #ffd51a;
    padding: 22px 24px 18px;
    color: #111;
}

.mp-day-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.mp-day-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mp-day-om {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    color: #7a5200;
    background: rgba(255,255,255,0.35);
    border-radius: 12px;
}

.mp-day-brand h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
    font-weight: 800;
}

.mp-day-brand p {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.mp-day-city {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.mp-day-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    background: #02a896;
    color: #fff;
    padding: 10px 12px;
    gap: 8px;
}

.mp-strip-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "i l"
        "i v";
    column-gap: 7px;
    align-items: center;
    min-width: 0;
}

.mp-strip-icon {
    grid-area: i;
    font-size: 27px;
    line-height: 1;
    color: #ffe45f;
}

.mp-strip-item span:not(.mp-strip-icon) {
    grid-area: l;
    font-size: 11px;
    line-height: 1.05;
    opacity: 0.95;
}

.mp-strip-item strong {
    grid-area: v;
    font-size: 14px;
    line-height: 1.05;
    font-weight: 800;
}

.mp-samvat-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 16px 24px 10px;
    border-bottom: 1px solid #e2e2e2;
}

.mp-samvat-box div {
    padding: 4px 12px 7px 0;
}

.mp-samvat-box strong {
    display: inline-block;
    min-width: 110px;
    color: #333;
    font-weight: 800;
}

.mp-samvat-box span {
    color: #333;
}

.mp-pro-section {
    padding: 12px 24px;
    border-bottom: 1px solid #e2e2e2;
}

.mp-pro-section h3 {
    margin: 0 0 8px;
    font-size: 19px;
    color: #303030;
    font-weight: 800;
}

.mp-pro-list {
    display: grid;
    gap: 8px;
}

.mp-pro-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.mp-pro-row strong {
    display: block;
    font-size: 15px;
    line-height: 1.3;
}

.mp-pro-row small {
    display: block;
    color: #444;
    margin-top: 2px;
    font-size: 13px;
}

.mp-moon-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-block;
    background: linear-gradient(90deg, #111 0 50%, #fff 50% 100%);
    border: 1px solid #222;
    flex: 0 0 auto;
}

.mp-star-dot {
    width: 22px;
    height: 22px;
    color: #006eba;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    flex: 0 0 auto;
}

.mp-pro-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 24px;
    border-bottom: 1px solid #e2e2e2;
}

.mp-pro-grid .mp-detail-row {
    display: block;
    background: #fff8e8;
    border: 1px solid #f0d58f;
    border-radius: 10px;
    padding: 9px 10px;
}

.mp-pro-grid .mp-detail-label {
    display: block;
    font-size: 12px;
    color: #755400;
    margin-bottom: 3px;
}

.mp-pro-grid .mp-detail-value {
    font-weight: 800;
    color: #242424;
}

.mp-pro-festival {
    margin: 14px 24px 0;
}

.mp-pro-actions {
    padding: 16px 24px 22px;
    margin-top: 0;
}

@media (max-width: 760px) {
    .mp-day-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mp-day-hero-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .mp-day-city {
        white-space: normal;
    }

    .mp-samvat-box {
        grid-template-columns: 1fr;
    }

    .mp-pro-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== v1.3.4 popup colors from plugin settings + centered title ===== */
.mp-day-hero {
    background: var(--mp-header-text, #ffd51a);
    color: var(--mp-header-bg, #111);
}

.mp-day-hero-top {
    position: relative;
    min-height: 44px;
    justify-content: center;
}

.mp-day-brand {
    color: var(--mp-header-bg, #111);
}

.mp-day-brand-centered {
    text-align: center;
    width: 100%;
    justify-content: center;
}

.mp-day-brand-centered h2 {
    text-align: center;
}

.mp-day-brand-centered p {
    text-align: center;
}

.mp-day-city {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mp-header-bg, #111);
}

.mp-day-strip {
    background: var(--mp-header-bg, #02a896);
    color: var(--mp-header-text, #fff);
}

.mp-strip-icon {
    color: var(--mp-header-text, #ffe45f);
}

.mp-samvat-box {
    background: var(--mp-calendar-bg, #fff);
}

.mp-samvat-box strong,
.mp-samvat-box span,
.mp-pro-section h3,
.mp-pro-row strong,
.mp-pro-grid .mp-detail-value {
    color: var(--mp-header-bg, #333);
}

.mp-pro-grid .mp-detail-row {
    background: color-mix(in srgb, var(--mp-calendar-bg, #fff8e8) 92%, var(--mp-header-text, #ffd51a) 8%);
    border-color: color-mix(in srgb, var(--mp-header-text, #f0d58f) 65%, #c8a24b 35%);
}

.mp-pro-grid .mp-detail-label {
    color: color-mix(in srgb, var(--mp-header-bg, #755400) 72%, #8a6b18 28%);
}

.mp-moon-dot {
    border-color: var(--mp-header-bg, #222);
}

.mp-star-dot {
    color: var(--mp-sunrise, #006eba);
}

.mp-timing.shubh {
    border-left-color: var(--mp-shubh, #4caf50);
}

.mp-timing.ashubh {
    border-left-color: var(--mp-ashubh, #f44336);
}

.mp-open-full-btn {
    background: var(--mp-header-bg, #ff8c00);
    color: var(--mp-header-text, #fff);
}

.mp-open-full-btn.alt {
    background: color-mix(in srgb, var(--mp-calendar-bg, #fff3df) 85%, #ffffff 15%);
    color: var(--mp-header-bg, #8a4c00);
    border-color: color-mix(in srgb, var(--mp-header-text, #efc27e) 60%, #c9b079 40%);
}

@media (max-width: 760px) {
    .mp-day-hero-top {
        justify-content: center;
        align-items: center;
    }
    .mp-day-city {
        position: static;
        transform: none;
        margin-top: 6px;
        text-align: center;
    }
}


/* ===== v1.3.5 production polish ===== */
.mp-no-data-blank {
    display: none !important;
}

.mp-cal-cell.mp-hindu-style.mp-no-data .mp-cell-top,
.mp-cal-cell.mp-hindu-style.mp-no-data .mp-cell-mid,
.mp-cal-cell.mp-hindu-style.mp-no-data .mp-cell-bottom {
    opacity: 0.42;
}

.mp-cal-cell.mp-hindu-style.mp-no-data .mp-cell-top-left,
.mp-cal-cell.mp-hindu-style.mp-no-data .mp-cell-top-right {
    color: transparent;
}

.mp-cal-cell.mp-hindu-style.mp-no-data .mp-cell-bottom {
    visibility: hidden;
}

.mp-cal-cell.mp-hindu-style.mp-empty {
    pointer-events: none;
}

.mp-modal a,
.mp-panchang-wrap a {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.mp-open-full-btn:hover {
    filter: brightness(0.96);
    text-decoration: none;
}

.mp-cal-cell.mp-hindu-style:focus-visible {
    outline: 2px solid var(--mp-today, #ff6b00);
    outline-offset: -2px;
}


/* ===== v1.3.7 popup heading color wiring fix =====
   Correct mapping:
   - Popup heading background = Calendar Header Background setting
   - Popup heading text / "पंचांग" color = Calendar Header Text setting
*/
.mp-day-hero {
    background: var(--mp-header-bg, #8b0000) !important;
    color: var(--mp-header-text, #ffd700) !important;
}

.mp-day-brand,
.mp-day-brand h2,
.mp-day-brand p,
.mp-day-brand-centered h2,
.mp-day-brand-centered p,
.mp-day-city {
    color: var(--mp-header-text, #ffd700) !important;
}

.mp-day-strip {
    background: color-mix(in srgb, var(--mp-header-bg, #8b0000) 82%, #00a896 18%) !important;
    color: var(--mp-header-text, #ffffff) !important;
}

.mp-strip-icon {
    color: var(--mp-header-text, #ffd700) !important;
}

.mp-open-full-btn {
    background: var(--mp-header-bg, #8b0000) !important;
    color: var(--mp-header-text, #ffd700) !important;
}

.mp-open-full-btn.alt {
    background: var(--mp-calendar-bg, #fff8f0) !important;
    color: var(--mp-header-bg, #8b0000) !important;
    border-color: var(--mp-header-bg, #8b0000) !important;
}
