:root {
    --primary-color: #e63946;
    --light-pink: #FF8080;
    --lighter-pink: #FFE6E6;    
    --secondary-color: #1d3557;
    --very-light-gray: #f8f9fa;    
    --light-gray: #f1f1f1;
    --medium-gray: #ddd;
    --dark-gray: #333;
    --white: #fff;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@media (max-width: 767px){
    .mobile-hidden{
        display: none !important;
    }
}
@media (max-width: 768px){
    .tablet-hidden{
        display: none !important;
    }
}
@media (min-width: 768px){
    .desktop-hidden{
        display: none !important;
    }
}
@media (min-width: 769px){
  .desktop-hidden-exclude-tablet{
      display: none !important;
  }
}

.hidden{
    display: none !important;
}

.hideit{
    visibility: hidden;    
}

.horizontal-space.horizontal-space-10h{
height: 10px;
}
.horizontal-space.horizontal-space-20h{
height: 20px;
}
.horizontal-space.horizontal-space-30h{
height: 30px;
}
.horizontal-space.horizontal-space-40h{
height: 40px;
}
.horizontal-space.horizontal-space-50h{
height: 50px;
}
.horizontal-space.horizontal-space-70h{
height: 70px;
}
.horizontal-space.horizontal-space-100h{
height: 100px;
}

body {
    font-family: "Noto Sans SC","Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    height: 100%;
    margin: 0;
    padding: 0;
}
body.page-reader{
    overflow: hidden !important;
}

.container {
    margin: 0 auto;
    padding: 0 15px;
    max-width: 1280px;
}

@media (min-width: 1600px) {
    .container {
      max-width: 1440px;
    }
}

.home-date-label-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.home-date-label {
    margin-top: -20px;
    background-color: #ff4d4d;
    color: white;
    padding: 10px 30px;
    border-radius: 0 0 15px 15px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    top: -1px; /* Helps with alignment to header */
    z-index: 10;
    text-align: center;
}

header {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 80px;
    padding: 0 15px;
    border-bottom: 1px solid var(--light-pink);
    margin-bottom: 20px;
}

.logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.logo img {
    max-height: 50px;
    display: block;
}

.nav-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* Hamburger Menu */
.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    z-index: 10;
}


@media (max-width: 767px) {
    #redeemBtnHeader{
        display: none;
    }
    .logo img {
        max-height: 40px;
    }
}


/* .login-btn {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-btn {
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
} */

.subscribe-btn {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}
.subscribe-btn {
    background-color: var(--primary-color);
    color: var(--white);
}

.subscribe-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}
.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #00CB8D;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}
.user-info-container {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-info-link {
    text-decoration: none;
    color: inherit;
}
.user-info-link:hover .user-avatar {
    background-color: #00b37a;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    background-color: transparent;
    color: #FF0000;
    border: 1px solid #FF0000;
    border-radius: 14px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.redeem-btn {
    background-color: transparent;
    color: #FF0000;
    border: 1px solid #FF0000;
    border-radius: 14px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .user-name {
        max-width: 80px;
    }
    
    .logout-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Section Styles */
.news-section {
    margin-bottom: 40px;
    padding: 20px;    
    border-bottom: 1px solid var(--lighter-pink);
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
}

.section-title.student {
    margin-right: auto;
}

.publication-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Date Picker Styles */
.date-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}
.date-picker label {
    font-weight: normal;
}
.date-picker label.separator {
    color: #FF8080;
    font-weight: normal;
    margin: 0 2px;
}
.date-input {
    position: relative;
}
.date-input i.fa-calendar {
    color: var(--primary-color);
    margin-right: 5px;
    cursor: pointer;
}

.date-picker-input {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: normal;
    cursor: pointer;
    padding: 5px 0;
    width: 100px;
}
.date-picker-input:focus {
    outline: none;
}

select {
    padding: 8px 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    cursor: pointer;
}

.lunar-calendar {
    font-size: 14px;
    color: #666;
    text-align: right;
}

/* Slider Styles */
.slider-container {
    position: relative;
    margin: 0 -10px;
}

.slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 10px 0;
}

.slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.slider-btn {
    position: absolute;
    top: calc(50% - 21px);
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--white);
    border: 1px solid var(--medium-gray);
    color: var(--dark-gray);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1;
    box-shadow: var(--shadow);
}

.prev-btn {
    left: -5px;
}

.next-btn {
    right: -5px;
}

.slide {
    flex: 0 0 auto;
    width: calc(20% - 20px);
    margin: 0 10px;
    transition: transform 0.3s ease;
    align-self: flex-end;
}

.slide:hover {
    transform: translateY(-5px);
}

.slide-content {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid red;
}

.slide-img {
    width: 100%;
    /* aspect-ratio: 3/4; */
    object-fit: cover;
    display: block;
}

