/* General Styles */
body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #F0F2F5; /* Light grey background for the whole page */
    color: #333;
    line-height: 1.7; /* Slightly increased for better readability */
}

.container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 20px; /* Adjusted horizontal padding */
}

/* Accessibility: Focus outlines for keyboard navigation */
a:focus,
button:focus,
input:focus {
    outline: 3px solid #FDC601; /* Yellow outline for focus */
    outline-offset: 2px; /* Adds space between the element and the outline */
}

/* Top Bar - Phone, Email, Search */
.top-bar {
    background-color: #313A46; /* Dark blue/grey */
    color: #FDC601; /* Vibrant yellow */
    padding: 8px 0;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar .contact-info span {
    margin-right: 20px;
    display: inline-flex;
    align-items: center;
}
.top-bar .contact-info i {
    margin-right: 5px;
}
.top-bar .search-box {
    display: flex;
    align-items: center;
}
.top-bar .search-box input {
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    outline: none;
    background-color: rgba(255, 255, 255, 0.8);
    width: 150px;
    transition: width 0.3s ease;
}
.top-bar .search-box input:focus {
    width: 200px;
}
.top-bar .search-box button {
    background: none;
    border: none;
    color: #FDC601;
    padding: 5px;
    cursor: pointer;
    margin-left: -30px; /* Overlay search icon */
}
/* Centered school name in top bar, as per image */
.top-bar .school-name-center {
    font-size: 1.1em;
    font-weight: 600;
    color: #FFF; /* White text for main school name */
    flex-grow: 1; /* Allows it to take available space */
    text-align: center;
}

/* Header / Main Banner Section */
header.main-banner {
    background-color: #FDC601; /* Vibrant yellow */
    padding: 20px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 350px; /* Adjust height to fit image */
    display: flex;
    align-items: flex-end; /* Align content to bottom as per image */
    justify-content: center;
}

header.main-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://placehold.co/1200x400/87CEEB/FFF?text=รูปภาพอาคารเรียนพร้อมนักเรียน') no-repeat center center; /* Placeholder background image */
    background-size: cover;
    filter: brightness(0.8) grayscale(0.2); /* Slightly darker and desaturated */
    z-index: 0;
}

header.main-banner .banner-overlay-content {
    position: relative;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay for text readability */
    color: #FFF;
    padding: 20px 40px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px; /* Space from bottom */
}

header.main-banner .banner-overlay-content h2 {
    margin: 0 0 10px;
    font-size: 2.5em;
    color: #FDC601; /* Yellow for heading */
}

header.main-banner .banner-overlay-content p {
    margin: 0;
    font-size: 1.2em;
    font-weight: 500;
}

/* Arrows for Carousel (if implemented) */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #FFF;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    z-index: 2;
    transition: background-color 0.3s ease;
}
.carousel-arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
}
.carousel-arrow.left {
    left: 15px;
}
.carousel-arrow.right {
    right: 15px;
}


/* Main Horizontal Navigation Bar */
.main-nav {
    background-color: #313A46; /* Dark blue/grey */
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
}
.main-nav ul li {
    margin: 0 15px;
}
.main-nav ul li a {
    color: #FDC601; /* Vibrant yellow */
    text-decoration: none;
    font-weight: 600; /* Sarabun SemiBold */
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease; /* Added transform */
    display: flex;
    align-items: center;
    gap: 8px;
}
.main-nav ul li a:hover,
.main-nav ul li a.active {
    background-color: #FDC601;
    color: #313A46;
    transform: translateY(-2px); /* Slight lift on hover */
}
.main-nav ul li a i {
    font-size: 1.1em;
}

