/* =======================================================
   Satit UP - Event Calendar Modern Design System
   ======================================================= */

:root {
    --satit-primary: #8B7AA8;
    --satit-primary-dark: #6A5C82;
    --satit-primary-deep: #3B2667;
    --satit-primary-light: #A698BC;
    --satit-accent: #FFB74D;
    --satit-accent-gold: #F59E0B;
    
    --surface-bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    
    --border-subtle: #E2E8F0;
    --border-accent: rgba(139, 122, 168, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-card: 0 4px 20px -2px rgba(139, 122, 168, 0.12), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 28px -4px rgba(106, 92, 130, 0.2), 0 4px 10px -2px rgba(0, 0, 0, 0.06);
    --shadow-modal: 0 25px 50px -12px rgba(59, 38, 103, 0.35);
}

body {
    font-family: 'Sarabun', 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--surface-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =======================================================
   DEPARTMENT SELECTOR TABS
   ======================================================= */
.dept-nav-wrapper {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 10px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.dept-tab-btn {
    border: none;
    background: transparent;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
}

.dept-tab-btn:hover {
    background: #F1F5F9;
    color: var(--satit-primary-deep);
    transform: translateY(-2px);
}

.dept-tab-btn.active {
    background: linear-gradient(135deg, #3B2667 0%, #6A5C82 50%, #8B7AA8 100%);
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(59, 38, 103, 0.35);
}

.dept-tab-btn .dept-icon {
    font-size: 1.1rem;
}

.dept-tab-btn.active .dept-icon {
    color: var(--satit-accent);
}

/* 4 Department Mini Calendar Cards */
.mini-dept-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-subtle);
    padding: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mini-dept-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.mini-dept-card.academic { border-top: 4px solid #7E22CE; }
.mini-dept-card.admin { border-top: 4px solid #0284C7; }
.mini-dept-card.student { border-top: 4px solid #059669; }
.mini-dept-card.policy { border-top: 4px solid #D97706; }

.mini-cal-container {
    font-size: 0.82rem;
    background: #FAFAFD;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #EEECF2;
    min-height: 220px;
}

.mini-cal-container .fc-toolbar {
    margin-bottom: 0.5rem !important;
}

.mini-cal-container .fc-toolbar h2 {
    font-size: 0.95rem !important;
    font-weight: 700;
    color: var(--satit-primary-deep);
}

.mini-cal-container .fc-button {
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
}

.mini-cal-container .fc-day-header {
    font-size: 0.7rem !important;
    padding: 4px 0 !important;
}

.mini-cal-container .fc-day-number {
    font-size: 0.75rem !important;
    padding: 2px 4px !important;
}

.mini-cal-container .fc-event {
    font-size: 0.7rem !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    margin-bottom: 2px !important;
}

.mini-event-chip {
    background: #FFFFFF;
    border-left: 3px solid var(--satit-primary);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    border-top: 1px solid #f1eff5;
    border-right: 1px solid #f1eff5;
    border-bottom: 1px solid #f1eff5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-event-chip:hover {
    background: #F8F5FC;
    transform: translateX(3px);
}

.badge-dept {
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.badge-dept-academic { background-color: #7E22CE; color: #fff; }
.badge-dept-admin { background-color: #0284C7; color: #fff; }
.badge-dept-student { background-color: #059669; color: #fff; }
.badge-dept-policy { background-color: #D97706; color: #fff; }

/* =======================================================
   HERO BANNER & CARDS
   ======================================================= */
.hero-banner {
    background: linear-gradient(135deg, #2B164D 0%, #4C2882 35%, #7E22CE 70%, #9333EA 100%);
    border-radius: var(--radius-lg);
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px -5px rgba(59, 38, 103, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.28) 0%, rgba(217, 119, 6, 0.1) 45%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 25%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-badge-pill {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #FDE047;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.hero-date-card {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    color: #FFFFFF;
    transition: transform 0.3s ease;
}

.hero-date-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
}

.admin-header-card {
    background: linear-gradient(135deg, #3B2667 0%, #543884 40%, #8B7AA8 100%);
    border-radius: var(--radius-lg);
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(59, 38, 103, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 183, 77, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.admin-header-card::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(166, 152, 188, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.admin-badge-pill {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
}

/* KPI Stat Cards */
.admin-stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.admin-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-accent);
}

.admin-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

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

.icon-purple { background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%); color: #7E22CE; }
.icon-emerald { background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%); color: #059669; }
.icon-amber { background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%); color: #D97706; }
.icon-blue { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); color: #2563EB; }

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
    font-feature-settings: "tnum";
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

/* =======================================================
   CONTAINERS & PANELS
   ======================================================= */
.card-custom, .admin-panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease-in-out;
}

.card-custom:hover, .admin-panel-card:hover {
    box-shadow: var(--shadow-hover);
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--satit-primary-deep);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Upcoming Events Sidebar */
.upcoming-event-item {
    padding: 14px 16px;
    border-radius: 12px;
    border-left: 4px solid var(--satit-primary);
    background: #fdfcff;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-top: 1px solid #f1eff5;
    border-right: 1px solid #f1eff5;
    border-bottom: 1px solid #f1eff5;
}

.upcoming-event-item:hover {
    background: #f5f0fb;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(139,122,168,0.18);
}

/* Category Filter Pills */
.filter-category-btn, .category-filter-btn {
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 14px;
    border: 1px solid var(--border-subtle);
    background: #FFFFFF;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-category-btn:hover, .category-filter-btn:hover {
    background: #F1F5F9;
    color: var(--satit-primary-dark);
}

.filter-category-btn.active, .category-filter-btn.active {
    background: var(--satit-primary);
    border-color: var(--satit-primary);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(139, 122, 168, 0.4);
}

/* =======================================================
   FULLCALENDAR THEME CUSTOMIZATION
   ======================================================= */
.fc {
    font-family: 'Sarabun', 'Prompt', sans-serif;
}

.fc-toolbar {
    margin-bottom: 1.5rem !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fc-toolbar h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--satit-primary-deep);
}

.fc-button {
    background-color: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    color: var(--text-main) !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    padding: 7px 16px !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    text-transform: capitalize !important;
    transition: all 0.2s ease !important;
    height: auto !important;
}

.fc-button:hover {
    background-color: #F8FAFC !important;
    color: var(--satit-primary-dark) !important;
    border-color: var(--satit-primary) !important;
    transform: translateY(-1px);
}

.fc-state-active {
    background: linear-gradient(135deg, var(--satit-primary) 0%, var(--satit-primary-dark) 100%) !important;
    color: #FFFFFF !important;
    border-color: var(--satit-primary-dark) !important;
    box-shadow: 0 4px 12px rgba(106, 92, 130, 0.3) !important;
}

.fc-day-header {
    padding: 12px 0 !important;
    background-color: #F8FAFC;
    font-weight: 700;
    color: var(--satit-primary-dark);
    border-color: #E2E8F0 !important;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.fc-day-number {
    padding: 8px 10px !important;
    font-weight: 600;
    color: var(--text-main);
}

.fc-today {
    background-color: #F5F0FA !important;
}

.fc-today .fc-day-number {
    color: var(--satit-primary);
    font-weight: 800;
}

.fc-event {
    border: none !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.35 !important;
}

.fc-dept-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.95);
    color: #1E293B;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    vertical-align: middle;
}

.fc-cat-tag {
    display: inline-block;
    background: rgba(0, 0, 0, 0.25);
    color: #FFFFFF;
    font-size: 0.70rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 4px;
    vertical-align: middle;
    letter-spacing: 0.2px;
}

.fc-event:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 14px rgba(0,0,0,0.18) !important;
    filter: brightness(1.05);
}

/* =======================================================
   ADMIN EVENT TABLE
   ======================================================= */
.table-custom-wrapper {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.table-custom {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom thead th {
    background: #F8FAFC;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    border-top: none;
}

.table-custom tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.92rem;
    transition: background 0.15s ease;
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}

.table-custom tbody tr:hover td {
    background: #FAF8FC;
}

.table-row-upcoming td strong {
    color: #1E293B;
}

/* Pagination Styling */
.page-item .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    color: var(--satit-primary-dark);
    font-weight: 600;
    border: 1px solid #CBD5E1;
    padding: 6px 14px;
    transition: all 0.2s ease;
}

.page-item.active .page-link {
    background-color: var(--satit-primary) !important;
    border-color: var(--satit-primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(139, 122, 168, 0.35);
}

.page-item.disabled .page-link {
    color: #94A3B8;
    background-color: #F8FAFC;
    border-color: #E2E8F0;
    cursor: not-allowed;
}

/* Custom Select Dropdowns */
.select-custom {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    padding: 6px 34px 6px 12px !important;
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236A5C82' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 14px 10px !important;
    min-width: 140px;
}

.select-custom:focus {
    border-color: var(--satit-primary) !important;
    box-shadow: 0 0 0 3px rgba(139, 122, 168, 0.2) !important;
    outline: none !important;
}

.select-custom option {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
}

.event-category-chip {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-action-icon:hover {
    transform: translateY(-2px);
}

/* =======================================================
   MODAL ENHANCEMENT
   ======================================================= */
.admin-modal .modal-content, .modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-modal);
    overflow: hidden;
}

.admin-modal .modal-header {
    background: linear-gradient(135deg, #3B2667 0%, #6A5C82 100%);
    color: #FFFFFF;
    padding: 1.4rem 1.75rem;
    border-bottom: none;
}

.form-control-custom {
    border-radius: 10px;
    border: 1px solid #CBD5E1;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control-custom:focus {
    border-color: var(--satit-primary);
    box-shadow: 0 0 0 3px rgba(139, 122, 168, 0.2);
}

.palette-picker {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.palette-item {
    cursor: pointer;
    position: relative;
}

.palette-color {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 3px solid transparent;
}

.palette-item:hover .palette-color {
    transform: scale(1.15);
}

.palette-item input[type="radio"]:checked + .palette-color {
    transform: scale(1.15);
    border-color: #FFFFFF;
    box-shadow: 0 0 0 3px var(--satit-primary-deep), 0 4px 10px rgba(0,0,0,0.25);
}

.hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.pulse-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10B981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
