/*
 * Star town Medical System v1.4.2
 * Modernized Stylesheet - Fixed Sidebar Layout
 */

/* =========================================
   1. VARIABLES & THEME CONFIG
   ========================================= */
:root {
    /* --- Brand Colors --- */
    --color-primary: #F57927;
    /* Vibrant Orange */
    --color-primary-hover: #E46A1A;
    /* Darker Orange for Hover */
    --color-primary-light: #FFF3E0;
    /* Light Orange for accents */
    --color-secondary: #FFF3E0;
    /* Semantic Secondary (Light Orange) */

    /* --- Semantic Colors --- */
    --color-success: #10B981;
    /* Emerald 500 */
    --color-warning: #F59E0B;
    /* Amber 500 */
    --color-danger: #EF4444;
    /* Red 500 */
    --color-danger-hover: #DC2626;
    /* Red 600 */
    --color-info: #3B82F6;
    /* Blue 500 */

    /* --- Neutral Colors (Light Mode) --- */
    --color-text: #1F2937;
    /* Gray 800 */
    --color-text-muted: #6B7280;
    /* Gray 500 */
    --color-border: #E5E7EB;
    /* Gray 200 */
    --color-bg-base: #F9FAFB;
    /* Gray 50 */
    --color-bg-surface: #FFFFFF;
    /* White */
    --color-bg-hover: #F3F4F6;
    /* Gray 100 */

    /* --- Typography --- */
    --font-family-base: 'Kanit', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;

    /* --- Spacing & Layout --- */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* --- Transitions --- */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Mode Variables --- */
html.dark {
    /* Brand Colors (Adjusted for Dark Mode) */
    --color-primary: #F97316;
    /* Orange 500 */
    --color-primary-hover: #EA580C;
    /* Orange 600 */
    --color-primary-light: #431407;
    /* Orange 950 (Backgrounds) */
    --color-secondary: #422C1A;
    /* Dark Orange bg */

    /* Semantic Colors */
    --color-danger: #F87171;
    /* Red 400 */
    --color-danger-hover: #EF4444;
    /* Red 500 */

    /* Neutral Colors (Dark Mode) */
    --color-text: #F1F5F9;
    /* Slate 100 */
    --color-text-muted: #94A3B8;
    /* Slate 400 */
    --color-border: #334155;
    /* Slate 700 */
    --color-bg-base: #0F172A;
    /* Slate 900 */
    --color-bg-surface: #1E293B;
    /* Slate 800 */
    --color-bg-hover: #334155;
    /* Slate 700 */
}

/* =========================================
   2. GLOBAL BASE & RESET
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    color: var(--color-text);
    background-color: var(--color-bg-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    margin: 0;
}

button,
.cursor-pointer,
.nav-link,
.btn {
    user-select: none;
}

/* =========================================
   3. UTILITIES & HELPERS
   ========================================= */
/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.8);
}

html.dark ::-webkit-scrollbar-thumb {
    background-color: rgba(71, 85, 105, 0.6);
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(71, 85, 105, 0.9);
}

