/* Gaya Kalendar Kompak */
.cal-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cal-nav-btn:active {
    background: var(--accent-gold);
    color: #000;
}
.hani-btn {
    border-radius: 20px;
    background: rgba(223, 178, 87, 0.08);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.cal-day-header {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-sub);
    padding: 4px 0;
    text-transform: uppercase;
}
.cal-cell1 {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    position: relative;
}
.cal-greg-num1 {
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}
.cal-hijri-num1 {
    font-size: 0.6rem;
    color: var(--accent-gold);
    font-weight: 500;
    margin-top: 1px;
}
.cal-blank {
    background: transparent;
    border: none;
}
.cal-today {
    border: 1px solid var(--accent-gold) !important;
    background: rgba(223, 178, 87, 0.08) !important;
}
/* Warna Khusus Mengikut Kategori Legend */
.cal-haram { background: rgba(16, 185, 129, 0.12) !important; border: 1px dashed #10b981 !important; }
.cal-raya { background: rgba(217, 70, 239, 0.15) !important; border: 1px solid #d946ef !important; }
.cal-awal { background: rgba(56, 189, 248, 0.15) !important; border: 1px solid #38bdf8 !important; }
.cal-maulid { background: rgba(234, 179, 8, 0.15) !important; border: 1px dashed #eab308 !important; }

/* Warna Legenda Khusus Ramadhan Al-Mubarak */
.cal-ramadhan {
    background: rgba(16, 185, 129, 0.22) !important;
    border: 1px solid #10b981 !important;
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.2);
}
.cal-ramadhan .cal-hijri-num {
    color: #34d399 !important; /* Hijau terang agar teks nombor Hijri menonjol */
}

/* Warna Istimewa Khas Nuzul Al-Quran (17 Ramadhan) */
.cal-nuzul {
    background: rgba(30, 64, 175, 0.35) !important;
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.cal-nuzul .cal-hijri-num {
    color: #60a5fa !important; /* Biru terang untuk menyerlahkan angka 17 Hijri */
    font-weight: 800;
}

/* Serlahan Sempadan Warna Khas untuk Dwi-Tarikh Aktif Global */
.cal-mq-active-day {
    border-top: 3px solid var(--accent-gold) !important;
    background: rgba(223, 178, 87, 0.05);
}

.cal-local-active-day {
    border-bottom: 3px solid #38bdf8 !important;
    background: rgba(56, 189, 248, 0.05);
}

/* Gabungan jika tarikh Umm Al-Qura dan Setempat jatuh pada hari Masihi yang sama */
.cal-mq-active-day.cal-local-active-day {
    border-top: 3px solid var(--accent-gold) !important;
    border-bottom: 3px solid #38bdf8 !important;
    background: rgba(255, 255, 255, 0.03);
}

/* Struktur Sel Kalendar Dwi-Tarikh Tersusun */
.cal-cell {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 48px; /* Ditambah tinggi untuk mengelakkan pertembungan teks */
    position: relative;
    box-sizing: border-box;
}

/* Tarikh Hijri: Posisi Kanan Atas, Font Lebih Jelas & Jelas */
.cal-hijri-num {
    font-size: 0.75rem; 
    font-weight: 700;
    color: var(--accent-gold);
    align-self: flex-end;
    line-height: 1;
}

/* Tarikh Masihi (Miladi): Posisi Kiri Bawah, Kecil & Malap */
.cal-greg-num {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-sub);
    align-self: flex-start;
    line-height: 1;
}

/* Kekalkan parameter warna dwi-serlahan sempadan aktif */
.cal-mq-active-day {
    border-top: 3px solid var(--accent-gold) !important;
    background: rgba(223, 178, 87, 0.06);
}

.cal-local-active-day {
    border-bottom: 3px solid #38bdf8 !important;
    background: rgba(56, 189, 248, 0.06);
}

.cal-mq-active-day.cal-local-active-day {
    border-top: 3px solid var(--accent-gold) !important;
    border-bottom: 3px solid #38bdf8 !important;
}
