/**
 * EduTask AHC - Stylesheet Kalender Interaktif
 * Desain modern, clean, minimalis, dan responsif.
 */

:root {
    --edutask-primary: #2563eb;
    --edutask-primary-hover: #1d4ed8;
    --edutask-bg-card: #ffffff;
    --edutask-border: #e2e8f0;
    --edutask-text-main: #0f172a;
    --edutask-text-muted: #64748b;
    --edutask-radius: 12px;
    --edutask-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

.edutask-calendar-wrapper {
    background: var(--edutask-bg-card);
    border: 1px solid var(--edutask-border);
    border-radius: var(--edutask-radius);
    padding: 24px;
    box-shadow: var(--edutask-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--edutask-text-main);
    max-width: 1000px;
    margin: 20px auto;
    box-sizing: border-box;
}

.edutask-calendar-wrapper * {
    box-sizing: border-box;
}

/* RESET STYLE BUTTON AGAR TIDAK TERCAMPUR STYLE THEME */
.edutask-calendar-wrapper button,
.edutask-modal button {
    all: unset;
    box-sizing: border-box !important;
}

/* HEADER KALENDER */
.edutask-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.edutask-cal-nav-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* TOMBOL NAVIGASI BULAN (PANAH KIRI & KANAN) */
.edutask-calendar-wrapper .edutask-btn-nav {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    line-height: 1 !important;
}

.edutask-calendar-wrapper .edutask-btn-nav:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
}

.edutask-calendar-wrapper .edutask-btn-nav svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
}

/* TOMBOL 'HARI INI' */
.edutask-calendar-wrapper .edutask-btn-today {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.edutask-calendar-wrapper .edutask-btn-today:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
}

/* JUDUL BULAN & TAHUN */
.edutask-cal-title-center {
    text-align: center;
}

.edutask-month-year {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

/* DROPDOWN PILIH TAHUN */
.edutask-calendar-wrapper .edutask-select-year {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.18s ease !important;
}

.edutask-calendar-wrapper .edutask-select-year:hover {
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* NAMA HARI */
.edutask-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--edutask-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--edutask-border);
}

.edutask-weekday.edutask-sunday {
    color: #ef4444;
}

/* GRID TANGGAL */
.edutask-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.edutask-day-cell {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    min-height: 90px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.edutask-day-cell:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.edutask-day-cell.is-other-month {
    background: #fafafa;
    opacity: 0.4;
    cursor: default;
}

.edutask-day-cell.is-today {
    border: 2px solid var(--edutask-primary);
    background: #eff6ff;
}

.edutask-day-cell.has-events {
    background: #ffffff;
    border-color: #e2e8f0;
}

.edutask-day-number {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.edutask-day-cell.is-today .edutask-day-number {
    color: var(--edutask-primary);
    font-weight: 800;
}

/* INDIKATOR BADGE / EVENT DI SEL TANGGAL */
.edutask-event-dots {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.edutask-event-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    color: #ffffff;
    line-height: 1.3;
}

/* LEGENDA STATUS */
.edutask-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--edutask-border);
    font-size: 12px;
    color: var(--edutask-text-muted);
}

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

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-event { background: #3b82f6; }
.dot-quiz  { background: #f59e0b; }
.dot-form  { background: #10b981; }
.dot-blog  { background: #a855f7; }

/* ============================================================
   MODAL POPUP DETAIL EVENT DI KALENDER
   ============================================================ */
.edutask-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.edutask-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.edutask-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    animation: edutaskPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes edutaskPopIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.edutask-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 22px;
    border-bottom: 1px solid var(--edutask-border);
}

.edutask-modal-subtitle {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--edutask-primary);
    letter-spacing: 0.05em;
}

.edutask-modal-date {
    margin: 4px 0 0 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

/* TOMBOL CLOSE MODAL (LINGKARAN BERSIH PRESISI) */
.edutask-modal .edutask-modal-close {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.edutask-modal .edutask-modal-close:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
    transform: scale(1.06) !important;
}

.edutask-modal .edutask-modal-close svg {
    display: block !important;
    width: 12px !important;
    height: 12px !important;
}

.edutask-modal-body {
    padding: 20px 22px;
}

/* LIST ITEM DALAM MODAL */
.edutask-modal-item {
    background: #f8fafc;
    border: 1px solid var(--edutask-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edutask-modal-item:last-child {
    margin-bottom: 0;
}

.modal-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
}

.item-time {
    font-size: 12px;
    color: var(--edutask-text-muted);
}

.modal-item-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.modal-item-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.modal-item-desc {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.modal-item-btn {
    align-self: flex-start;
    background: #1e293b !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.18s ease !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.modal-item-btn:hover {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15) !important;
}

/* ============================================================
   HALAMAN TUNGGAL EVENT (STANDALONE CARD) /edutask/nama-event/
   ============================================================ */
.edutask-event-standalone-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    max-width: 820px;
    margin: 30px auto;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
    box-sizing: border-box;
}

.edutask-event-standalone-card .event-card-img {
    width: 100%;
    height: 320px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid #f1f5f9;
}

.edutask-event-standalone-card .event-card-content {
    padding: 32px;
}

.edutask-event-standalone-card .event-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.edutask-event-standalone-card .event-single-title {
    margin: 0 0 12px 0;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.edutask-event-standalone-card .event-meta-bar {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.edutask-event-standalone-card .event-single-body {
    font-size: 15px;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 30px;
}

.edutask-event-standalone-card .event-single-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.edutask-btn-secondary {
    all: unset;
    box-sizing: border-box !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    padding: 8px 18px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.18s ease !important;
}

.edutask-btn-secondary:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
}

/* BREADCRUMB & TOMBOL PORTAL SISWA */
.edutask-portal-breadcrumb {
    font-size: 13px;
    font-weight: 500;
}

.edutask-portal-breadcrumb a {
    color: #64748b !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: color 0.18s ease !important;
}

.edutask-portal-breadcrumb a:hover {
    color: #1e293b !important;
    text-decoration: underline !important;
}

.edutask-btn-portal {
    background: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid #1e293b !important;
    padding: 10px 22px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.edutask-btn-portal:hover {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15) !important;
}

/* RESPONSIVE UNTUK LAYAR MOBILE */
@media (max-width: 640px) {
    .edutask-calendar-wrapper {
        padding: 14px;
    }

    .edutask-cal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .edutask-cal-nav-left {
        justify-content: space-between;
    }

    .edutask-day-cell {
        min-height: 60px;
        padding: 4px;
    }

    .edutask-day-number {
        font-size: 11px;
    }

    .edutask-event-pill {
        font-size: 8px;
        padding: 1px 3px;
    }
}
