:root {
    --primary-color: #4a6bff;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --light-bg: #f9f9f9;
    --dark-text: #333;
    --light-text: #fff;
    --border-color: #e0e0e0;
    --transition-speed: 0.3s;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Loading Spinner */

.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(2px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 8px solid rgba(74, 107, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    border-right-color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    animation: spin 1.2s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 8px solid transparent;
    border-radius: 50%;
    border-top-color: rgba(74, 107, 255, 0.2);
    animation: spin 1.5s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

.loading-text {
    margin-top: 20px;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Container Styles */

.container-notice-board {
    max-width: 1200px;
    margin: 0px auto;
    background: white;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

.container-notice-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: #d5d6db;
}

/* Header Styles */

.head-notice-board {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
    animation: fadeInDown 0.8s ease-out;
}

.head-notice-board::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* Year Selector */

.year-selector {
    position: relative;
    margin: 20px 0;
    display: flex;
    justify-content: flex-end;
}

.year-selector input {
    padding: 10px 15px;
    font-size: 1rem;
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--secondary-color);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: center;
}

.year-selector input:hover {
    border-color: var(--accent-color);
}

li .notice-board-list {
    color: #d9534f;
    text-decoration: none;
}

li .notice-board-list:hover {
    color: #4a6bff;
}

.year-selector::after {
    content: "\1F4C5";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
    font-size: 0.8rem;
}

/* Table Container */

.table-container {
    gap: 20px;
}


/* Table Styles */

.notice-table {
    border-collapse: collapse;
    margin: 20px auto;
    font-size: 16px;
    font-family: poppins;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.scroll-box {
    height: 498px;
    /* box height controls when vertical scroll appears */
    overflow-y: auto;
    /* enable vertical scrolling */
    overflow-x: hidden;
    /* prevent horizontal scroll */
    padding: 1rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(20, 20, 40, 0.06);
    border: 1px solid rgba(20, 20, 40, 0.04);
    line-height: 1.6;
}


/* accessible focus style */

.scroll-box:focus {
    outline: 3px solid rgba(0, 120, 212, 0.15);
    outline-offset: 3px;
}


/* WebKit custom scrollbar */

.scroll-box::-webkit-scrollbar {
    width: 12px;
}

.scroll-box::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-box::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #9aa7bd);
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.6);
}


/* Firefox scrollbar */

.scroll-box {
    scrollbar-width: thin;
    scrollbar-color: #9aa7bd transparent;
}

.notice-table thead tr {
    background-color: #4972ed;
    color: #ffffff;
}

.notice-table th,
.notice-table td {
    font-size: 13px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    white-space: normal;
    /* allow wrapping */
    word-wrap: break-word;
    /* break long words if needed */
    word-break: break-word;
}

.notice-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
    /* alternate row color */
}

.notice-table tbody tr:hover {
    background-color: #dce6f7;
    /* hover effect */
}

.notice-table td:first-child {
    font-weight: bold;
}

.notice-table caption {
    caption-side: top;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #003366;
}

/* Calendar Styles */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999 !important;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s;
    position: relative;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.calendar-header button {
    background: #303ee0;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
}

.month-year-label {
    font-size: 16px;
}

.calendar-days-row,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day-name,
.calendar-day,
.empty-day {
    text-align: center;
    padding: 5px 0;
    border-radius: 5px;
}

.calendar-day {
    background: #f3f3f3;
    cursor: pointer;
}

.calendar-day:hover {
    background: #007bff;
    color: white;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s;
    position: relative;
}


/* Close button */

.close-calendar {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.close-calendar:hover {
    color: red;
}

.calendar-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.prevMonth-button,
.currentMonthYear,
.nextMonth-button {
    width: 33.3%;
}

.prevMonth-button {
    padding-left: 1.5rem;
}

.nextMonth-button {
    padding-right: 1.5rem;
}

#nextMonth {
    float: right
}

#currentMonthYear {
    margin: 0 !important;
    text-align: center;
}

.calendar-header button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-weekdays {
    display: contents;
    font-weight: bold;
    text-align: center;
}

.calendar-weekdays div {
    padding: 5px;
    text-align: center;
}

.calendar-days {
    display: contents;
}

.calendar-days div {
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
}

.calendar-days div:hover {
    background-color: var(--accent-color);
    color: white;
}

