/* ========================================
   Islamic Dates Calendar — Stylesheet
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@300;400;500;600&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ---- Light Theme (default) ---- */
.idc-wrap.idc-light {
    --idc-bg: #faf8f4;
    --idc-card-bg: #ffffff;
    --idc-border: #e8e0d4;
    --idc-text: #2d2a26;
    --idc-text-muted: #7a7267;
    --idc-text-light: #a39d94;
    --idc-accent: #b8860b;
    --idc-accent-bg: rgba(184, 134, 11, 0.08);
    --idc-header-bg: rgba(184, 134, 11, 0.04);
    --idc-row-hover: rgba(184, 134, 11, 0.04);
    --idc-row-today: rgba(184, 134, 11, 0.07);
    --idc-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

/* ---- Dark Theme ---- */
.idc-wrap.idc-dark {
    --idc-bg: #0f1520;
    --idc-card-bg: rgba(255, 255, 255, 0.03);
    --idc-border: rgba(212, 175, 55, 0.12);
    --idc-text: #e8e0d4;
    --idc-text-muted: #8a9bb5;
    --idc-text-light: #5a6a7e;
    --idc-accent: #d4af37;
    --idc-accent-bg: rgba(212, 175, 55, 0.1);
    --idc-header-bg: rgba(212, 175, 55, 0.05);
    --idc-row-hover: rgba(212, 175, 55, 0.05);
    --idc-row-today: rgba(212, 175, 55, 0.08);
    --idc-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* ---- Container ---- */
.idc-wrap {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--idc-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--idc-border);
    box-shadow: var(--idc-shadow);
    max-width: 960px;
    margin: 24px auto;
    color: var(--idc-text);
    line-height: 1.5;
}

/* ---- Header ---- */
.idc-header {
    text-align: center;
    padding: 32px 24px 20px;
    background: var(--idc-header-bg);
    border-bottom: 1px solid var(--idc-border);
}

.idc-crescent {
    font-size: 36px;
    display: block;
    margin-bottom: 4px;
    color: var(--idc-accent);
}

.idc-title {
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--idc-accent);
    margin: 6px 0 8px;
    padding: 0;
}

.idc-subtitle {
    font-size: 13px;
    letter-spacing: 1.2px;
    color: var(--idc-text-muted);
    margin: 0;
    padding: 0;
}

/* ---- Filter Buttons ---- */
.idc-filters {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--idc-border);
}

.idc-filter-btn {
    padding: 5px 16px;
    border-radius: 20px;
    border: 1px solid var(--idc-border);
    background: transparent;
    color: var(--idc-text-muted);
    font-size: 12px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}

.idc-filter-btn:hover {
    border-color: var(--idc-accent);
    color: var(--idc-accent);
}

.idc-filter-btn.active {
    border-color: var(--idc-accent);
    background: var(--idc-accent-bg);
    color: var(--idc-accent);
}

/* ---- Table ---- */
.idc-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--idc-card-bg);
}

.idc-table thead th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--idc-text-light);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--idc-border);
    background: var(--idc-header-bg);
}

.idc-th-icon {
    width: 48px;
}

.idc-th-countdown {
    text-align: right !important;
}

/* ---- Table Rows ---- */
.idc-row {
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--idc-border);
}

.idc-row:last-child {
    border-bottom: none;
}

.idc-row:hover {
    background: var(--idc-row-hover);
}

.idc-row-today {
    background: var(--idc-row-today);
}

.idc-row td {
    padding: 14px 16px;
    vertical-align: middle;
}

/* ---- Icon ---- */
.idc-icon {
    font-size: 22px;
    text-align: center;
    width: 48px;
}

/* ---- Event Cell ---- */
.idc-event-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.idc-event-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--idc-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.idc-event-desc {
    font-size: 12px;
    color: var(--idc-text-muted);
}

/* ---- Category Badges ---- */
.idc-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 16px;
    vertical-align: middle;
}

