/* ============================================
   Songkran Registration - Custom Styles
   คณะวิศวกรรมศาสตร์ มก.
   ============================================ */

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

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --secondary: #e74c3c;
    --accent-gold: #f39c12;
    --accent-green: #27ae60;
    --bg-gradient-start: #0f2027;
    --bg-gradient-mid: #203a43;
    --bg-gradient-end: #2c5364;
    --card-bg: rgba(255, 255, 255, 0.97);
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --water-blue: #3498db;
    --water-light: #85c1e9;
    --songkran-orange: #e67e22;
    --songkran-pink: #e84393;
    --songkran-yellow: #fdcb6e;
}

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

body {
    font-family: 'Sarabun', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    min-height: 100vh;
    color: var(--text-dark);
    position: relative;
    overflow-x: hidden;
}

/* Water Drops Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(232, 67, 147, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, rgba(253, 203, 110, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sarabun', sans-serif;
}

/* ============ HEADER ============ */
.header-banner {
    background: linear-gradient(135deg, #1a5276 0%, #2980b9 40%, #3498db 60%, #1abc9c 100%);
    padding: 2rem 0;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: floatBg 20s linear infinite;
}

@keyframes floatBg {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.header-banner h1 {
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.header-banner .subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    margin-top: 0.3rem;
    position: relative;
    z-index: 1;
}

.header-banner .emoji-row {
    font-size: 2rem;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

/* ============ NAVIGATION ============ */
.nav-tabs-custom {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    margin: 0 3px;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary);
    background: rgba(41, 128, 185, 0.08);
}

.nav-tabs-custom .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 3px 10px rgba(26, 82, 118, 0.3);
}

/* ============ CARDS ============ */
.main-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 2rem;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============ SEARCH ============ */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border: 2px solid #dfe6e9;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: 'Sarabun', sans-serif;
    transition: all 0.3s ease;
    background: #fff;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.15);
}

.search-box .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-box .btn-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
}

/* ============ RESULT CARDS ============ */
.staff-card {
    background: #fff;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.staff-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.15);
    transform: translateY(-2px);
}

.staff-card.registered {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #f0fff4, #fff);
}

.staff-card .staff-name {
    font-family: 'Sarabun', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
}

