body {
    padding: 0;
    background-color: #f5f0e7;
}

.navbar {
    border-radius: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.main-container {
    max-width: 75rem; /* 1200px */
    margin: 1.25rem auto; /* 20px */
    padding: 0 1.25rem; /* 0 20px */
}

.admin-link {
    background-color: #ff9800;
    color: white;
    padding: 0.5rem 0.9375rem; /* 8px 15px */
    border-radius: 1.25rem; /* 20px */
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* 8px */
}

.admin-link:hover {
    background-color: #e68900;
    transform: translateY(-0.125rem); /* -2px */
    color: white;
}

.carousel .prev,
.carousel .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    font-size: 1rem; /* 16px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel .prev:hover,
.carousel .next:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.carousel .prev {
    left: 0.9375rem; /* 15px */
}

.carousel .next {
    right: 0.9375rem; /* 15px */
}

.popup-content a {
    color: #0056b3;
    text-decoration: underline;
}

.popup-content a:hover {
    color: #003d82;
}

.slide {
    cursor: pointer;
}

.carousel .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
    line-height: 1;
    width: 100%;
    /* === CHANGED THESE LINES === */
    height: 100% !important;            /* Make the image fill the container's height */
    object-fit: cover !important;       /* This is the magic property: fill and crop */
    object-position: center; /* Ensures the crop is centered */
}

.carousel-caption {
    position: absolute;
    right: 15%;
    bottom: 1.25rem; /* 20px */
    left: 15%;
    z-index: 10;
    padding-top: 1.25rem; /* 20px */
    padding-bottom: 1.25rem; /* 20px */
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0.625rem; /* 10px */
}


.news-and-announcements {
    align-items: stretch;
}

.new-box {
    display: flex;
    flex-direction: column;
}

.new-box .announcement-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.625rem; /* 10px */
    list-style: disc;
    padding-left: 1rem; /* 20px */
}

.countdown-container {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.9375rem; /* 8px 15px */
    border-radius: 0.5rem; /* 8px */
    text-align: center;
    color: white;
}

.countdown-topic {
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 0.25rem; /* 4px */
    color: #fff;
}

.countdown-timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3em;
    font-weight: bold;
    letter-spacing: 0.125rem; /* 2px */
    color: #fff;
}

.countdown-green {
    color: #a7ffaf;
}

.countdown-orange {
    color: #ffdd9e;
}

.countdown-yellow {
    color: #fff7a1;
}

.countdown-red {
    color: #ffb3b3;
}

.navbar {
  position: relative; /* allow absolute positioning */
}

.navbar-left,
.navbar-right {
    flex: 1;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.9375rem; /* 15px */
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9375rem; /* 15px */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.navbar-right {
    display: flex;
    justify-content: flex-end;
}

.announcement-popup {
    display: none;
}

.new-box .center-title {
    text-align: center;
}

.download-btn {
    color: white !important;
    text-decoration: none;
}

/* Styles for Task Popup - copied from index.php */
    .task-title {
        cursor: pointer;
    }
    .task-popup {
        display: none; position: fixed; z-index: 9998; left: 0; top: 0;
        width: 100%; height: 100%; background-color: rgba(0,0,0,0.6);
        justify-content: center; align-items: center;
    }
    .task-popup-content {
        background: white; padding: 25px 35px; border-radius: 10px; max-width: 700px;
        width: 90%; position: relative; max-height: 80vh; overflow-y: auto;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        animation: fadeIn 0.3s ease-out;
    }
    .task-popup-content h3 {
        text-align: center;
        font-size: 1.5em;
        color: #333;
        margin-top: 0;
        margin-bottom: 25px;
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
    }
    .close-task-popup {
        position: absolute; top: 10px; right: 20px;
        font-size: 30px; font-weight: bold; cursor: pointer;
    }
    .task-details-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
    }
    .task-details-table th, .task-details-table td {
        padding: 12px;
        border: 1px solid #ddd;
        text-align: left;
        vertical-align: top;
    }
    .task-details-table th {
        background-color: #f8f8f8;
        font-weight: bold;
        width: 30%;
    }
    .task-details-cell {
        max-height: 150px; /* Limit height */
        overflow-y: auto;  /* Add scrollbar if needed */
        display: block;      /* Make max-height work */
        white-space: pre-wrap; /* Respect line breaks */
        word-wrap: break-word; /* Break long words */
    }
    .tasks-list {
        list-style: disc;
        padding-left: 20px;
    }

/* --- NEW CALENDAR STYLES --- */
.calendar-box {
    background-color: white;
    padding: 1.875rem; /* 30px */
    border-radius: 0.625rem; /* 10px */
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1); /* 4px 16px */
    margin-top: 2.5rem; /* 40px */
    margin-bottom: 2.5rem; /* 40px */
}