.calendar-days .current-day {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.calendar-days .other-month {
    color: #ccc;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* Updated Sidebar Styles */

.sidebar-years {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.8s ease-out 0.4s both;
    display: flex;
    gap: 20px;
}

.sidebar-years span {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    text-align: center;
}


/* Triangle Arrow Styles */

.triangle-up {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid white;
    margin: 0 auto;
}

.triangle-down {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid white;
    margin: 0 auto;
}


/* Updated Scroll Button Styles */

.scroll-up,
.scroll-down {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 5px;
    cursor: pointer;
    font-size: 0;
    transition: all var(--transition-speed) ease;
    border-radius: 4px;
    margin: 2px 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.scroll-up:hover,
.scroll-down:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.scroll-up:active,
.scroll-down:active {
    transform: scale(0.95);
}


/* Rest of your existing styles remain the same */

.scroll-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.years-list,
.months-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
    scroll-behavior: smooth;
}

.years-column,
.months-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#noticeTable td:nth-child(1) {
    /* width: 16%; */
}

#noticeTableBody td ul {
    margin: 0 !important;
    padding: 0 0 0 20px !important;
}


/* Animations */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Responsive Design */

@media (max-width: 992px) {
    .sidebar-years {
        display: block;
    }
    .container-notice-board {
        padding: 20px;
    }
    .head-notice-board {
        font-size: 1.8rem;
    }
    .notice-table th,
    .notice-table td {
        padding: 15px;
    }
    .year-selector::after {
        content: "\1F4C5";
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--primary-color);
        pointer-events: none;
        font-size: 0.8rem;
    }
    .modal-content {
        min-width: 100%;
        margin: 0 auto;
        width: 95% !important;
        top: 31%;
    }
}

@media (max-width: 768px) {
    .table-container {
        flex-direction: column;
    }
    .notice-table,
    .sidebar-years {
        width: 100%;
    }
    .container-notice-board {
        margin: 20px auto;
        padding: 15px;
    }
    .head-notice-board {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .notice-table {
        width: 100%;
        border-collapse: collapse;
    }

    /* scroll container */
    .scroll-box {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* .notice-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    } */
    .year-selector {
        justify-content: center;
        margin: 15px 0;
    }
    .years-list a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .head-notice-board {
        font-size: 1.3rem;
    }
    .notice-table th,
    .notice-table td {
        padding: 12px;
        font-size: 0.9rem;
    }
    .notice-table ul li {
        padding-left: 20px;
        font-size: 0.9rem;
    }
    .years-list {
        grid-template-columns: 1fr;
    }
    .years-list a {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}


/* Dark Mode Support */

@media (prefers-color-scheme: dark) {
     :root {
        --light-bg: #1a1a1a;
        --dark-text: #f0f0f0;
        --light-text: #f0f0f0;
        --border-color: #444;
        --secondary-color: #3a4a5d;
    }
    .container-notice-board,
    .sidebar-years {
        background-color: #2d2d2d;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    .loading-spinner {
        background: rgba(30, 30, 30, 0.8);
    }
}

/* Month Range Filter (Above Table) */
.month-range-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px auto;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    max-width: 95%;
}

.month-range-filter label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.month-range-filter input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    min-width: 140px;
}

.month-range-filter button {
    background: #4972ed;
    color: white;
    border: 2px solid #939aa3;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.month-range-filter button:hover {
    background: #2e58d2;
}

/* Year Horizontal (Below Table) */
.year-horizontal {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 25px auto;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    max-width: 95%;
    text-align: center;
}

.year-horizontal label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.year-list-horizontal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.year-list-horizontal a {
    text-decoration: none;
    color: #4972ed;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #4972ed;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.year-list-horizontal a.active,
.year-list-horizontal a:hover {
    background: #4972ed;
    color: white;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .month-range-filter {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .month-range-filter label {
        font-size: 13px;
    }

    .month-range-filter input[type="date"],
    .month-range-filter button {
        width: 100%;
    }

    .year-horizontal {
        flex-direction: column;
        gap: 8px;
    }

    .year-list-horizontal {
        gap: 6px;
    }

    .year-list-horizontal a {
        font-size: 13px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .month-range-filter input[type="date"] {
        font-size: 13px;
        min-width: 120px;
    }

    .month-range-filter button {
        font-size: 13px;
        padding: 7px 10px;
    }

    .year-horizontal label {
        font-size: 13px;
    }

    .year-list-horizontal a {
        font-size: 12px;
        padding: 5px 9px;
    }
}

/* Notice list arrow icon */
#noticeTableBody li {
    position: relative;
    list-style: none;
    padding-left: 26px;
}

/* Arrow icon */
#noticeTableBody li::before {
    content: "➜";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 18px;
    font-weight: bold;
    color: #d9534f;
    transition: all 0.3s ease;
}

/* Hover effect */
#noticeTableBody li:hover::before {
    animation: arrowBlink 0.8s infinite;
}

/* Blink + move animation */
@keyframes arrowBlink {
    0% {
        opacity: 0.3;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateX(6px);
    }
    100% {
        opacity: 0.3;
        transform: translateX(0);
    }
}

/* ================================
NOTICE BOARD RESPONSIVE UPGRADE
================================ */

/* container responsive */
.container-notice-board{
    width:100%;
    padding:25px;
}

/* filter responsive */
.month-range-filter{
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:10px;
}

/* input responsive */
.month-range-filter input{
    min-width:160px;
}

