/* ============================================
   Perukiller Panel - Global Styles
   Premium Design with Glassmorphism & Animations
   ============================================ */

:root {
    /* Default Theme (Midnight Slate) Variables - Fallback */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --accent-primary: #6366f1;
    --accent-primary-light: #818cf8;
    --accent-secondary: #22d3ee;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
    --gradient-card: linear-gradient(145deg, rgba(26, 26, 37, 0.9), rgba(18, 18, 26, 0.9));

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 🌑 Midnight Slate (Default) */
[data-theme='midnight'] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;

    --accent-primary: #6366f1;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --gradient-card: linear-gradient(145deg, rgba(26, 26, 37, 0.9), rgba(18, 18, 26, 0.9));
}

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

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Alpine.js cloak - MUST be first to hide before Alpine initializes */
[x-cloak] {
    display: none !important;
}

/* Modal Overlay - Full viewport centering (display set by Alpine.js) */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    /* NOTE: display is controlled by Alpine.js x-show, not set here */
    align-items: center !important;
    justify-content: center !important;
}

/* When modal is shown (toggled by Alpine.js :class) */
.modal-overlay.modal-open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.hamburger-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile Overlay for Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

/* Table Responsive Container */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* Tablet Breakpoint */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 24px;
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {

    /* Show hamburger button */
    .hamburger-btn {
        display: flex;
    }

    /* Sidebar hidden by default, shown when .sidebar-open */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    /* Main content full width */
    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
        padding-top: 70px !important;
        /* Space for hamburger */
    }

    /* Page header stack on mobile */
    .page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 16px;
    }

    /* Cards reduced padding */
    .card {
        padding: 16px;
    }

    /* Stats grid single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Stat card adjustments */
    .stat-card {
        min-height: auto;
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Table minimum width for scroll */
    .table {
        min-width: 600px;
    }

    /* Buttons full width on mobile */
    .btn-mobile-full {
        width: 100%;
    }

    /* Flex wrap for button groups */
    .flex {
        flex-wrap: wrap;
    }

    /* Chat layout mobile */
    .chat-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100% !important;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .chat-main {
        width: 100% !important;
        height: 40vh;
    }

    /* Modal adjustments */
    .modal-content {
        margin: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Nav item text smaller */
    .nav-item-description {
        display: none;
    }

    /* Form inputs */
    .form-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}

/* Small Mobile Breakpoint */
@media (max-width: 480px) {
    .main-content {
        padding: 12px !important;
        padding-top: 70px !important;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    /* Tabs scrollable */
    .tabs-container {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}


/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   Layout Components
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.sidebar-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

/* ============================================
   Cards & Containers
   ============================================ */

.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(20px);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-md);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-value.success {
    background: linear-gradient(135deg, #22d3ee 0%, #10b981 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-icon {
    position: absolute !important;
    top: 50% !important;
    right: 20px !important;
    transform: translateY(-50%) !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.7 !important;
}

.stat-icon svg {
    width: 22px !important;
    height: 22px !important;
    color: var(--text-secondary) !important;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Secondary button */
.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

/* ============================================
   Buttons & Inputs
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    font-size: 1rem;
    transition: all var(--transition-normal);
    /* Force dark theme for native pickers */
    color-scheme: dark;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* Text, Email, Tel, Search, URL, Password Inputs - Override Tailwind/Bootstrap */
input[type="text"].form-input,
input[type="email"].form-input,
input[type="tel"].form-input,
input[type="search"].form-input,
input[type="url"].form-input,
input[type="password"].form-input {
    background: var(--bg-tertiary) !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
}

/* ============================================
   Dark Theme Form Controls
   ============================================ */

/* Date, Time, DateTime-Local Inputs */
input[type="date"].form-input,
input[type="time"].form-input,
input[type="datetime-local"].form-input {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    color-scheme: dark;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator,
input[type="time"].form-input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

input[type="date"].form-input::-webkit-calendar-picker-indicator:hover,
input[type="time"].form-input::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"].form-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Number Inputs */
input[type="number"].form-input {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    -moz-appearance: textfield;
}

input[type="number"].form-input::-webkit-outer-spin-button,
input[type="number"].form-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Select Elements */
select.form-input {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

select.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* Inline Selects (for time pickers) */
select.bg-transparent {
    background: transparent !important;
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select.bg-transparent option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Textarea */
textarea.form-input {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
}

/* Placeholder styling */
.form-input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* Autofill styling for dark theme */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-tertiary) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Checkbox and Radio - Custom styling */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent-primary);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--bg-glass);
}

/* ============================================
   Premium Animations & Effects Library
   ============================================ */

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 30px rgba(16, 185, 129, 0.4);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(99, 102, 241, 0.3);
    }

    50% {
        border-color: rgba(99, 102, 241, 0.8);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.1);
    }
}

