/* ==========================================
🎨 ระบบรับสมัครนักเรียน - Pure CSS (Blue & Pink Theme)
โรงเรียนปิยะมหาราชาลัย
========================================== */

:root {
    /* สีประจำโรงเรียน (ฟ้า - ชมพู) นำมาปรับให้ดู Modern */
    --school-blue: #0284c7;
    /* ฟ้าอมน้ำเงิน */
    --school-blue-light: #e0f2fe;
    /* ฟ้าอ่อน */
    --school-pink: #db2777;
    /* ชมพูเข้ม */
    --school-pink-light: #fce7f3;
    /* ชมพูอ่อน */

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    --gradient-student: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    --gradient-teacher: linear-gradient(135deg, #db2777 0%, #f43f5e 100%);

    /* สีพื้นหลังและข้อความ */
    --bg-main: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;

    /* Glassmorphism & Shadows */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(2, 132, 199, 0.15);
}

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

body {
    font-family: 'Prompt', 'Sarabun', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 🔹 Background Elements (ลูกเล่นสีฟ้า-ชมพู พื้นหลัง) */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape-blue {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--school-blue-light) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    opacity: 0.6;
}

.shape-pink {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--school-pink-light) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    opacity: 0.6;
}

/* 🔹 CSS Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.5s;
}

/* 🔹 Hero / Header Section */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--school-blue) 0%, var(--school-pink) 100%);
    padding: 4rem 2rem;
    text-align: center;
    border-bottom: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    color: white;
}

.hero-logo {
    width: 130px;
    height: 130px;
    object-fit: contain;
    background: white;
    border-radius: 50%;
    padding: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.4s ease;
}

.hero-logo:hover {
    transform: scale(1.05);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* 🔹 Container Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 20px;
}

/* 🔹 Entry Portals (ช่องทางเข้าสู่ระบบ 2 ฝั่ง) */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 4rem;
}

.portal-card {
    background: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
    z-index: 1;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    z-index: 2;
}

.portal-student::before {
    background: var(--gradient-student);
}

.portal-teacher::before {
    background: var(--gradient-teacher);
}

.portal-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.portal-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: white;
    transition: transform 0.4s ease;
}

.portal-student .portal-icon {
    background: var(--gradient-student);
    box-shadow: 0 10px 20px rgba(2, 132, 199, 0.3);
}

.portal-teacher .portal-icon {
    background: var(--gradient-teacher);
    box-shadow: 0 10px 20px rgba(219, 39, 119, 0.3);
}

.portal-card:hover .portal-icon {
    transform: scale(1.1) rotate(5deg);
}

.portal-card h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.portal-features {
    list-style: none;
    text-align: left;
    margin-top: 1rem;
    width: 100%;
}

.portal-features li {
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

.portal-features li:last-child {
    border-bottom: none;
}

.portal-student .portal-features i {
    color: var(--school-blue);
}

.portal-teacher .portal-features i {
    color: var(--school-pink);
}

.portal-btn {
    margin-top: 2rem;
    padding: 12px 30px;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    width: 100%;
    display: inline-block;
    transition: filter 0.3s ease;
}

.portal-student .portal-btn {
    background: var(--gradient-student);
}

.portal-teacher .portal-btn {
    background: var(--gradient-teacher);
}

.portal-card:hover .portal-btn {
    filter: brightness(1.1);
}

/* 🔹 Content Sections (Cards) */
.section-card {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-soft);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 2.5rem;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--school-blue-light);
}

.section-header i {
    font-size: 2rem;
    color: var(--school-pink);
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    font-weight: 600;
}

/* 🔹 Beautiful CSS Tables (แทนที่ Timeline) */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ตกแต่ง Scrollbar เวลามีข้อมูลยาวบนมือถือ */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    background: white;
    min-width: 800px;
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.schedule-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #5a5c69;
    background-color: #f8f9fc;
    border-bottom: 2px solid #e3e6f0;
    letter-spacing: 0.5px;
}

.schedule-table td {
    padding: 15px;
    text-align: left;
    color: var(--text-dark);
    font-size: 0.95rem;
    border-bottom: 1px solid #e3e6f0;
}

.schedule-table tbody tr:hover {
    background-color: #fdfdfd;
}

/* ธีมสีชมพูสำหรับห้องเรียนพิเศษ */
.table-pink th {
    background: var(--gradient-teacher);
}

.table-pink td:first-child {
    background-color: var(--school-pink-light);
    font-weight: 600;
    color: var(--school-pink);
    text-align: left;
}

/* ธีมสีฟ้าสำหรับห้องเรียนปกติ */
.table-blue th {
    background: var(--gradient-student);
}

.table-blue td:first-child {
    background-color: var(--school-blue-light);
    font-weight: 600;
    color: var(--school-blue);
    text-align: left;
}

/* 🔹 Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-student);
}

.stat-card.pink-accent::before {
    background: var(--gradient-teacher);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--school-blue-light);
    margin-bottom: 10px;
    display: block;
}

.stat-card.pink-accent i {
    color: var(--school-pink-light);
}

.stat-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 5px;
}

/* 🔹 Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

footer a {
    color: var(--school-blue);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    color: var(--school-pink);
    text-decoration: underline;
}

/* 🔹 Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1.5rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .section-card {
        padding: 2rem 1.5rem;
    }

    .timeline::after {
        left: 30px;
    }

    .timeline-item {
        padding-left: 60px;
    }

    .timeline-item::after {
        left: 30px;
        width: 18px;
        height: 18px;
    }

    .portal-grid {
        gap: 20px;
    }
}