/* Glassmorphism Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

html.dark .glass-panel {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Loading Spinner */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(229, 231, 235, 0.3);
    border-bottom-color: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.loader-small {
    width: 16px;
    height: 16px;
    border: 2px solid;
    border-color: currentColor transparent currentColor transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 0.8s linear infinite;
    vertical-align: text-bottom;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.animate-shine {
    animation: shine 1s;
}

@keyframes shine {
    100% {
        left: 125%;
    }
}

.perspective {
    perspective: 1000px;
}

/* =========================================
   4. COMPONENT: BUTTONS
   ========================================= */
.btn {
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: var(--font-size-sm);
    line-height: 1.25rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background-color: #9CA3AF !important;
    border-color: #9CA3AF !important;
    color: #E5E7EB !important;
}

html.dark .btn:disabled,
html.dark .btn[disabled] {
    background-color: #334155 !important;
    border-color: #334155 !important;
    color: #4B5563 !important;
}

/* Button Variants */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn-secondary {
    background-color: #F3F4F6;
    color: #1F2937;
    border-color: #E5E7EB;
}

.btn-secondary:hover {
    background-color: #E5E7EB;
}

html.dark .btn-secondary {
    background-color: #334155;
    color: #E2E8F0;
    border-color: #4B5563;
}

html.dark .btn-secondary:hover {
    background-color: #4B5563;
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.btn-danger:hover {
    background-color: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
}

.btn-danger-outline {
    background-color: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-danger-outline:hover {
    background-color: var(--color-danger);
    color: white;
}

html.dark .btn-danger-outline {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

html.dark .btn-danger-outline:hover {
    background-color: var(--color-danger);
    color: #1F2937;
}

/* =========================================
   5. COMPONENT: FORMS
   ========================================= */
.form-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-surface);
    color: var(--color-text);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(245, 121, 39, 0.2);
}

html.dark .form-input {
    background-color: #1E293B;
    border-color: #334155;
    color: #F1F5F9;
}

html.dark .form-input:focus {
    box-shadow: 0 0 0 3px rgba(245, 121, 39, 0.3);
}

.form-input-sm {
    padding: 0.4rem 0.75rem;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

html.dark .form-label {
    color: #94A3B8;
}

.form-checkbox {
    cursor: pointer;
    border-radius: var(--radius-sm);
    border-color: var(--color-border);
    color: var(--color-primary);
}

html.dark .form-checkbox {
    background-color: #1E293B;
    border-color: #4B5563;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.switch.switch-small {
    width: 36px;
    height: 20px;
}

.switch.switch-small .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.switch.switch-small input:checked+.slider:before {
    transform: translateX(16px);
}

/* =========================================
   6. COMPONENT: NAVIGATION & LAYOUT (SIDEBAR FIX)
   ========================================= */
/* Sidebar Container */
#sidebar {
    transition: transform var(--transition-normal);
    /* z-index is controlled by Tailwind classes in HTML (z-[50]) */
    border-right: 1px solid var(--color-border);
}

html.dark #sidebar {
    background-color: #0F172A;
    /* Slate 900 */
    border-right: 1px solid #1E293B;
}

#sidebar-overlay {
    transition: opacity var(--transition-normal);
    /* z-index is controlled by Tailwind classes in HTML (z-[48]) */
}

header {
    /* z-index is controlled by Tailwind classes in HTML (z-[55]) */
    position: relative;
}

/* Navigation Group Header (Toggle) */
.nav-header-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-header-toggle:hover {
    color: var(--color-text);
    background-color: rgba(0, 0, 0, 0.03);
}

html.dark .nav-header-toggle:hover {
    color: var(--color-text);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-header-toggle .chevron-icon {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.nav-header-toggle.open .chevron-icon {
    transform: rotate(180deg);
}

.nav-header-toggle.open {
    color: var(--color-primary);
}

/* Nav Submenu Container */
.nav-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-submenu.open {
    max-height: 1000px;
}

/* --- [UPDATED] Navigation Links (Flexbox Fix) --- */
#main-nav .nav-link {
    display: flex;
    /* Use Flexbox */
    flex-direction: row;
    /* Force items to be in a row */
    align-items: center;
    /* Center vertically */
    justify-content: flex-start;
    /* Align to left */
    white-space: nowrap;
    /* Prevent text wrapping */

    /* Spacing & Styling */
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    /* Gap between icon and text */

    font-weight: 500;
    border-radius: var(--radius-md);
    border-left: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    width: 100%;
    /* Full width */
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    width: calc(100% - 1rem);
}

/* Hover State */
#main-nav .nav-link:hover {
    color: var(--color-text);
    background-color: var(--color-bg-hover);
    padding-left: 1rem;
    /* No slide */
    transform: translateX(2px);
}

html.dark #main-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #F1F5F9;
}

/* Active State */
#main-nav .nav-link.active {
    background-color: rgba(245, 121, 39, 0.1);
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html.dark #main-nav .nav-link.active {
    background-color: rgba(249, 115, 22, 0.15);
    color: #FB923C;
}

/* Icons inside Nav */
#main-nav .nav-link i,
#main-nav .nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    /* Prevent icon shrinking */
    transition: color 0.2s;
    opacity: 0.8;
}

#main-nav .nav-link:hover i,
#main-nav .nav-link:hover svg {
    opacity: 1;
}

#main-nav .nav-link.active i,
#main-nav .nav-link.active svg {
    opacity: 1;
    color: var(--color-primary);
    filter: drop-shadow(0 0 5px rgba(245, 121, 39, 0.4));
}

