/* Reset & Variables */
:root {
    --primary-blue: #0A2540;
    --secondary-blue: #1A5F7A;
    --light-blue: #D9E8F5;
    --gold: #D4AF37;
    --light-gold: #FBF5E6;
    --white: #FFFFFF;
    --gray-100: #F7F9FC;
    --gray-200: #E2E8F0;
    --text-main: #333333;
    --text-light: #666666;
    --font-family: 'Prompt', sans-serif;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--gray-100);
    background-image: radial-gradient(var(--gray-200) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* PLOs Section */
.plos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.plo-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--gold);
    display: flex;
    flex-direction: column;
}

.plo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.plo-num {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-weight: 700;
    text-wrap: balance;
}

.section-subtitle {
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--text-light);
    margin-bottom: 40px;
    text-wrap: balance;
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-primary-sm {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--gold);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    background-color: #B8962E;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-blue);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background-color: var(--gray-100);
    transform: translateY(-2px);
}

.btn-primary-sm {
    padding: 8px 20px;
    background-color: var(--gold);
    color: var(--white);
    font-size: 0.9rem;
}

/* Header */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logos {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.rin-logo {
    height: 60px;
    mix-blend-mode: multiply;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    font-weight: 500;
    color: var(--primary-blue);
    transition: color 0.3s ease;
}

.nav a:hover {
    color: var(--gold);
}

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 180px 0 100px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./Rin.jpg') center/cover no-repeat;
    opacity: 0.2;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.badge {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gold-badge {
    background-color: var(--gold);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.5);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-wrap: balance;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 800px;
    margin: 0 auto 40px;
    opacity: 0.9;
    text-wrap: balance;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* About Section */
.about-section {
    background-color: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.about-card {
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
}

.about-card i {
    font-size: 3rem;
    color: var(--secondary-blue);
    margin-bottom: 20px;
}

.about-card h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.highlights-section {
    background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.95)), url('./ข้อมูลอาจารย์ผู้รับผิดชอบหลักสูตร/สถานที่เรียน/นวดเท้า.jpg') center/cover fixed;
    position: relative;
}

.careers-section {
    background-color: var(--white);
    position: relative;
}

.study-plan-section {
    background: linear-gradient(rgba(10, 37, 64, 0.9), rgba(10, 37, 64, 0.95)), url('./ข้อมูลอาจารย์ผู้รับผิดชอบหลักสูตร/สถานที่เรียน/LINE_ALBUM_2026.8.14_260814_10.jpg') center/cover fixed;
    color: var(--white);
    position: relative;
}

.study-plan-section .section-title, .study-plan-section .section-subtitle {
    color: var(--white);
}

.study-plan-section .timeline-content {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.study-plan-section .timeline-content h3 {
    color: var(--gold);
}

/* Mascot Decorations */
.mascot-decoration {
    position: absolute;
    z-index: 0;
    opacity: 0.15;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.mascot-1 {
    width: 250px;
    bottom: -50px;
    right: -20px;
    transform: rotate(-10deg);
}

.mascot-2 {
    width: 200px;
    top: 50px;
    left: -50px;
    transform: rotate(15deg);
    opacity: 0.1;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.highlight-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-top: 4px solid var(--gold);
}

.hl-icon {
    width: 60px;
    height: 60px;
    background-color: var(--light-gold);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.hl-icon i {
    font-size: 1.5rem;
    color: var(--gold);
}

.highlight-card h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
}

/* Careers Section */
.careers-section {
    background-color: var(--white);
}

.careers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.career-card {
    background-color: var(--gray-100);
    padding: 30px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.career-card:hover {
    background-color: var(--light-blue);
    box-shadow: var(--shadow-lg);
}

.cr-icon {
    font-size: 2.5rem;
    color: var(--secondary-blue);
    margin-bottom: 15px;
}

.career-card h3 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    display: inline-block;
}

.career-card ul li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.career-card ul li i {
    color: var(--gold);
    margin-top: 4px;
}

/* Study Plan Timeline */
.study-plan-section {
    background-color: var(--gray-100);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 4px;
    background-color: var(--secondary-blue);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 0;
    width: 20px;
    height: 20px;
    background-color: var(--gold);
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
}

.timeline-content {
    background-color: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.timeline-content h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
}

/* Facilities Section */
.facilities-section {
    background-color: var(--white);
}

.gallery-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 20px; /* สำหรับ scrollbar */
    scrollbar-width: thin; /* สำหรับ Firefox */
}

/* ปรับแต่ง scrollbar สำหรับ Chrome, Safari, Edge */
.gallery-grid::-webkit-scrollbar {
    height: 8px;
}
.gallery-grid::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}
.gallery-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 4px;
}
.gallery-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; 
}