/* table responsive wrapper */
.scroll-box{
    width:100%;
    overflow-x:auto;
}

/* table improve */
.notice-table{
    width:100%;
    min-width:600px;
}

/* title list spacing */
.notice-table ul{
    margin:0;
    padding-left:18px;
}

/* notice link */
.notice-board-list{
    font-size:14px;
    line-height:1.5;
}

/* year buttons responsive */
.year-list-horizontal{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
}

/* year button style */
.year-list-horizontal button{
    padding:6px 14px;
    border-radius:6px;
    border:none;
    background:#303ee0;
    color:#fff;
    font-size:14px;
    cursor:pointer;
    transition:0.3s;
}

.year-list-horizontal button:hover{
    background:#4a6bff;
}

/* ================================
TABLET VIEW
================================ */

@media (max-width:992px){

.container-notice-board{
    padding:20px;
}

.notice-table th,
.notice-table td{
    padding:10px;
    font-size:13px;
}

.month-range-filter{
    justify-content:center;
}

}

/* ================================
MOBILE VIEW
================================ */

@media (max-width:768px){

.head-notice-board{
    font-size:1.5rem;
}

.month-range-filter{
    flex-direction:column;
    align-items:stretch;
}

.month-range-filter label{
    text-align:left;
}

.month-range-filter input,
.month-range-filter button{
    width:100%;
}

.notice-table{
    min-width:500px;
}

.year-horizontal{
    flex-direction:column;
}

.year-list-horizontal{
    justify-content:center;
}

.year-list-horizontal button{
    font-size:13px;
    padding:5px 10px;
}

}

/* ================================
SMALL MOBILE
================================ */

@media (max-width:480px){

.container-notice-board{
    padding:15px;
}

.notice-table th,
.notice-table td{
    font-size:12px;
}

.notice-board-list{
    font-size:13px;
}

.month-range-filter input{
    min-width:auto;
}

.year-list-horizontal button{
    font-size:12px;
    padding:5px 8px;
}

}

/* ================================
ULTRA SMALL MOBILE
================================ */

@media (max-width:360px){

.notice-table{
    min-width:450px;
}

.month-range-filter button{
    font-size:12px;
}

}

/* .notice-table td:first-child {
    white-space: nowrap;
} */

/* Fix date column wrap in responsive */

.notice-table th:first-child,
.notice-table td:first-child{
    white-space: nowrap;
}

/* ===============================
MODERN NOTICE TABLE DESIGN
=============================== */

/* table card style */

.notice-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
    box-shadow: none;
}

/* header */

.notice-table thead tr {
    background: linear-gradient(135deg,#4a6bff,#5b66e3);
    color: white;
}

.notice-table th{
    padding:16px;
    font-size:15px;
    letter-spacing:0.5px;
}

/* row card */

.notice-table tbody tr{
    background:white;
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
    transition:all .3s ease;
}

/* hover animation */

.notice-table tbody tr:hover{
    transform:translateY(-3px);
    box-shadow:0 8px 18px rgba(0,0,0,0.15);
    background:#f9fbff;
}

/* date column */

.notice-table td{
    font-weight:600;
    color:#2c3e50;
    text-align:center;
    white-space:nowrap;
    position:relative;
}

/* date badge */

.notice-table td::before{
    content:"";
    position:absolute;
    left:5px;
    top:50%;
    transform:translateY(-50%);
    width:4px;
    height:100%;
    background:linear-gradient(#4a6bff,#3498db);
    border-radius:4px;
}

/* title column */

.notice-table td:nth-child(2){
    font-size:14px;
}

/* notice list */

.notice-table ul{
    margin:0;
    padding-left:25px;
}

/* arrow animation */

#noticeTableBody li::before{
    content:"➜";
    position:absolute;
    left:0;
    top:2px;
    font-size:18px;
    color:#d9534f;
    transition:.3s;
}

/* hover arrow */

#noticeTableBody li:hover::before{
    transform:translateX(6px);
    color:#4a6bff;
}

/* link style */

.notice-board-list{
    text-decoration:none;
    font-weight:500;
    transition:.3s;
}

.notice-board-list:hover{
    color:#4a6bff;
}

/* ===============================
RESPONSIVE
=============================== */

@media(max-width:768px){

.notice-table{
    min-width:500px;
}

.notice-table th{
    font-size:14px;
}

.notice-table td{
    font-size:13px;
}

}

/* mobile */

@media(max-width:480px){

.notice-table th,
.notice-table td{
    padding:10px;
}

.notice-board-list{
    font-size:13px;
}

}

/* smooth fade animation */

.notice-table tbody tr{
    animation:fadeRow .4s ease;
}

@keyframes fadeRow{
    from{
        opacity:0;
        transform:translateY(6px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.notice-table td:nth-child(3){
    max-width:400px;
    word-break:break-word;
}