/* Animation Utility Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-heartbeat {
    animation: heartbeat 1.5s infinite;
}

/* Staggered Animations for Lists/Grids */
.stagger-item:nth-child(1) {
    animation-delay: 0.05s;
}

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

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

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

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

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

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

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

/* ============================================
   Enhanced Stat Cards
   ============================================ */

.stat-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(99, 102, 241, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

/* ============================================
   Enhanced Cards
   ============================================ */

.card {
    transition: all 0.4s ease;
}

.card-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(99, 102, 241, 0.15);
}

.card-glow {
    position: relative;
}

.card-glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    background-size: 200% 200%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: gradientFlow 3s ease infinite;
}

.card-glow:hover::after {
    opacity: 1;
}

/* ============================================
   Enhanced Buttons
   ============================================ */

.btn {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

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

.btn-shimmer {
    background: linear-gradient(90deg,
            var(--accent-primary) 0%,
            var(--accent-primary-light) 50%,
            var(--accent-primary) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ============================================
   Enhanced Form Inputs
   ============================================ */

.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.input-group {
    position: relative;
}

.input-group .form-input {
    padding-top: 20px;
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-group .form-input:focus+label,
.input-group .form-input:not(:placeholder-shown)+label {
    top: 8px;
    font-size: 0.75rem;
    color: var(--accent-primary);
}

/* ============================================
   Enhanced Badges
   ============================================ */

.badge-success {
    position: relative;
}

.badge-online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulseGlow 1.5s infinite;
}

.badge-live {
    animation: heartbeat 1.5s infinite;
}

/* ============================================
   Enhanced Navigation
   ============================================ */

.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item svg {
    transition: transform 0.3s ease;
}

.nav-item:hover svg {
    transform: scale(1.15);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.nav-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item-label {
    font-weight: 500;
    line-height: 1.2;
}

.nav-item-description {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ============================================
   Login Page Enhancements
   ============================================ */

.login-container {
    animation: fadeInUp 0.8s ease-out;
}

.login-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(99, 102, 241, 0.1);
    transition: all 0.4s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(99, 102, 241, 0.2);
}

.login-logo {
    animation: float 4s ease-in-out infinite;
}

.login-title {
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #22d3ee 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 4s ease infinite;
}

.login-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 10px 30px rgba(99, 102, 241, 0.4),
        0 0 40px rgba(99, 102, 241, 0.2);
}

.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: left 0.6s ease;
}

.login-btn:hover::after {
    left: 100%;
}

/* Animated Background for Login */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    z-index: -2;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    z-index: -1;
}

/* ============================================
   Table Enhancements
   ============================================ */

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

.table th {
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.01);
}

.table tbody tr:hover td {
    color: var(--text-primary);
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--text-muted);
    animation: float 3s ease-in-out infinite;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   Tooltip
   ============================================ */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Glassmorphism Helpers
   ============================================ */

.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   Loading States
   ============================================ */

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 0%,
            var(--bg-glass) 50%,
            var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

/* ============================================
   Responsive Enhancements
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}