.calendar-embed-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 75%;
}

.calendar-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

/* --- UNIQUE CAROUSEL STYLES --- */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.1); /* 8px 25px */
}

.carousel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    pointer-events: none;
}

.slide {
    display: none;
    transition: opacity 0.6s ease-in-out;
}

.slide.active {
    display: block;
}

.carousel .prev,
.carousel .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    font-size: 1rem; /* 16px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.carousel:hover .prev,
.carousel:hover .next {
    opacity: 1;
}

.carousel .prev {
    left: 0.9375rem; /* 15px */
    transform: translateY(-50%) scale(0.9);
}

.carousel .next {
    right: 0.9375rem; /* 15px */
    transform: translateY(-50%) scale(0.9);
}

.carousel:hover .prev,
.carousel:hover .next {
    transform: translateY(-50%) scale(1);
}

.dots {
    position: absolute;
    bottom: 1.25rem; /* 20px */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.625rem; /* 10px */
    z-index: 10;
}

.dot {
    height: 0.75rem; /* 12px */
    width: 0.75rem; /* 12px */
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.75rem; /* 12px */
    height: 0.75rem; /* 12px */
    border-radius: 50%;
    background-color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0.625rem rgba(255, 255, 255, 0); /* 10px */
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* --- STYLES FOR SVG ICONS --- */
.icon-circle svg {
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
}

.site-footer-custom {
    background-color: #f5f0e7;
    color: #000000;
    padding: 1.875rem 1.25rem; /* 30px 20px */
    font-family: Arial, sans-serif;
    border-top: 1px solid #e0e0e0;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    max-width: 62.5rem; /* 1000px */
    margin: 0 auto;
    flex-wrap: wrap;
}

.footer-left {
    display: flex;
    align-items: stretch;
    gap: 1.25rem; /* 20px */
    flex: 1;
}

.footer-logo {
    width: 15.625rem; /* 250px */
    height: 15.625rem; /* 250px */
    margin-right: 1.875rem; /* 30px */
}

.footer-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.footer-text h2 {
    margin: 0 0 0.3125rem 0; /* 5px */
    font-size: 2.2em;
    font-weight: bold;
    color: #0056b3;
    margin-bottom: 0.625rem; /* 10px */
}

.footer-text p {
    margin: 0;
    font-style: italic;
    font-size: 1.2em;
    color: #000000;
}

.footer-right {
    text-align: left;
    flex: 0 0 auto;
    justify-content: center;
    display: flex;
    flex-direction: column;
}

.footer-right h3 {
    margin: 0 0 0.625rem 0; /* 10px */
    font-size: 2.2em;
    font-weight: bold;
    color: #0056b3;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    margin-bottom: 0.625rem; /* 10px */
    font-size: 1.2em;
}

.contact-list li i {
    margin-right: 0.625rem; /* 10px */
    color: #000000;
    width: 1.25rem; /* 20px */
}

.contact-list a {
    color: #000000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-list a:hover {
    color: #0056b3;
}

/* === Notification Popup === */
.notification-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.notification-popup .popup-content {
  background: white;
  padding: 1.875rem; /* 30px */
  border-radius: 0.625rem; /* 10px */
  max-width: 37.5rem; /* 600px */
  box-sizing: border-box;
  width: 90%;
  position: relative;
  box-shadow: 0 0 1.5625rem rgba(0,0,0,0.4); /* 25px */
  animation: fadeIn 0.3s ease-out;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.625rem; /* 10px */
}

.notification-popup { display: none; }
.notification-popup.active { display: flex; }

/* Close button */
.close-btn {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
}

/* === Notification Buttons === */
#allow-btn, 
#deny-btn {
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all 0.2s ease-in-out;
}

/* Allow button (green) */
#allow-btn {
  background-color: #28a745; /* green */
  color: white;
}
#allow-btn:hover {
  background-color: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* Deny button (gray/red) */
#deny-btn {
  background-color: #dc3545; /* red */
  color: white;
}
#deny-btn:hover {
  background-color: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* --------------------------------------------------
   PULL TO REFRESH STYLES
-------------------------------------------------- */
#pullToRefresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.125rem; /* 50px -> 3.125rem */
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-3.125rem); /* 50px -> 3.125rem */
    transition: transform 0.3s;
    z-index: 9999;
}

#spinner {
    border: 0.25rem solid #f3f3f3; /* 4px -> 0.25rem */
    border-top: 0.25rem solid #3498db; /* 4px -> 0.25rem */
    border-radius: 50%;
    width: 1.5rem;  /* 24px -> 1.5rem */
    height: 1.5rem; /* 24px -> 1.5rem */
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --------------------------------------------------
   REFRESH BUTTON IN NAVBAR