.slide-title {
    padding: 10px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading Spinner */
.slider-loader {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.confirm-modal.active {
    display: flex;
}
.confirm-modal-content {
    background-color: #fff;
    border-radius: 10px;
    max-width: 400px;
    width: 100%;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    text-align: center;
}
.confirm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.confirm-modal-header h2 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}
.close-confirm-modal { cursor: pointer; }
.confirm-modal-body p { margin-bottom: 15px; font-size: 16px; color: #333; }
.confirm-modal-body .small-text { font-size: 13px; color: #888; margin-top: 10px; }
.confirm-modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}
.modal-btn-secondary, .modal-btn-danger {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}
.modal-btn-secondary {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}
.modal-btn-danger {
    background-color: #dc3545;
    color: white;
}


/* Calendar Modal */
.calendar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2100 !important;
    justify-content: center;
    align-items: center;
}
.calendar-content {
    background-color: var(--white);
    border-radius: 8px;
    width: 300px;
    max-width: 90%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--medium-gray);
}
.calendar-date-selectors {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.calendar-year-select,
.calendar-month-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
}
.calendar-prev-month,
.calendar-next-month {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    color: var(--dark-gray);
}
.calendar-prev-month:hover,
.calendar-next-month:hover {
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}
.calendar-header button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--dark-gray);
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    padding: 10px 0;
    border-bottom: 1px solid var(--medium-gray);
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 5px;
    padding: 10px;
}
.calendar-day {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    margin: 2px auto;
}
.calendar-day:hover {
    background-color: var(--light-gray);
}
.calendar-day.active {
    background-color: var(--primary-color);
    color: var(--white);
}
.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.calendar-day.other-month {
    color: var(--medium-gray);
}
.calendar-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid var(--medium-gray);
}
.global-close-calendar,
.reader-close-calendar,
.close-calendar {
    padding: 5px 10px;
    background-color: var(--light-gray);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Go to Page Modal Styles */
.goto-page-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 3000;    
}

.goto-page-modal.active {
    display: flex;
}

.goto-page-content {
    background-color: #fff;
    border-radius: 10px;
    max-width: 350px;
    width: 100%;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 3001;    
}

.goto-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.goto-page-header h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.close-goto-page {
    cursor: pointer;
}

.goto-page-input-container {
    display: flex;
    margin-bottom: 15px;
}

.goto-page-input-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

#pageNumberInput {
    position: relative;
    z-index: 3002;
    width: 100%;
}

.goto-page-input-container .go-button {
    background-color: #EB3131;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    position: relative;
    z-index: 3002;    
}

.goto-page-info {
    font-size: 14px;
    color: #666;
    text-align: right;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .slide {
        width: calc(25% - 20px);
    }
}

@media (max-width: 768px) {

    .container {
        padding: 0;
    }
    .menu-button {
        padding-left: 0;
    }
    .slide {
        width: calc(33.33% - 20px);
    }
    
    .section-header {
        align-items: flex-start;
    }
    
    .section-title {
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .slide {
        width: calc(50% - 20px);
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 5px;
    }    
}

@media (max-width: 400px) {
    .slide {
        width: calc(100% - 20px);
    }
}


/* Mobile App Footer Styles */
.mobile-app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.footer-nav-right {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    margin: 0 auto;
    width: 100%;
}

/* Desktop specific styling for navigation */
@media (min-width: 768px) {
    .footer-nav-right {
        max-width: 500px;
        margin-left: auto;
        margin-right: 0;
        padding-right: 20px;
    }
}

.footer-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 0;
    color: #666;
    text-decoration: none;
    flex: 1;
    font-size: 12px;
    cursor: pointer;
}

.footer-nav-item.active {
    color: #FF0000;
}

.footer-nav-item.active img {
    filter: invert(14%) sepia(93%) saturate(6641%) hue-rotate(358deg) brightness(97%) contrast(114%);
}

.footer-nav-item img {
    margin-bottom: 4px;
}


/* --- Expanded Footer General Styles --- */
.footer-expandable {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease-in-out;
}
.footer-expandable.expanded {
    max-height: 300px;
}
.footer-expanded-content {
    padding: 20px;
}
.footer-link-item { /* Renamed for clarity */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}
.footer-link-item:hover span {
    text-decoration: underline;
}
.copyright-text {
    font-size: 11px;
    color: #666;
}
.page-login #loginButton{
    display: none !important;
}

/* --- Mobile Styles (Default) --- */
.desktop-footer {
    display: none; /* Hide desktop on mobile */
}
.mobile-footer {
    display: block; /* Show mobile by default */
}
.mobile-footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.footer-links-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.footer-copyright {
    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
    margin-top: 15px;
}

/* --- Desktop Styles (Media Query) --- */
@media (min-width: 1200px) { /* Using a wider breakpoint for this layout */
    .mobile-footer {
        display: none;
    }
    .footer-expanded-content {
        display: flex;
        justify-content: center;
    }
    .desktop-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        max-width: 1400px;
    }

    .desktop-footer-links-left,
    .desktop-footer-links-right {
        display: flex;
        gap: 30px;
        flex: 1; /* Take up equal space */
    }
    .desktop-footer-links-right {
        justify-content: flex-end;
        justify-content: center;
        flex-wrap: wrap;
    }

    .desktop-footer-center {
        display: flex;
        flex-direction: column; /* Stack logo and copyright vertically */
        align-items: center;
    }

    /* Hide the mobile copyright on desktop */
    .mobile-footer + .footer-copyright {
        display: none;
    }
}


/* Main content adjustment to prevent content from being hidden behind the footer */
body {
    padding-bottom: 70px; /* Adjust based on footer height */
}

/* Adjust for iOS devices to account for the safe area */
@supports (-webkit-touch-callout: none) {
    .mobile-app-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}