/* Quick Service Cards */
.quick-services {
    background-color: #FFF;
    padding: 30px 0;
    margin-top: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    text-align: center;
}
.service-card {
    background-color: #EFEFEF; /* Light grey */
    padding: 20px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; /* Added box-shadow */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.service-card:hover {
    background-color: #FDC601; /* Vibrant yellow on hover */
    color: #313A46;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); /* More pronounced shadow on hover */
}
.service-card i {
    font-size: 3em;
    color: #313A46; /* Dark blue/grey icon */
    margin-bottom: 10px;
}
.service-card:hover i {
    color: #FFF; /* White icon on hover */
}
.service-card h4 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

/* Main Content Layout (3 Columns) */
.main-layout {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    align-items: stretch; /* Make columns stretch to same height */
}
.main-layout > div {
    background-color: #FFF;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column; /* Allows content within to stack vertically */
}

/* Left Column - Main Menu / Calendar */
.left-column {
    flex: 1; /* Approx 1/4 width */
    min-width: 250px;
}
.left-column h3, .middle-column h3, .right-column h3 {
    color: #313A46; /* Dark blue/grey heading */
    font-size: 1.8em;
    margin-bottom: 20px;
    border-left: 5px solid #FDC601; /* Yellow border accent */
    padding-left: 10px;
    font-weight: 700; /* Bold heading */
}
.left-column .side-menu ul {
    list-style: none;
    padding: 0;
}
.left-column .side-menu ul li {
    margin-bottom: 10px;
}
.left-column .side-menu ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.left-column .side-menu ul li a:hover,
.left-column .side-menu ul li a.active {
    background-color: #FDC601;
    color: #313A46;
}
.left-column .side-menu ul li a i {
    font-size: 1.2em;
}

.left-column .calendar-events {
    margin-top: 30px;
}
.left-column .calendar-events .event-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #EEE;
}
.left-column .calendar-events .event-item:last-child {
    border-bottom: none;
}
.left-column .calendar-events .event-date {
    background-color: #313A46; /* Dark blue/grey */
    color: #FDC601; /* Yellow */
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 15px;
    flex-shrink: 0;
}
.left-column .calendar-events .event-date span {
    display: block;
    font-size: 0.8em;
}
.left-column .calendar-events .event-info h4 {
    margin: 0 0 5px;
    font-size: 1.1em;
    color: #333;
}
.left-column .calendar-events .event-info p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}
.left-column .btn-view-all {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #FDC601;
    color: #313A46;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.left-column .btn-view-all:hover {
    background-color: #E0B800;
}


/* Middle Column - News/Announcements */
.middle-column {
    flex: 2; /* Takes 2 parts of available space, approx 1/2 width */
}
.middle-column .featured-news {
    margin-bottom: 25px;
    text-align: center;
}
.middle-column .featured-news img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.middle-column .featured-news h4 {
    font-size: 1.8em;
    color: #313A46;
    margin-bottom: 10px;
}
.middle-column .featured-news p {
    color: #666;
    font-size: 1em;
    margin-bottom: 15px;
}
.middle-column .featured-news .read-more-btn {
    display: inline-block;
    background-color: #313A46;
    color: #FDC601;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.middle-column .featured-news .read-more-btn:hover {
    background-color: #000;
}

.middle-column .news-list .news-item {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #EEE;
}
.middle-column .news-list .news-item:last-child {
    border-bottom: none;
}
.middle-column .news-list .news-item h5 {
    font-size: 1.2em;
    margin-bottom: 5px;
}
.middle-column .news-list .news-item p {
    font-size: 0.9em;
    color: #777;
}
.middle-column .news-list .news-item a {
    color: #FDC601;
    text-decoration: none;
    font-weight: 600;
}
.middle-column .news-list .news-item a:hover {
    text-decoration: underline;
}
/* AI Summary Button & Area */
.summarize-btn {
    background-color: #555; /* Darker grey for summarize button */
    color: #FFF;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    margin-top: 5px;
    transition: background-color 0.3s ease;
}
.summarize-btn:hover {
    background-color: #313A46;
}
.summary-area {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #FDC601;
    border-radius: 3px;
    font-size: 0.9em;
    color: #444;
    display: none; /* Hidden by default */
}
.summary-area .loading-message,
.summary-area .error-message {
    text-align: center;
    font-style: italic;
    color: #777;
}


/* Right Column - Executive & Stats */
.right-column {
    flex: 1; /* Takes 1 part of available space, approx 1/4 width */
    min-width: 250px;
}
.right-column .executive-profile {
    text-align: center;
    margin-bottom: 30px;
}
.right-column .executive-profile img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #FDC601;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.right-column .executive-profile h4 {
    margin: 0 0 5px;
    font-size: 1.4em;
    color: #313A46;
}
.right-column .executive-profile p {
    margin: 0;
    font-size: 0.95em;
    color: #666;
}

.right-column .visitor-stats {
    background-color: #F8F8F8; /* Lighter background for stats */
    padding: 20px;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05); /* Inner shadow */
}
.right-column .visitor-stats ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.right-column .visitor-stats ul li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #EEE;
}
.right-column .visitor-stats ul li:last-child {
    border-bottom: none;
}
.right-column .visitor-stats ul li strong {
    color: #313A46;
}