-------------------------------------------------- */
#refreshBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem;        /* size of button */
    height: 2.5rem;
    margin-left: 1rem;    /* space between logo and button */
    background-color: white;  
    border-radius: 1.5rem; /* slightly rounded */
    cursor: pointer;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.2); 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#refreshBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 0.375rem 0.625rem rgba(0,0,0,0.3);
}

#refreshIcon {
    font-size: 1.5rem;  /* arrow size */
    color: #3498db;
    transition: transform 0.3s ease;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================= */
/* == RESPONSIVE MEDIA QUERIES (INDEX PAGE) == */
/* ============================================= */
@media (max-width: 64rem) { /* 1024px */
    .main-content-wrapper {
        flex-direction: column;
    }

    .tasks-container,
    .carousel-container {
        width: 100%;
        max-width: 100%;
    }

    .carousel {
        aspect-ratio: 4 / 3; /* Was 16 / 10. This creates a portrait view. */
        height: auto;        /* Let aspect-ratio control the height */
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.875rem; /* 30px, Adds space between the logo/text and contact info */
    }

    .footer-left {
        flex-direction: column;
        align-items: center;
        gap: 1.25rem; /* 20px */
    }

    .footer-right {
        align-items: center;
    }

    .footer-logo {
        margin-right: 0; /* Removes the side margin */
    }
    .navbar {
        position: relative; /* allow absolute positioning */
        flex-wrap: wrap;                 /* Crucial: Allows items to wrap to a new line */
        justify-content: space-between;  /* Keeps left/right items at the ends */
        gap: 1rem;                       /* Adds nice spacing when items wrap */
        padding-left: 1.5rem;            /* Adds some padding on smaller screens */
        padding-right: 1.5rem;
    }

    /* Reset the rigid desktop layout */
    .navbar-left,
    .navbar-right {
        flex: 1 1 auto; /* Allows left and right to be flexible */
    }

    /* Force the countdown timer to a new, centered line */
    .navbar-center {
        position: relative; /* remove absolute on smaller screens */
        left: auto;
        transform: none;
        flex-basis: 100%;
        order: 2; /* keep it in the middle */
        justify-content: center;
    }

    /* Ensure the right-aligned items stay on the right */
    .navbar-right {
        justify-content: flex-end;
    }
}

@media (max-width: 48rem) { /* 768px */
    .main-container {
        margin: 0.9375rem auto; /* 15px */
        padding: 0 0.9375rem; /* 0 15px */
    }

    .carousel {
        aspect-ratio: 3 / 4; /* Was 16 / 10. This creates a portrait view. */
        height: auto;        /* Let aspect-ratio control the height */
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .footer-left {
        flex-direction: column;
        align-items: center;
        margin-bottom: 1.875rem; /* 30px */
    }

    .footer-right {
        text-align: center;
        align-items: center;
    }

    .footer-logo {
        margin: 0 auto 0.9375rem auto; /* 15px */
    }

    .footer-text {
        align-items: center;
    }
    /* On very small phones, center everything for a clean look */
    .navbar {
        position: relative; /* allow absolute positioning */
        flex-wrap: wrap;                 /* Crucial: Allows items to wrap to a new line */
        justify-content: space-between;  /* Keeps left/right items at the ends */
        gap: 1rem;                       /* Adds nice spacing when items wrap */
        padding-left: 1.5rem;            /* Adds some padding on smaller screens */
        padding-right: 1.5rem;
    }
    .navbar-left,
    .navbar-right {
        justify-content: center;
        flex-basis: 100%;
    }
    .navbar-left .logo {
        height: 6rem; /* 90px */
    }
        /* Force the countdown timer to a new, centered line */
    .navbar-center {
        position: relative; /* remove absolute on smaller screens */
        left: auto;
        transform: none;
        flex-basis: 100%;
        order: 2; /* keep it in the middle */
        justify-content: center;
    }
    .file-preview-content {
        width: 95%;           /* Allow the modal to use more of the screen width */
        height: 85vh;         /* Make the modal taller to use vertical space */
        padding: 0.5rem;      /* Reduce the internal padding on small screens */
    }

    .close-preview {
        top: 0.25rem;         /* Adjust position of the 'X' button */
        right: 0.75rem;
        font-size: 2.5rem;    /* Make the 'X' button bigger and easier to tap */
    }

    .task-details-table th,
    .task-details-table td {
        font-size: 1rem;
    }

    .announcement-title .rainbow-hover {
        font-size: 0.9rem !important; /* Add !important here */
    }
}