.gallery-item {
    flex: 0 0 calc(33.333% - 14px); /* แสดง 3 ภาพ (หัก gap 20px ออก) */
    scroll-snap-align: start;
    min-width: 280px; /* เผื่อในหน้าจอเล็กจะได้ไม่เล็กเกินไป */
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Faculty Section */
.faculty-section {
    background-color: var(--gray-100);
    text-align: center;
}

.faculty-main-img {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    background: var(--white);
    height: 400px;
}

.faculty-main-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease-in-out;
}

.faculty-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.faculty-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 220px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faculty-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.faculty-card .img-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background-color: var(--light-gold); /* สีทองอ่อนๆ */
    padding: 5px;
    border: 3px solid var(--gold);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.faculty-card img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    mix-blend-mode: multiply; /* ลบพื้นหลังสีขาวของภาพอาจารย์ */
}

.faculty-card h4 {
    color: var(--primary-blue);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

/* Modal Styling */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(10, 37, 64, 0.8); 
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; 
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: modalFadeIn 0.4s;
    text-align: left;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-30px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 25px;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-blue);
    text-decoration: none;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.modal-header img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--light-gold);
    border: 3px solid var(--gold);
    mix-blend-mode: multiply;
}

.modal-header h3 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.modal-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.modal-details h4 {
    color: var(--secondary-blue);
    margin: 20px 0 10px;
    font-size: 1.1rem;
}

.modal-details ul {
    list-style-type: disc;
    margin-left: 20px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.modal-details ul li {
    margin-bottom: 8px;
}

/* Contact Section */
.contact-section {
    background: url('./Rin.jpg') center/cover no-repeat;
    position: relative;
    color: var(--white);
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 37, 64, 0.9);
}

.contact-box {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-box h2 {
    color: var(--gold);
    margin-bottom: 30px;
    font-size: clamp(2rem, 5vw, 2.5rem);
    text-wrap: balance;
}

.contact-box p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.contact-box i {
    color: var(--gold);
    margin-right: 10px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

.social-links a {
    display: inline-block;
    padding: 10px 20px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 30px;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--gold);
}

/* Footer */
.footer {
    background-color: #06182C;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* Lightbox */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}
.lightbox-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}
@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}
.close-lightbox {
    color: white;
    position: absolute;
    top: 15px;
    right: 35px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 3001;
}
.prev-lightbox, .next-lightbox {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -25px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
}
.prev-lightbox {
    left: 10px;
    border-radius: 3px;
}
.next-lightbox {
    right: 10px;
    border-radius: 3px;
}
.prev-lightbox:hover, .next-lightbox:hover {
    background-color: rgba(0,0,0,0.8);
}
.lightbox-caption {
    text-align: center;
    color: white;
    padding: 10px;
    font-size: 1.2rem;
    position: absolute;
    bottom: 20px;
    width: 100%;
}
.gallery-item {
    cursor: pointer;
}

/* Floating Music Player */
.music-player {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
}

.music-btn {
    background: linear-gradient(135deg, var(--gold), #ffb84d);
    color: var(--primary-blue);
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.music-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.music-btn i {
    font-size: 1.2rem;
}

.music-waves {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 15px;
    margin-left: 5px;
}

.music-waves span {
    display: block;
    width: 3px;
    height: 3px;
    background-color: var(--primary-blue);
    border-radius: 3px;
    transition: height 0.1s ease;
}

/* Animation when playing */
.music-btn.playing .music-waves span {
    animation: bounce 1s infinite alternate;
}
.music-btn.playing .music-waves span:nth-child(2) {
    animation-delay: 0.3s;
}
.music-btn.playing .music-waves span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes bounce {
    0% { height: 3px; }
    100% { height: 15px; }
}

@media (max-width: 768px) {
    .music-player {
        bottom: 20px;
        left: 20px;
    }
    .music-text {
        display: none; /* ซ่อนข้อความในมือถือให้เหลือแค่ปุ่มเล็กๆ */
    }
    .music-btn {
        padding: 15px;
        border-radius: 50%;
        width: 55px;
        height: 55px;
        justify-content: center;
    }
    .music-waves {
        display: none;
    }
}


/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .hero-badges {
        flex-direction: column;
        align-items: center;
    }
    .faculty-main-img {
        height: 250px;
    }
}