/* School's Pride Section */
.school-pride {
    background-color: #FFF;
    padding: 30px 0;
    margin-top: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.school-pride h3 {
    color: #313A46;
    font-size: 2em;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid #FDC601;
    display: inline-block; /* To make border-bottom only under text */
    padding-right: 15px;
    padding-left: 15px;
}
.pride-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.pride-card {
    background-color: #EFEFEF;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.3s ease;
}
.pride-card:hover {
    transform: translateY(-5px);
}
.pride-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease; /* Added for image hover effect */
}
.pride-card:hover img {
    transform: scale(1.03); /* Slightly zoom in on image */
    filter: brightness(1.05);
}
.pride-card .card-content {
    padding: 15px;
}
.pride-card h4 {
    font-size: 1.2em;
    color: #313A46;
    margin: 0 0 10px;
}
.pride-card p {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

/* Footer */
footer {
    background-color: #313A46; /* Dark blue/grey */
    color: #FDC601; /* Vibrant yellow */
    padding: 30px 0;
    margin-top: 30px;
    font-size: 0.9em;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}
footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
}
footer .footer-section h4 {
    font-size: 1.3em;
    color: #FDC601;
    margin-bottom: 10px; /* Reduced margin */
    border-bottom: 2px solid #FDC601;
    padding-bottom: 5px; /* Reduced padding */
}
footer .footer-section p, footer .footer-section ul {
    color: #CCC;
    list-style: none;
    padding: 0;
    margin: 0;
}
footer .footer-section ul li {
    margin-bottom: 5px; /* Reduced margin */
}
footer .footer-section ul li a {
    color: #CCC;
    text-decoration: none;
    transition: color 0.3s ease;
}
footer .footer-section ul li a:hover {
    color: #FDC601;
}
footer .social-icons a {
    color: #FDC601;
    font-size: 1.5em;
    margin-right: 10px;
    transition: color 0.3s ease;
}
footer .social-icons a:hover {
    color: #FFF;
}
footer .email-subscribe input[type="email"] {
    width: calc(100% - 20px);
    padding: 10px;
    border: none;
    border-radius: 5px;
    margin-bottom: 10px;
}
footer .email-subscribe button {
    background-color: #FDC601;
    color: #313A46;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
footer .email-subscribe button:hover {
    background-color: #E0B800;
}
footer .copyright {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #AAA;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .top-bar {
        flex-direction: column;
        text-align: center;
    }
    .top-bar .contact-info, .top-bar .search-box {
        margin-bottom: 10px;
    }
    .top-bar .school-name-center {
        display: none; /* Hide in mobile */
    }
    header.main-banner .banner-overlay-content {
        padding: 15px 20px;
    }
    header.main-banner .banner-overlay-content h2 {
        font-size: 2em;
    }
    header.main-banner .banner-overlay-content p {
        font-size: 1em;
    }
    .main-nav ul {
        justify-content: space-around;
    }
    .main-nav ul li {
        margin: 0 8px;
    }
    .service-grid, .main-layout, .pride-grid, .footer-grid {
        grid-template-columns: 1fr; /* Single column layout on tablets */
    }
    .main-layout {
        flex-direction: column;
    }
    .left-column, .middle-column, .right-column {
        min-width: unset;
        width: 100%;
    }
    .left-column .side-menu ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .left-column .side-menu ul li {
        margin-bottom: 0;
    }
    .left-column .side-menu ul li a {
        padding: 8px 12px;
        font-size: 1em;
    }
    /* New breakpoint for medium screens for font sizes */
    header.main-banner .banner-overlay-content h2 {
        font-size: 2.2em;
    }
    .left-column h3, .middle-column h3, .right-column h3 {
        font-size: 1.6em;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px; /* Adjust padding for smaller screens */
    }
    .top-bar .contact-info span {
        font-size: 0.8em;
    }
    .top-bar .search-box input {
        width: 100px;
    }
    header.main-banner {
        min-height: 250px;
    }
    header.main-banner .banner-overlay-content h2 {
        font-size: 1.8em;
    }
    header.main-banner .banner-overlay-content p {
        font-size: 0.9em;
    }
    .main-nav ul li a {
        flex-direction: column;
        gap: 3px;
        font-size: 0.85em;
        padding: 5px 8px;
    }
    .main-nav ul li a i {
        font-size: 1em;
    }
    .quick-services .service-card i {
        font-size: 2.5em;
    }
    .quick-services .service-card h4 {
        font-size: 1em;
    }
    .left-column .side-menu ul {
        flex-direction: column; /* Stack sidebar menu items vertically again */
        align-items: flex-start;
        gap: 5px;
    }
    .left-column .side-menu ul li a {
        width: 100%; /* Full width for stacked items */
        justify-content: flex-start;
    }
    .middle-column .featured-news img {
        height: 180px;
    }
    .middle-column .featured-news h4 {
        font-size: 1.5em;
    }
    .right-column .executive-profile img {
        width: 100px;
        height: 100px;
    }
    .right-column .executive-profile h4 {
        font-size: 1.2em;
    }
    .school-pride h3 {
        font-size: 1.5em;
    }
    .pride-card img {
        height: 150px;
    }
    footer .email-subscribe input[type="email"],
    footer .email-subscribe button {
        width: 100%;
        box-sizing: border-box; /* Include padding/border in width */
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}