@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --accent-blue: #2563eb;
    --accent-light-blue: #dbeafe;
    --accent-gray: #f8fafc;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -5px rgba(37, 99, 235, 0.04);
}

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

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    width: 92%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- ส่วนหัวเว็บนวัตกรรมใหม่ (Premium Gradient Header) --- */
.site-header {
    background: var(--primary-gradient);
    color: white;
    padding: 50px 0;
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.15);
}

/* ลวดลายกราฟิกใน Header */
.site-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

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

.college-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.header-text h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.header-text h2 {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.9;
}

.admin-btn-top {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-btn-top:hover {
    background: white;
    color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- ระบบแท็บกรองข้อมูล (Filter Tabs) --- */
.tabs-container {
    margin: 30px 0;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

.tabs-container::-webkit-scrollbar {
    height: 6px;
}
.tabs-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.tab-pill {
    background: white;
    color: var(--text-muted);
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.25s ease;
}

.tab-pill:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.tab-pill.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* --- ตารางกริดและการ์ดแสดงผล (Modern Grid & Cards) --- */
.oit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 5px;
}

.oit-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.oit-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(37, 99, 235, 0.2);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.item-code-badge {
    background: var(--accent-blue);
    color: white;
    font-weight: 700;
    font-size: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.topic-badge {
    background: var(--accent-light-blue);
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}

.card-subject {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

/* เช็คลิสต์องค์ประกอบภายในตัวการ์ด */
.component-list {
    list-style: none;
    margin-bottom: 20px;
    flex-grow: 1;
}

.component-list li {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.check-icon {
    color: #10b981;
    font-weight: bold;
    font-size: 14px;
    background: #ecfdf5;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ส่วนของลิงก์ท้ายการ์ด */
.card-links-section {
    border-top: 1px dashed #e2e8f0;
    padding-top: 16px;
    margin-top: auto;
}

.links-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--accent-blue);
    color: white;
    padding: 11px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
    margin-bottom: 8px;
}

.download-btn:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.15);
}

.download-btn:last-child {
    margin-bottom: 0;
}

.empty-links-text {
    font-size: 13px;
    color: #10b981;
    background: #ecfdf5;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    font-weight: 500;
}

/* --- ฟุตเตอร์เว็บ (Footer) --- */
.site-footer {
    background: white;
    padding: 25px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    border-top: 1px solid #e2e8f0;
    margin-top: 60px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

/* --- สไตล์ของระบบแผงควบคุมหลังบ้าน Admin Panel --- */
.admin-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    margin-top: 30px;
}

.form-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-left: 5px solid var(--accent-blue);
    padding-left: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-sm);
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-submit {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #059669;
}

/* ตารางแสดงผลดั้งเดิมสำหรับหน้าแอดมินให้ดูดีมีสไตล์ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.admin-table th, .admin-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-right: 5px;
    transition: opacity 0.2s;
}

.btn-edit { background: var(--accent-blue); color: white; }
.btn-delete { background: #ef4444; color: white; }
.btn-action:hover { opacity: 0.9; }

/* Upload box area design */
.upload-zone {
    border: 2px dashed #cbd5e1;
    padding: 20px;
    border-radius: var(--border-radius-md);
    background: #f8fafc;
    text-align: center;
    margin-bottom: 15px;
}

/* --- Responsive สำหรับหน้าจอมือถือ (เหมือนรูปด้านขวาของคุณ) --- */
@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        text-align: center;
    }
    .header-left {
        flex-direction: column;
    }
    .site-header {
        padding: 30px 0;
    }
    .header-text h1 {
        font-size: 20px;
    }
    .oit-grid {
        grid-template-columns: 1fr;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
/* --- สไตล์กล่องอธิบาย OIT เพิ่มเติมด้านบนปุ่ม --- */
.oit-intro-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-top: 30px;
    margin-bottom: 5px;
}

.oit-intro-card h3 {
    font-size: 19px;
    color: #1e40af;
    margin-bottom: 12px;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.intro-desc {
    font-size: 14.5px;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 20px;
    text-indent: 30px;
    text-align: justify;
}

.indicators-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.indicator-group-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--border-radius-md);
    border-top: 4px solid var(--accent-blue);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

.indicator-group-box h4 {
    font-size: 15.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.indicator-group-box h5 {
    font-size: 13.5px;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.indicator-group-box ul {
    list-style: none;
    padding-left: 0;
}

.indicator-group-box ul li {
    font-size: 13.5px;
    color: #334155;
    margin-bottom: 8px;
    line-height: 1.5;
    position: relative;
    padding-left: 18px;
}

.indicator-group-box ul li::before {
    content: "🔹";
    position: absolute;
    left: 0;
    font-size: 11px;
    top: 2px;
}

.indicator-group-box ul li span {
    font-weight: 600;
    color: var(--accent-blue);
}

.intro-footer-text {
    font-size: 13.5px;
    background: #eff6ff;
    color: #1e40af;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid #3b82f6;
    font-weight: 400;
}

/* ปรับแต่งการแสดงผลบนสมาร์ทโฟน */
@media (max-width: 768px) {
    .indicators-summary-grid {
        grid-template-columns: 1fr;
    }
    .oit-intro-card {
        padding: 20px;
    }
}