/* Sidebar Footer (Profile) */
#user-profile-sidebar {
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

/* Nav Badges */
.nav-badge {
    background-color: var(--color-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    height: 1.25rem;
    min-width: 1.25rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
    margin-left: auto;
    /* Push badge to right */
    line-height: 1;
}

/* Tab Navigation */
.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.tab-btn:hover {
    color: var(--color-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    font-weight: 600;
    border-bottom-color: var(--color-primary);
}

.tab-badge {
    background-color: var(--color-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    height: 1.1rem;
    min-width: 1.1rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
    margin-left: 0.5rem;
    transform: translateY(-1px);
}

/* Settings Dropdown */
.settings-dropdown {
    transform-origin: top right;
    animation: scale-in 0.15s ease-out forwards;
}

.settings-dropdown.hidden {
    display: none;
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dropdown-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
    transition: all var(--transition-fast);
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin: 0.25rem 0.5rem;
}

.dropdown-link:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-primary);
}

.dropdown-link i,
.dropdown-link svg {
    margin-right: 0.75rem;
    width: 1rem;
    height: 1rem;
    color: var(--color-text-muted);
}

.dropdown-link:hover i,
.dropdown-link:hover svg {
    color: var(--color-primary);
}

/* =========================================
   7. COMPONENT: BADGES & STATUS
   ========================================= */
.badge {
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: inline-block;
    line-height: 1.25;
}

.badge-pending {
    background-color: #FEF9C3;
    color: #854D0E;
}

html.dark .badge-pending {
    background-color: #713F12;
    color: #FDE047;
}

.badge-approved,
.badge-success {
    background-color: #DCFCE7;
    color: #166534;
}

html.dark .badge-approved,
html.dark .badge-success {
    background-color: #14532D;
    color: #86EFAC;
}

.badge-rejected,
.badge-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

html.dark .badge-rejected,
html.dark .badge-danger {
    background-color: #7F1D1D;
    color: #FCA5A5;
}

/* =========================================
   8. COMPONENT: CALENDAR REPORT
   ========================================= */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
}

