/* ============================================================
   OpenClax - Global Styles
   Product of Empleo System Limited / Miemploya Business Solutions
   ============================================================ */

/* Foundation */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

[x-cloak] {
    display: none !important;
}

/* ---- Animated Backgrounds ---- */
.mesh-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 25%, #1e3a5f 50%, #0f172a 75%, #1e1b4b 100%);
    background-size: 400% 400%;
    animation: mesh 15s ease infinite;
}

@keyframes mesh {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 30%, #312e81 60%, #1e3a5f 100%);
}

/* ---- Glassmorphism ---- */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-card-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Floating Orbs ---- */
.float-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

/* ---- Entrance Animations ---- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ---- Dashboard Shell ---- */
.sidebar-transition {
    transition: width 0.3s ease, padding 0.3s ease, transform 0.3s ease;
}

.toolbar-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    height: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease;
}

.toolbar-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    height: auto;
    transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease;
}

/* ---- Sidebar Scrollbar ---- */
#sidebar nav {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

#sidebar nav::-webkit-scrollbar {
    width: 5px;
}

#sidebar nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.3), rgba(148, 163, 184, 0.5));
    border-radius: 6px;
}

#sidebar nav:not(:hover)::-webkit-scrollbar-thumb {
    background: transparent;
}

/* ---- Stat Counter Animation ---- */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-number {
    animation: countUp 0.8s ease-out forwards;
}

/* ---- Pulse Ring ---- */
@keyframes pulseRing {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid currentColor;
    opacity: 0.3;
    animation: pulseRing 2s ease-out infinite;
}

/* ---- Feature Card Hover ---- */
.feature-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ---- Gradient Text ---- */
.gradient-text {
    background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Custom Scrollbar (Global) ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

/* ---- Print Styles ---- */
@media print {
    .no-print { display: none !important; }
    #sidebar, header, #collapsed-toolbar { display: none !important; }
}


/* ============================================================
   OpenClax - Modern Landing Page Enhancement Styles
   ============================================================ */

.bg-grid-pattern {
    background-size: 32px 32px;
    background-image: 
        linear-gradient(to right, rgba(99, 102, 241, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
}

.dark .bg-grid-pattern {
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.radial-glow {
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent 70%);
}

.dark .radial-glow {
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.25), transparent 70%);
}

/* Range Slider Styling for Savings Calculator */
input[type=range].custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 9999px;
    outline: none;
    transition: background 0.2s;
}

.dark input[type=range].custom-slider {
    background: #334155;
}

input[type=range].custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
    cursor: pointer;
    border: 3px solid #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type=range].custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.8);
}

input[type=range].custom-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
    cursor: pointer;
    border: 3px solid #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}


/* ============================================================
   OpenClax - Modern App-Wide Component Tokens
   ============================================================ */

/* Modern Stat & KPI Cards */
.stat-kpi-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}

.dark .stat-kpi-card {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(51, 65, 85, 0.7);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.stat-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Modern Data Table */
.modern-table-container {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.dark .modern-table-container {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(51, 65, 85, 0.7);
}

.modern-table thead th {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: #64748b;
    padding: 0.875rem 1.25rem;
    background: rgba(248, 250, 252, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .modern-table thead th {
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(51, 65, 85, 0.8);
}

.modern-table tbody tr {
    transition: background-color 0.15s ease;
}

.modern-table tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.6);
}

.dark .modern-table tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.5);
}

.modern-table tbody td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
    font-size: 0.8125rem;
}

.dark .modern-table tbody td {
    border-color: rgba(30, 41, 59, 0.8);
}

/* Modern Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}

.badge-paid, .badge-cleared, .badge-success {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.dark .badge-paid, .dark .badge-cleared, .dark .badge-success {
    background-color: rgba(6, 78, 59, 0.35);
    color: #6ee7b7;
    border-color: rgba(5, 150, 105, 0.4);
}

.badge-unpaid, .badge-danger, .badge-disqualified {
    background-color: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.dark .badge-unpaid, .dark .badge-danger, .dark .badge-disqualified {
    background-color: rgba(136, 19, 55, 0.35);
    color: #fda4af;
    border-color: rgba(225, 29, 72, 0.4);
}

.badge-partial, .badge-warning, .badge-late {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.dark .badge-partial, .dark .badge-warning, .dark .badge-late {
    background-color: rgba(120, 53, 15, 0.35);
    color: #fcd34d;
    border-color: rgba(217, 119, 6, 0.4);
}

.badge-info, .badge-live {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.dark .badge-info, .dark .badge-live {
    background-color: rgba(30, 58, 138, 0.35);
    color: #93c5fd;
    border-color: rgba(37, 99, 235, 0.4);
}


/* ============================================================
   OpenClax Official Preloader / Animated Brand Screen (By Miemploya Consult)
   ============================================================ */
#openclax-preloader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 40%, #111827 0%, #0b1120 60%, #030712 100%);
    color: #ffffff;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s ease;
    user-select: none;
    -webkit-user-select: none;
}
#openclax-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.preloader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 360px;
    padding: 24px;
}
.preloader-title-wrap {
    position: relative;
    margin-bottom: 6px;
}
.preloader-brand-animated-text {
    font-size: 2.75rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: inline-block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 25%, #ec4899 55%, #06b6d4 85%, #3b82f6 100%);
    background-size: 250% 250%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 25px rgba(99, 102, 241, 0.45));
    animation: openclax-gradient-flow 3s ease infinite, openclax-text-pulse 2.2s ease-in-out infinite;
}
.preloader-subtext {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #94a3b8;
    margin: 0 0 22px 0;
    font-family: 'Inter', system-ui, sans-serif;
    opacity: 0.9;
}
.preloader-bar-bg {
    width: 150px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}
.preloader-bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background: linear-gradient(90deg, #6366f1, #ec4899, #06b6d4);
    border-radius: 9999px;
    animation: preloader-indeterminate 1.4s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}
@keyframes openclax-gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes openclax-text-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}
@keyframes preloader-indeterminate {
    0% { left: -50%; width: 30%; }
    50% { left: 25%; width: 60%; }
    100% { left: 100%; width: 40%; }
}
@media print {
    #openclax-preloader {
        display: none !important;
    }
}
