/* หน้าปฏิทินการศึกษา (pages/calendar.php) — hero อยู่ใน page-hero.css */

/* Enhanced Calendar Tab Navigation */
#calTabs .nav-link {
    background: rgba(0,51,102,0.05);
    border: 2px solid transparent;
    color: #003366;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
#calTabs .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}
#calTabs .nav-link:hover::before {
    left: 100%;
}
#calTabs .nav-link:hover {
    background: rgba(0,51,102,0.1);
    border-color: rgba(0,51,102,0.2);
    transform: translateY(-2px);
}
#calTabs .nav-link.active {
    background: linear-gradient(135deg, #003366 0%, #001a33 100%);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(0,51,102,0.3);
}
#calTabs .nav-link.active::before {
    animation: shineEffect 2s infinite;
}
@keyframes shineEffect {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* --- Tab Count Badge --- */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,51,102,0.15);
    color: #003366;
    font-size: 0.7rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-left: 6px;
}
#calTabs .nav-link.active .tab-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* --- Enhanced Table Styles --- */
.cal-table {
    border-collapse: separate;
    border-spacing: 0;
    counter-reset: cal-row;
}
.cal-table thead {
    background: linear-gradient(135deg, #003366 0%, #001a33 100%) !important;
}
.cal-table thead th {
    color: #fff !important;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
    border-bottom: none !important;
    white-space: nowrap;
}
.cal-table thead th:first-child {
    border-radius: 12px 0 0 0;
}
.cal-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

/* Row numbering */
.cal-table tbody tr {
    counter-increment: cal-row;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.cal-table .cal-row-num::before {
    content: counter(cal-row);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
    color: #003366;
    font-weight: 700;
    font-size: 0.78rem;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Row hover */
.cal-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(0,51,102,0.03), rgba(244,180,26,0.06)) !important;
    transform: scale(1.005);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}
.cal-table tbody tr:hover .cal-row-num::before {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #003366;
}

/* Row stagger animation */
@keyframes rowSlideIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cal-table tbody tr {
    opacity: 0;
    animation: rowSlideIn 0.4s ease forwards;
}
.cal-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.cal-table tbody tr:nth-child(2) { animation-delay: 0.10s; }
.cal-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.cal-table tbody tr:nth-child(4) { animation-delay: 0.20s; }
.cal-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.cal-table tbody tr:nth-child(6) { animation-delay: 0.30s; }
.cal-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.cal-table tbody tr:nth-child(8) { animation-delay: 0.40s; }
.cal-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.cal-table tbody tr:nth-child(10) { animation-delay: 0.50s; }

/* Date badge */
.cal-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,51,102,0.06);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #555;
    white-space: nowrap;
}
.cal-date-badge i {
    color: #003366;
}

/* Enhanced Buttons */
.btn-cal-view {
    background: linear-gradient(135deg, #003366, #001a33);
    color: #fff !important;
    border: none;
    padding: 7px 18px;
    border-radius: 25px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,51,102,0.2);
}
.btn-cal-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,51,102,0.35);
    background: linear-gradient(135deg, #004080, #002855);
}
.btn-cal-download {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #003366 !important;
    border: none;
    padding: 7px 18px;
    border-radius: 25px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255,215,0,0.3);
}
.btn-cal-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,215,0,0.45);
    background: linear-gradient(135deg, #ffe033, #ffbb00);
}

/* Empty state */
.cal-empty-state {
    text-align: center;
    padding: 50px 20px !important;
    color: #aaa;
}
.cal-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
}

/* Card wrapper */
.cal-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
}
.cal-card:hover {
    box-shadow: 0 8px 35px rgba(0,0,0,0.1);
}

/* --- Mobile Responsive Card Layout --- */
@media (max-width: 768px) {
    .cal-table thead { display: none; }
    .cal-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid rgba(0,0,0,0.06);
        border-radius: 14px;
        margin-bottom: 14px;
        padding: 16px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    }
    .cal-table tbody tr:hover {
        transform: translateY(-2px) !important;
    }
    .cal-table td {
        display: block;
        text-align: left !important;
        padding: 4px 0 !important;
        border: none !important;
    }
    .cal-table td:first-child {
        font-size: 0.95rem;
        padding-bottom: 8px !important;
    }
    .cal-table td:last-child {
        padding-top: 10px !important;
    }
    .cal-table td:last-child .d-flex {
        justify-content: flex-start !important;
    }
    .cal-date-badge {
        font-size: 0.78rem;
        padding: 4px 10px;
    }
}
