/* ============================================
   CSS CONSOLIDATED AND OPTIMIZED FOR RESPONSIVENESS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #1e6b52;
    --secondary-color: #2a9d8f;
    --accent-color: #e9c46a;
    --highlight-color: #f4a261;
    --light-color: #f8f9fa;
    --dark-color: #264653;
    --transition: all 0.4s ease;
}

body {
    color: #333;
    overflow-x: hidden;
    position: relative;
    background: #f5f5f5;
}

/* Fixed background image - REMOVED WHITE OVERLAY */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./img/front.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
    opacity: 0.8; /* Adjusted opacity for better visibility */
}

.container {
    display: flex;
    min-height: 100vh;
    transition: var(--transition);
    background: transparent !important; /* REMOVED WHITE BACKGROUND */
    position: relative;
    overflow-x: hidden;
}

/* ============================================
   PRELOADER STYLES
   ============================================ */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.preloader-content {
    text-align: center;
}

.preloader-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    animation: pulse 1.5s infinite;
}

.preloader-text {
    font-size: 20px;
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 15px;
}

.preloader-progress {
    width: 180px;
    height: 3px;
    background: rgba(236, 240, 241, 0.8);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    animation: loading 1.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ============================================
   LANGUAGE SWITCHER & LOGO
   ============================================ */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 120px;
    z-index: 1001;
    display: flex;
    background: white;
    border-radius: 30px;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Language toggle button - SMALLER SIZE */
.lang-btn {
    padding: 6px 12px; /* Reduced padding */
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
    z-index: 1000;
    font-size: 0.9rem; /* Smaller font */
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* TOP LOGO - MOVED TO CENTER ON MOBILE */
.top-logo {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    width: 70px;
    height: 70px;
    text-align: center;
}

.top-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   SCHOOL NAME IMAGE - UNDER THE LOGO
   ============================================ */
.school_name_image {
    position: absolute;
    top: 85px; /* Positioned under the logo */
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    transition: var(--transition);
    opacity: 1;
    visibility: visible;
    max-width: 800px;
    width: auto;
    text-align: center;
    margin: 0 !important;
    padding: 0;
}

.school_name_image.hidden {
    opacity: 0;
    visibility: hidden;
}

.school_name_image img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 70px;
    display: block;
    margin: 0 auto;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar {
    width: 280px;
    color: #000000;
    padding: 20px 0;
    position: fixed;
    height: 100%;
    transition: var(--transition);
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    background-image: url('./img/back2.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-style: groove;
    border-color: rgb(243, 239, 9);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar.mobile-hidden {
    transform: translateX(-100%);
}

.sidebar.mobile-visible {
    transform: translateX(0);
}

.sidebar-school-name {
    text-align: center;
    padding: 20px 15px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    border-bottom: 2px solid var(--accent-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Back Button */
.back-btn {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.back-btn i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Menu Container */
.menu-container {
    position: relative;
    height: calc(100% - 120px);
    overflow-y: auto;
}

/* Menu Styles */
.menu {
    list-style: none;
    padding: 0 15px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: none;
}

.menu.active {
    display: block;
}

.menu-item {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(216, 253, 2, 0.7);
    position: relative;
}

.menu-item.has-submenu a {
    padding-right: 50px;
}

.submenu-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 15px;
    color: #000000;
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
    font-weight: bold;
    position: relative;
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 1);
    border-left: 4px solid var(--accent-color);
    transform: translateX(5px);
}

.menu-item a:hover .submenu-icon {
    transform: translateY(-50%) translateX(5px);
}

.menu-item i {
    margin-right: 15px;
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
    color: black;
}

/* Sub-menu styling */
.sub-menu .menu-item {
    background: rgba(200, 235, 0, 0.7);
}

.sub-menu .menu-item a {
    padding-left: 30px;
}

.sub-menu .sub-menu .menu-item {
    background: rgba(180, 215, 0, 0.7);
}

.sub-menu .sub-menu .menu-item a {
    padding-left: 45px;
}

/* ============================================
   TOGGLE BUTTONS
   ============================================ */
.toggle-btn {
    position: fixed;
    left: 280px;
    top: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1002;
}

.toggle-btn:hover {
    transform: translateX(5px);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.toggle-btn2 {
    position: fixed;
    left: 0;
    top: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1002;
    display: none;
}

.toggle-btn2:hover {
    transform: translateX(5px);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: var(--transition);
    position: relative;
    width: calc(100% - 280px);
}

.main-content.expanded {
    margin-left: 0;
    width: 100%;
}

/* ============================================
   SLIDESHOW SECTION - REDUCED TEXT SIZE FOR MOBILE
   ============================================ */
.slideshow {
    height: 100vh;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.slide.active {
    opacity: 1;
}

/* Light overlay for slides */
.slide::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Lighter overlay */
    z-index: 1;
}

.slide-content {
    max-width: 800px;
    z-index: 2;
    position: relative;
    padding: 20px;
    background: transparent !important; /* REMOVED BACKGROUND */
    border-radius: 10px;
    margin-top: 50px; /* Moved down slightly */
}

/* Desktop slider text size */
.slide-title {
    font-size: 2.8rem; /* Desktop size */
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    color: white;
}

.slide-desc {
    font-size: 1.2rem; /* Desktop size */
    margin-bottom: 25px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--accent-color), var(--highlight-color));
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--highlight-color), var(--accent-color));
}

/* ============================================
   SECTION STYLES
   ============================================ */
.section {
    margin-bottom: 60px;
    padding: 80px 40px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.9); /* Slightly more opaque */
}

.section:nth-child(even) {
    background: rgba(240, 247, 244, 0.9);
}

.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50%;
    height: 4px;
    background: linear-gradient(to right, var(--accent-color), var(--highlight-color));
    border-radius: 2px;
}