.staff-card .staff-dept {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.staff-card .staff-type {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 6px;
}

.type-teacher {
    background: #ebf5fb;
    color: #2980b9;
}

.type-support {
    background: #fef9e7;
    color: #f39c12;
}

.type-expert {
    background: #f4ecf7;
    color: #8e44ad;
}

.type-special {
    background: #eafaf1;
    color: #27ae60;
}

.badge-registered {
    background: var(--accent-green);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-not-attend {
    background: var(--secondary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ============ STATS ============ */
.stat-box {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
    border-left: 4px solid transparent;
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-box .stat-number {
    font-family: 'Sarabun', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-box.stat-total { border-left-color: var(--primary); }
.stat-box.stat-total .stat-number { color: var(--primary); }

.stat-box.stat-attend { border-left-color: var(--accent-green); }
.stat-box.stat-attend .stat-number { color: var(--accent-green); }

.stat-box.stat-not-attend { border-left-color: var(--secondary); }
.stat-box.stat-not-attend .stat-number { color: var(--secondary); }

.stat-box.stat-pending { border-left-color: var(--accent-gold); }
.stat-box.stat-pending .stat-number { color: var(--accent-gold); }

/* ============ REGISTER MODAL ============ */
.attend-option {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.attend-option:hover {
    transform: translateY(-3px);
}

.attend-option.option-yes:hover,
.attend-option.option-yes.selected {
    border-color: var(--accent-green);
    background: #eafaf1;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
}

.attend-option.option-no:hover,
.attend-option.option-no.selected {
    border-color: var(--secondary);
    background: #fdf2f2;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

.attend-option .option-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.attend-option .option-text {
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ============ BUTTONS ============ */
.btn-songkran {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 36px;
    font-family: 'Sarabun', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 82, 118, 0.3);
}

.btn-songkran:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 82, 118, 0.4);
    color: #fff;
}

.btn-songkran:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============ DATATABLE ============ */
.table-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    padding: 12px 15px;
    border: none;
    white-space: nowrap;
}

.table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.table tbody td {
    padding: 10px 15px;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(41, 128, 185, 0.03);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h5 {
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
}

/* ============ LOADING ============ */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading-spinner .spinner-border {
    color: var(--primary-light);
}

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .header-banner h1 {
        font-size: 1.5rem;
    }

    .main-card {
        padding: 1.2rem;
        margin-top: 1rem;
    }

    .nav-tabs-custom .nav-link {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .stat-box .stat-number {
        font-size: 1.6rem;
    }

    .attend-option {
        padding: 0.8rem;
    }

    .attend-option .option-icon {
        font-size: 1.8rem;
    }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.staff-card {
    animation: fadeInUp 0.4s ease forwards;
}

.staff-card:nth-child(2) { animation-delay: 0.05s; }
.staff-card:nth-child(3) { animation-delay: 0.1s; }
.staff-card:nth-child(4) { animation-delay: 0.15s; }
.staff-card:nth-child(5) { animation-delay: 0.2s; }

/* SweetAlert Custom */
.swal2-popup {
    font-family: 'Sarabun', sans-serif !important;
    border-radius: 16px !important;
}

.swal2-title {
    font-family: 'Sarabun', sans-serif !important;
}

/* DataTable Search */
.dataTables_filter input {
    border: 2px solid #dfe6e9 !important;
    border-radius: 25px !important;
    padding: 6px 16px !important;
    font-family: 'Sarabun', sans-serif !important;
}

.dataTables_filter input:focus {
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15) !important;
    outline: none !important;
}

/* ============================================================
   HOME PAGE
   ============================================================ */

/* Card without padding for full-bleed image */
.home-card {
    padding: 0 !important;
    overflow: hidden;
}

/* Hero Image */
.home-hero-image {
    position: relative;
    width: 100%;
    min-height: 350px;
    cursor: pointer;
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    transition: all 0.3s ease;
}

.home-hero-image:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.home-hero-image.drag-over {
    outline: 3px dashed var(--primary-light);
    outline-offset: -3px;
    box-shadow: 0 0 0 6px rgba(41, 128, 185, 0.15);
}

.home-hero-image img {
    width: 100%;
    display: block;
}

/* No image placeholder */
.no-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #636e72;
    gap: 6px;
}

.no-image-placeholder i {
    font-size: 3.5rem;
    color: #b2bec3;
}

.no-image-placeholder p {
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    margin: 0;
}

.no-image-placeholder small {
    font-size: 0.8rem;
    color: #b2bec3;
}

/* ============================================================
   SCHEDULE PAGE
   ============================================================ */

.section-title {
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    color: var(--primary);
}

.schedule-date-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 10px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 3px 12px rgba(26, 82, 118, 0.25);
}

.schedule-date-header i {
    font-size: 1.3rem;
}

.schedule-timeline {
    position: relative;
    padding-left: 0;
}

.schedule-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s ease;
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-item:hover {
    background: rgba(41, 128, 185, 0.04);
}

.schedule-time {
    flex-shrink: 0;
    width: 120px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
    padding-top: 4px;
    text-align: center;
    background: rgba(41, 128, 185, 0.06);
    border-radius: 8px;
    padding: 8px 10px;
}

.schedule-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}

.schedule-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--water-blue), var(--water-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
}

.schedule-detail {
    flex: 1;
}

.schedule-detail h6 {
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.schedule-detail p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.schedule-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef9e7;
    border-radius: 8px;
    border-left: 4px solid var(--accent-gold);
    color: #7d6608;
    font-size: 0.9rem;
}

.schedule-note i {
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.schedule-note1 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #E7FEEA;
    border-radius: 8px;
    border-left: 4px solid var(--accent-green);
    color: #087D21;
    font-size: 0.9rem;
}

.schedule-note1 i {
    font-size: 1.1rem;
    color: var(--accent-green);
}

/* ============ RESPONSIVE - HOME & SCHEDULE ============ */
@media (max-width: 768px) {
    .home-hero-image {
        min-height: 200px;
    }

    .schedule-item {
        flex-direction: column;
        gap: 8px;
    }

    .schedule-time {
        width: auto;
        align-self: flex-start;
    }

    .nav-tabs-custom .nav-link {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .nav-tabs-custom .nav-link i {
        display: block;
        font-size: 1.1rem;
        margin-bottom: 2px;
    }
}