.calendar-header {
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    position: relative;
    min-height: 110px;
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.calendar-day.today {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

html.dark .calendar-day.today {
    background-color: rgba(249, 115, 22, 0.15);
}

.calendar-day:not(.empty):hover {
    background-color: var(--color-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    z-index: 10;
}

.calendar-day.empty {
    background-color: var(--color-bg-base);
    border-color: transparent;
    cursor: default;
}

.rank-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.8;
}

.day-number {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.day-content {
    flex-grow: 1;
    font-size: var(--font-size-xs);
}

.day-text {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: 0.25rem;
}

/* Calendar Status Colors */
.calendar-day.status-active .day-text {
    color: var(--color-success);
}

.calendar-day.status-leave .day-text {
    color: var(--color-warning);
}

.calendar-day.status-mixed .day-text {
    color: var(--color-info);
}

.calendar-day.status-off .day-text {
    color: var(--color-text-muted);
}

/* Day List Items */
.day-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.day-content ul li {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.day-content .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.li-active {
    color: var(--color-success);
}

.li-active .dot {
    background: var(--color-success);
}

.li-leave {
    color: var(--color-warning);
}

.li-leave .dot {
    background: var(--color-warning);
}

.li-off {
    color: var(--color-text-muted);
}

.li-off .dot {
    background: var(--color-text-muted);
}

/* =========================================
   9. COMPONENT: SETTINGS & RANKS
   ========================================= */
.role-permission-group {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.role-permission-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Rank Drag & Drop */
.rank-item {
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.rank-item:hover {
    background-color: var(--color-bg-hover);
}

.rank-item.rank-selected {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

html.dark .rank-item.rank-selected {
    background-color: rgba(249, 115, 22, 0.15);
}

.rank-item .rank-drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
}

.rank-item .rank-drag-handle:active {
    cursor: grabbing;
}

.rank-item.drag-over {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px dashed var(--color-success);
}

.rank-color-dot {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

html.dark .rank-color-dot {
    border-color: rgba(255, 255, 255, 0.2);
}

/* =========================================
   10. UTILITY OVERRIDES (Toastify)
   ========================================= */
.toastify {
    font-family: var(--font-family-base) !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* =========================================
   11. Effect Animate
   ========================================= */
:root {
    --bg-color: #000;
    /* หรือสีพื้นหลังเดิมของคุณ */
    --grid-color: rgba(255, 255, 255, 0.05);
    /* สีเส้นตาราง */
    --accent-color: #ffffff;
}

/* 1. เอฟเฟคตาราง (Wope-style Grid) */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    /* ขนาดของตาราง */
    z-index: -1;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
}

/* เอฟเฟคแสงวิ่งตามเมาส์บนตาราง (ความเวอร์) */
.grid-highlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--x) var(--y), rgba(255, 255, 255, 0.08), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* 2. เอฟเฟคปุ่ม (Cobalt-style Button) */
.btn-cobalt {
    position: relative;
    padding: 12px 24px;
    background: #111;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.btn-cobalt:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* เส้นแสงวิ่งรอบปุ่มแบบ Cobalt */
.btn-cobalt::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: all 0.6s ease;
}


.btn-cobalt:hover::before {
    left: 100%;
}

/* Nav Link Fix */
.nav-link-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-link-content>span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   15. DARK MODE OVERRIDES: SweetAlert2
   ========================================= */
html.dark .swal2-popup {
    background: #1E293B !important;
    color: #F1F5F9 !important;
    border: 1px solid #334155 !important;
}

html.dark .swal2-title {
    color: #F1F5F9 !important;
}

html.dark .swal2-html-container,
html.dark .swal2-content {
    color: #94A3B8 !important;
}

html.dark .swal2-input,
html.dark .swal2-textarea,
html.dark .swal2-select {
    background: #0F172A !important;
    color: #F1F5F9 !important;
    border-color: #334155 !important;
}

html.dark .swal2-input:focus,
html.dark .swal2-textarea:focus,
html.dark .swal2-select:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(245, 121, 39, 0.3) !important;
}

html.dark .swal2-validation-message {
    background: #7F1D1D !important;
    color: #FCA5A5 !important;
}

html.dark .swal2-close {
    color: #94A3B8 !important;
}

html.dark .swal2-close:hover {
    color: #F1F5F9 !important;
}

/* Dark Mode: Select Dropdowns  */
html.dark select.form-input,
html.dark select {
    background-color: #1E293B;
    color: #F1F5F9;
    border-color: #334155;
}

html.dark select.form-input option,
html.dark select option {
    background-color: #1E293B;
    color: #F1F5F9;
}

/* =========================================
   16. MICRO-ANIMATIONS
   ========================================= */
@keyframes bounce-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-bounce-in {
    animation: bounce-in 0.3s ease-out forwards;
}

@keyframes slide-up {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out forwards;
}

/* Staggered animation for cards */
.stagger-animation>* {
    opacity: 0;
    animation: slide-up 0.4s ease-out forwards;
}

.stagger-animation>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-animation>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-animation>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-animation>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-animation>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-animation>*:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger-animation>*:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger-animation>*:nth-child(8) {
    animation-delay: 0.4s;
}

/* =========================================
   17. STAMP ANIMATION (Event Activity)
   ========================================= */
@keyframes stamp-effect {
    0% {
        transform: scale(3) rotate(-15deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
    }

    70% {
        transform: scale(0.95) rotate(-2deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes stamp-ripple {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.stamp-animation {
    animation: stamp-effect 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.stamp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.stamp-badge {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.stamp-badge::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: 4px dashed rgba(255, 255, 255, 0.3);
    animation: spin 10s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   18. DRAG & DROP UPLOAD ZONE
   ========================================= */
.drop-zone {
    position: relative;
    border: 2px dashed var(--color-border, #e2e8f0);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--color-bg-secondary, #f8fafc);
    cursor: pointer;
}

html.dark .drop-zone {
    border-color: #334155;
    background: #1e293b;
}

.drop-zone:hover {
    border-color: var(--color-primary, #F57927);
    background: rgba(245, 121, 39, 0.05);
}

.drop-zone.dragover {
    border-color: var(--color-primary, #F57927);
    background: rgba(245, 121, 39, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(245, 121, 39, 0.2);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* =========================================
   Popup Banner Modal (Login Popup)
   ========================================= */
.popup-banner-modal {
    max-width: 85vw !important;
    max-height: 85vh !important;
}

.popup-banner-modal .swal2-image {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}