.idc-cat-eid         { background: linear-gradient(135deg, #d4af37, #f5e6a3); color: #5a4a0a; }
.idc-cat-pillar      { background: linear-gradient(135deg, #1a6b4a, #2d9d6f); color: #fff;    }
.idc-cat-celebration { background: linear-gradient(135deg, #6b3fa0, #a67dd8); color: #fff;    }
.idc-cat-observance  { background: linear-gradient(135deg, #2d5f8a, #5b9bd5); color: #fff;    }
.idc-cat-miracle     { background: linear-gradient(135deg, #8b3a62, #d4739a); color: #fff;    }

/* ---- Date Columns ---- */
.idc-hijri,
.idc-greg {
    font-size: 13px;
    color: var(--idc-text-muted);
    white-space: nowrap;
}

/* ---- Countdown Badge ---- */
.idc-countdown {
    text-align: right;
}

.idc-countdown-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 8px;
}

.idc-today  { background: rgba(212, 175, 55, 0.15); color: #b8860b; }
.idc-soon   { background: rgba(45, 157, 111, 0.12); color: #1a6b4a; }
.idc-medium { background: rgba(91, 155, 213, 0.12); color: #2d5f8a; }
.idc-far    { background: rgba(138, 138, 138, 0.1);  color: #7a7a7a; }

/* Dark theme countdown overrides */
.idc-dark .idc-today  { color: #d4af37; }
.idc-dark .idc-soon   { color: #2d9d6f; }
.idc-dark .idc-medium { color: #5b9bd5; }
.idc-dark .idc-far    { color: #8a8a8a; }

/* ---- Footer ---- */
.idc-footer-note {
    font-size: 11px;
    color: var(--idc-text-light);
    text-align: center;
    padding: 14px 20px;
    margin: 0;
    border-top: 1px solid var(--idc-border);
}

/* ---- Empty State ---- */
.idc-empty {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--idc-text-muted);
}

/* ---- Row Animation ---- */
@keyframes idcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.idc-row {
    animation: idcFadeIn 0.35s ease both;
}

.idc-row:nth-child(1)  { animation-delay: 0.00s; }
.idc-row:nth-child(2)  { animation-delay: 0.04s; }
.idc-row:nth-child(3)  { animation-delay: 0.08s; }
.idc-row:nth-child(4)  { animation-delay: 0.12s; }
.idc-row:nth-child(5)  { animation-delay: 0.16s; }
.idc-row:nth-child(6)  { animation-delay: 0.20s; }
.idc-row:nth-child(7)  { animation-delay: 0.24s; }
.idc-row:nth-child(8)  { animation-delay: 0.28s; }
.idc-row:nth-child(9)  { animation-delay: 0.32s; }
.idc-row:nth-child(10) { animation-delay: 0.36s; }
.idc-row:nth-child(11) { animation-delay: 0.40s; }
.idc-row:nth-child(12) { animation-delay: 0.44s; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .idc-wrap {
        border-radius: 12px;
        margin: 16px 8px;
    }

    .idc-table thead {
        display: none;
    }

    .idc-row {
        display: flex;
        flex-wrap: wrap;
        padding: 14px 16px;
        gap: 4px;
        align-items: center;
    }

    .idc-row td {
        padding: 2px 4px;
        border: none;
    }

    .idc-icon {
        width: auto;
        font-size: 20px;
    }

    .idc-event-cell {
        flex: 1;
        min-width: 0;
    }

    .idc-hijri,
    .idc-greg {
        font-size: 12px;
        width: 50%;
    }

    .idc-countdown {
        width: 100%;
        text-align: left;
        margin-top: 4px;
    }

    .idc-title {
        font-size: 22px;
    }

    .idc-filters {
        gap: 6px;
        padding: 12px 16px;
    }

    .idc-filter-btn {
        font-size: 10px;
        padding: 4px 12px;
    }
}