.section p {
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 2;
}

.about-image {
    flex: 1;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.about-image:hover {
    transform: rotate(2deg) scale(1.03);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.feature-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-size: 1.5rem;
}

/* School Identity Images */
.main_logo {
    width: 60%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.flag {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ============================================
   MESSAGES SECTION
   ============================================ */
.messages .cultural-items {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}

.messages .cultural-item {
    flex: 1;
    min-width: 250px;
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.messages .cultural-icon img {
    width: 150px;
    height: 230px;
    object-fit: cover;
    margin-bottom: 15px;
    border-radius: 8px;
}

/* ============================================
   DAILY EVENTS SECTION - FIXED CALENDAR
   ============================================ */
.events-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.events-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2.2rem;
}

.events-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
}

.calendar {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.events-details {
    flex: 2;
    min-width: 300px;
}

/* Calendar Styles - FIXED TO SHOW DAYS */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    color: white;
}

.calendar-header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    transition: background 0.3s;
    min-width: 40px;
}

.calendar-header button:hover {
    background: rgba(255, 255, 255, 0.3);
}

#calendar-month-year {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
    color: white;
    text-align: center;
    flex-grow: 1;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calendar-table td {
    padding: 15px 5px;
    text-align: center;
    border: 1px solid #e1e1e1;
    cursor: pointer;
    height: 50px;
    vertical-align: middle;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.calendar-table td:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

.calendar-table td.current-day {
    background: var(--primary-color) !important;
    color: white !important;
    font-weight: bold;
    position: relative;
}

.calendar-table td.current-day::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
}

.calendar-table td.event-day {
    background: #ffeb3b;
    font-weight: bold;
    color: #333;
}

.calendar-table td:empty {
    background: #f9f9f9;
    cursor: default;
}

.calendar-table td:empty:hover {
    background: #f9f9f9;
    transform: none;
}

/* Clock Display */
.clock {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.clock h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.clock-display {
    font-size: 2.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Today's Events */
.special-functions {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.special-functions h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

#today-events {
    min-height: 150px;
}

.function-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.function-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.function-item h4 {
    color: var(--dark-color);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.function-item p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ============================================
   NEWS SECTION
   ============================================ */
.news-container {
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}

.news-slider {
    display: flex;
    width: max-content;
    animation: slide 40s linear infinite;
}

.news-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 280px;
    margin-right: 20px;
    text-align: center;
    flex: 0 0 auto;
}

.news-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ============================================
   ATTENDANCE SECTION
   ============================================ */
.attendance-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.attendance-category {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 350px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.count {
    font-size: 2em;
    font-weight: bold;
    color: #4CAF50;
}

/* ============================================
   ANTHEM PLAYER
   ============================================ */
.anthem-player audio {
    width: 100%;
    max-width: 300px;
}

.lyrics-toggle {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-content {
    display: flex;
    gap: 40px;
}

.contact-info {
    flex: 1;
}

.contact-form {
    flex: 1;
}

.contact-detail {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.contact-detail:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.contact-detail i {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-right: 20px;
    width: 40px;
    text-align: center;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 107, 82, 0.2);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: rgba(38, 70, 83, 0.95);
    color: white;
    padding: 60px 20px 30px;
    text-align: center;
    border-top: 5px solid var(--accent-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.social-links {
    margin: 30px 0;
}

.social-links a {
    display: inline-block;
    margin: 0 15px;
    color: white;
    font-size: 1.8rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-10px) scale(1.2);
}

.map {
    margin: 20px 0;
}

.map iframe {
    width: 100%;
    height: 200px;
    border: 0;
    border-radius: 10px;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIXES
   ============================================ */

/* Tablet and smaller desktop */
@media (max-width: 1024px) {
    .about-content, .contact-content {
        flex-direction: column;
        gap: 20px;
    }

    .about-image {
        max-width: 500px;
        margin: 0 auto;
    }

    .features {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .slideshow {
        height: 80vh;
    }

    .slide-title {
        font-size: 2.2rem; /* Slightly reduced for tablet */
    }

    .slide-desc {
        font-size: 0.8rem; /* Slightly reduced for tablet */
    }
    
    .events-container {
        flex-direction: column;
    }
    
    .calendar, .events-details {
        max-width: 100%;
    }
    
    .calendar-table td, .calendar-table th {
        padding: 12px 3px;
    }
}

/* Tablet and Mobile (768px and below) */
@media (max-width: 768px) {
    body {
        background: #f0f0f0;
    }
    
    .container {
        background: transparent;
        min-height: auto;
    }
    
    /* FIXED: Mobile navigation should open properly */
    .sidebar {
        width: 80%;
        max-width: 600px;
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sidebar.mobile-visible {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        z-index: 1;
    }

    .toggle-btn {
        display: none;
    }

    .toggle-btn2 {
        display: flex;
        left: 0;
        top: 10px;
        z-index: 1001;
    }

    .sidebar.mobile-visible + .toggle-btn2 {
        left: 80%;
    }

    /* Language switcher mobile - SMALLER AND POSITIONED TOP RIGHT */
    .language-switcher {
        position: fixed;
        top: 10px !important;
        right: 10px !important;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 5px;
        padding: 3px !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
        width: auto;
    }

    .lang-btn {
        padding: 4px 8px !important;
        font-size: 0.8rem !important;
        min-width: 50px;
    }

    /* TOP LOGO - CENTERED ON MOBILE */
    .top-logo {
        position: fixed;
        top: 5px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        padding: 3px !important;
        width: 55px !important;
        height: 55px !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    }

    .top-logo img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    /* School name image mobile - UNDER THE LOGO */
    .school_name_image {
        position: absolute;
        top: 65px !important; /* Positioned under logo */
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 85% !important;
        max-width: 320px !important;
        padding: 0 !important;
        z-index: 1000;
        margin: 0 !important;
        right: auto !important;
        bottom: auto !important;
    }

    .school_name_image img {
        width: 100% !important;
        height: auto !important;
        max-height: 55px !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    /* SLIDESHOW MOBILE - REDUCED TEXT SIZE */
    .slideshow {
        position: relative;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        height: 250px !important;
        margin-top: 0 !important;
    }

    .slide {
        min-height: 250px;
        top: 0;
    }

    /* LIGHTER OVERLAY FOR MOBILE */
    .slide::before {
        background: rgba(0, 0, 0, 0.15) !important;
    }

    .slide-content {
        padding: 15px 10px;
        background: transparent !important;
        border-radius: 8px;
        margin: 10px;
        margin-top: 40px !important; /* Moved down */
    }

    /* REDUCED SLIDER TEXT SIZE FOR MOBILE */
    .slide-title {
        font-size: 1.4rem !important; /* Significantly reduced for mobile */
        margin-bottom: 8px;
        text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
        line-height: 1.3;
    }

    .slide-desc {
        font-size: 0.9rem !important; /* Significantly reduced for mobile */
        margin-bottom: 10px;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
        line-height: 1.4;
    }

    .slide .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* Remove white background from main content on mobile */
    .main-content {
        background: transparent !important;
    }

    .section {
        background: rgba(255, 255, 255, 0.95);
        margin: 15px;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .section h2 {
        font-size: 2rem;
        text-align: center;
    }

    .section h2::after {
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
    }

    /* Features Section mobile */
    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 20px;
        margin: 0 10px;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .feature-card h3 {
        font-size: 1.3rem;
    }

    /* School Identity Images mobile */
    .main_logo {
        width: 80%;
        max-width: 200px;
    }

    .flag {
        width: 100%;
        max-width: 300px;
    }

    /* Messages Section mobile */
    .messages .cultural-items {
        flex-direction: column;
        gap: 20px;
    }

    .messages .cultural-item {
        min-width: 100%;
        padding: 20px 15px;
    }

    .messages .cultural-icon img {
        width: 120px;
        height: 180px;
    }

    /* Daily Events mobile */
    .events-section {
        padding: 20px 15px;
        margin: 20px 10px;
    }

    .events-title {
        font-size: 1.8rem;
    }

    .events-container {
        flex-direction: column;
        gap: 20px;
    }

    .calendar, .events-details {
        min-width: 100%;
    }
    
    /* Calendar mobile fixes */
    .calendar-table th, .calendar-table td {
        padding: 10px 2px !important;
        font-size: 0.9rem !important;
        height: 40px !important;
    }
    
    .calendar-header {
        padding: 8px 10px;
    }
    
    #calendar-month-year {
        font-size: 1.1rem;
    }
    
    .calendar-header button {
        padding: 3px 8px;
        font-size: 1.2rem;
        min-width: 35px;
    }
    
    .clock-display {
        font-size: 2rem !important;
    }
    
    .function-item {
        padding: 12px;
    }

    /* News and Notices mobile */
    .news-container {
        padding: 0 10px;
    }

    .news-item {
        width: 280px;
        margin-right: 15px;
        padding: 15px;
    }

    .news-item img {
        height: 120px;
    }

    .news-item h3 {
        font-size: 1.1rem;
    }

    .news-item p {
        font-size: 0.9rem;
    }

    /* Attendance Section mobile */
    .attendance-container {
        flex-direction: column;
        align-items: center;
    }

    .attendance-category {
        width: 100%;
        max-width: 400px;
        margin: 0 10px 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-item h4 {
        font-size: 0.8rem;
    }

    .count {
        font-size: 1.5rem;
    }

    /* Contact Section mobile */
    .contact-content {
        flex-direction: column;
        gap: 30px;
    }

    .contact-detail {
        padding: 15px;
        margin-bottom: 15px;
    }

    .contact-detail i {
        font-size: 1.5rem;
        margin-right: 15px;
    }

    /* Footer mobile */
    .footer-content {
        padding: 0 10px;
    }

    .map iframe {
        height: 180px;
    }

    .menu-item a {
        padding: 12px;
        font-size: 0.95rem;
    }

    .sidebar-school-name {
        font-size: 1.2rem;
        padding: 15px;
    }
    
    /* Mobile navigation improvements */
    .menu-container {
        height: calc(100% - 100px);
    }
    
    .back-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .submenu-icon {
        font-size: 1rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .language-switcher {
        top: 8px !important;
        right: 8px !important;
        padding: 2px !important;
    }

    .lang-btn {
        padding: 3px 6px !important;
        font-size: 0.75rem !important;
        min-width: 45px;
    }

    /* TOP LOGO - SMALLER ON MOBILE */
    .top-logo {
        width: 45px !important;
        height: 45px !important;
        top: 5px !important;
    }

    /* School name image - adjusted for smaller logo */
    .school_name_image {
        top: 55px !important;
        max-width: 280px !important;
    }

    .toggle-btn2 {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
        top: 8px;
    }

    /* Slideshow */
    .slideshow {
        height: 220px !important;
    }

    .slide-content {
        margin-top: 30px !important;
    }

    .slide-title {
        font-size: 1.3rem !important; /* Even smaller for very small screens */
    }

    .slide-desc {
        font-size: 0.85rem !important; /* Even smaller for very small screens */
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* Sections */
    .section {
        padding: 20px 10px;
        margin: 10px;
    }

    .section h2 {
        font-size: 1.8rem;
    }

    /* Features */
    .features {
        gap: 15px;
    }

    .feature-card {
        padding: 15px;
        margin: 0 5px;
    }

    .main_logo {
        width: 70%;
        max-width: 150px;
    }

    .flag {
        width: 90%;
        max-width: 250px;
    }

    /* Messages */
    .messages .cultural-icon img {
        width: 100px;
        height: 150px;
    }

    /* Events */
    .events-title {
        font-size: 1.6rem;
    }

    .calendar-table th, .calendar-table td {
        padding: 8px 1px !important;
        font-size: 0.85rem !important;
        height: 35px !important;
    }
    
    .clock-display {
        font-size: 1.8rem !important;
    }
    
    .calendar-header button {
        padding: 2px 6px;
        font-size: 1.1rem;
        min-width: 30px;
    }

    /* News */
    .news-item {
        width: 250px;
        padding: 12px;
    }

    .news-item img {
        height: 100px;
    }

    /* Attendance */
    .attendance-category {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-item {
        text-align: center;
    }

    .count {
        font-size: 1.3rem;
    }

    /* Footer */
    .map iframe {
        height: 150px;
    }

    .footer-content h3 {
        font-size: 1.2rem;
    }

    .footer-content p {
        font-size: 0.9rem;
    }

    .social-links a {
        font-size: 1.5rem;
        margin: 0 10px;
    }
}

/* Small Mobile (360px and below) */
@media (max-width: 360px) {
    .school_name_image {
        max-width: 250px !important;
        top: 50px !important;
    }

    .slide-title {
        font-size: 0.7rem !important; /* Minimum size */
    }

    .slide-desc {
        font-size: 0.6rem !important; /* Minimum size */
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .section h2 {
        font-size: 0.7rem;
    }

    .feature-card {
        padding: 12px;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    .main_logo {
        width: 60%;
        max-width: 120px;
    }

    .flag {
        width: 85%;
        max-width: 200px;
    }

    .messages .cultural-item {
        padding: 15px 10px;
    }

    .messages .cultural-icon img {
        width: 80px;
        height: 120px;
    }

    .events-section {
        padding: 15px 10px;
        margin: 15px 5px;
    }

    .events-title {
        font-size: 1.4rem;
    }
    
    .calendar-table th, .calendar-table td {
        font-size: 0.8rem !important;
        padding: 6px 1px !important;
    }

    .clock-display {
        font-size: 1.6rem !important;
    }

    .news-item {
        width: 220px;
        margin-right: 10px;
    }

    .attendance-category {
        padding: 12px;
    }

    .count {
        font-size: 1.2rem;
    }

    .map iframe {
        height: 120px;
    }

    .toggle-btn2 {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* Smooth transitions for interactive elements */
.feature-card,
.cultural-item,
.news-item,
.attendance-category,
.contact-detail,
.menu-item a,
.calendar-table td,
.function-item {
    transition: all 0.3s ease;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}