@charset "UTF-8";


/* ==========================================
   1. FONTS & GLOBAL THEME
   ========================================== */
@font-face {
    font-family: 'Phayao Fakkham';
    src: url('fonts/PhayaoFakkham.ttf') format('truetype');
}

/* นำเข้าฟอนต์ Sarabun สำหรับความเป็นทางการ */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Sarabun', 'Phayao Fakkham', sans-serif !important;
    background-color: #f8fafc;
    color: #334155;
    margin: 0;
    padding: 0;
}

/* ==========================================
   2. SCROLLBAR CUSTOMIZATION (ปรับแต่งแถบเลื่อน)
   ========================================== */
::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}
::-webkit-scrollbar-track { 
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb { 
    background: #cbd5e1; 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: #94a3b8; 
}

/* ==========================================
   3. FRONT-END STYLES (สไตล์หน้าเว็บไซต์หลัก)
   ========================================== */
.school-header {
    background: linear-gradient(135deg, #0f172a 0%, #334155 60%, #000000 100%);
    border-bottom: 3px solid #475569;
}

.content-box {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.content-box:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.box-header {
    background: #ffffff;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
}
.box-header i { 
    margin-right: 10px; 
    color: #475569; 
    font-size: 1.1em; 
}

/* --- ระบบภาพสไลด์หน้าแรก (Hero Slider) --- */
.slider-container { 
    position: relative; 
    overflow: hidden; 
    border-radius: 1rem; 
}
.slider-wrapper { 
    display: flex; 
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
    height: 100%; 
}
.slide { 
    min-width: 100%; 
    position: relative; 
    height: 100%; 
}
.slide img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.nav-btn {
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8); 
    color: #1e293b;
    width: 40px; 
    height: 40px; 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer; 
    z-index: 10; 
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.nav-btn:hover { 
    background: white; 
    transform: translateY(-50%) scale(1.1); 
    color: #0f172a; 
}
.nav-prev { left: 15px; } 
.nav-next { right: 15px; }

.dots { 
    position: absolute; 
    bottom: 15px; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    gap: 8px; 
    z-index: 10; 
}
.dot { 
    width: 10px; 
    height: 10px; 
    background: rgba(255,255,255,0.4); 
    border-radius: 50%; 
    cursor: pointer; 
    transition: 0.3s; 
}
.dot.active { 
    background: white; 
    transform: scale(1.3); 
}

/* --- ตัววิ่งประกาศ (Marquee) --- */
.marquee-container { 
    overflow: hidden; 
    white-space: nowrap; 
    position: relative; 
    width: 100%; 
}
.marquee-content { 
    display: inline-block; 
    padding-left: 100%; 
    animation: marquee 25s linear infinite; 
}
@keyframes marquee { 
    0% { transform: translate(0, 0); } 
    100% { transform: translate(-100%, 0); } 
}

/* --- FullCalendar Custom --- */
.fc { 
    font-family: 'Sarabun', sans-serif; 
}
.fc-toolbar-title { 
    font-size: 1.1rem !important; 
    font-weight: 600; 
    color: #1e293b; 
}
.fc-button-primary { 
    background-color: #003366 !important; 
    border-color: #003366 !important; 
    text-transform: capitalize !important; 
}
.fc-button-primary:hover { 
    background-color: #1a5276 !important; 
}
.fc-daygrid-day-number { 
    color: #475569; 
    font-weight: 500; 
}
.fc-day-today { 
    background-color: #f1f5f9 !important; 
}

/* --- Utilities --- */
.cert-card { 
    transition: all 0.3s; 
} 
.cert-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
}
.grade-input:focus { 
    border-color: #1e293b; 
    box-shadow: 0 0 0 2px #1e293b; 
}
.result-box-animate { 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.result-box-animate.pop { 
    transform: scale(1.05); 
}

/* --- หน้า Login --- */
.login-card { 
    background: white; 
    border-radius: 1rem; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 400px; 
    overflow: hidden; 
}
.login-header { 
    background: linear-gradient(135deg, #003366 0%, #1a5276 60%, #d4af37 100%); 
    padding: 2rem; 
    text-align: center; 
    color: white; 
}
.btn-login { 
    background: linear-gradient(to right, #003366, #1a5276); 
    color: white; 
    width: 100%; 
    padding: 0.75rem; 
    border-radius: 0.5rem; 
    font-weight: bold; 
    transition: 0.3s; 
}
.btn-login:hover { 
    opacity: 0.9; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
}

/* ==========================================
   4. BACK-END STYLES (ระบบแอดมิน - ธีมราชการกรมท่า-ทอง)
   ========================================== */

/* --- แถบเมนูด้านข้าง (Sidebar) --- */
.sidebar {
    width: 260px; 
    background: #003366; 
    color: #e2e8f0; 
    position: fixed; 
    top: 0;
    left: 0;
    height: 100vh;
    transition: all 0.3s; 
    z-index: 50; 
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}
.sidebar .brand {
    height: 70px; 
    display: flex; 
    align-items: center; 
    padding: 0 20px;
    background: rgba(0,0,0,0.2); 
    color: white; 
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.menu-item {
    display: flex; 
    align-items: center; 
    padding: 12px 20px; 
    cursor: pointer; 
    transition: 0.2s;
    border-left: 4px solid transparent; 
    color: #bfdbfe; 
    font-weight: 500;
    text-decoration: none;
}
.menu-item:hover, .menu-item.active { 
    background: rgba(255,255,255,0.1); 
    color: #ffffff; 
    border-left-color: #d4af37; 
}
.menu-item i { 
    width: 30px; 
    text-align: center; 
    margin-right: 5px; 
    color: #d4af37; 
}
.menu-cat {
    padding: 15px 20px 5px; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    font-weight: bold; 
    color: #93c5fd; 
    letter-spacing: 0.5px;
}

/* --- แถบด้านบนและพื้นที่เนื้อหา --- */
.main-content { 
    margin-left: 260px; 
    padding: 30px; 
    min-height: 100vh; 
    transition: margin-left 0.3s; 
}
.top-bar {
    background: white; 
    padding: 15px 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
    border-bottom: 2px solid #e2e8f0;
}

.overlay { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.5); 
    z-index: 40; 
}

/* --- Admin Cards & Tables --- */
.card { 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    overflow: hidden; 
    margin-bottom: 20px; 
    border-top: 4px solid #003366; 
}
.card-header { 
    padding: 15px 20px; 
    border-bottom: 1px solid #e2e8f0; 
    background: #ffffff; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: bold; 
    color: #003366; 
    font-size: 1.1rem; 
}
.card-body { 
    padding: 20px; 
}

/* ตารางแสดงข้อมูลแบบราชการ */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}
.table-custom th { 
    background-color: #003366; 
    color: #ffffff; 
    font-weight: 500; 
    font-size: 0.95rem; 
    padding: 12px; 
    border-right: 1px solid #1a5276; 
    text-align: left;
}
.table-custom th.text-right {
    text-align: right;
}
.table-custom th.text-center {
    text-align: center;
}
.table-custom th:last-child { 
    border-right: none; 
}
.table-custom td { 
    padding: 12px; 
    border-bottom: 1px solid #e2e8f0; 
    vertical-align: middle; 
}
.table-custom tr:hover td { 
    background-color: #f8fafc; 
}
.table-custom tr:last-child td { 
    border-bottom: none; 
}

/* การ์ดสถิติ (Dashboard) */
.stat-card { 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    border-left: 5px solid #d4af37; 
}

/* --- Modal Styles --- */
.modal { display: none; } 
.modal.active { display: flex; }
.hidden { display: none; }
.fade-in { animation: fadeIn 0.3s; }
@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

/* --- Responsive Admin (มือถือ / แท็บเล็ต) --- */
@media (max-width: 768px) {
    .sidebar { left: -260px; } 
    .sidebar.active { left: 0; }
    .main-content { margin-left: 0; padding: 15px; } 
    .overlay.active { display: block; }
}
