/* 
  Premium Dashboard 2026 
  Design System & Custom Styles
*/

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

/* =========================================
   Base & Variables
   ========================================= */
:root {
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --surface-light: #f8fafc;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f3f4f6;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(34, 211, 238, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: 100% 100%;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    /* Prevent double scrollbar */
}

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

/* Glass Card */
.glass-card {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 30px -5px rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-card:hover {
    transform: translateY(-6px) scale(1.01);
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.08),
        0 10px 20px -5px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Inputs */
.modern-input {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.modern-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: #a855f7;
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
    outline: none;
}

/* Buttons */
.btn-premium {
    background: var(--primary-gradient);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #6366f1 100%);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-premium:hover::before {
    opacity: 1;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(168, 85, 247, 0.4);
}

/* Stats Cards */
.stat-value {
    background: linear-gradient(to right, #1e293b, #475569);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    border-radius: 16px;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #64748b;
    /* text-gray-500 */
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.6);
    color: #1e293b;
    /* text-gray-800 */
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    color: #6366f1;
    /* indigo-600 */
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.nav-link i {
    font-size: 1.25rem;
    margin-right: 12px;
    transition: transform 0.3s ease;
}

.nav-link:hover i,
.nav-link.active i {
    transform: scale(1.1);
    color: #6366f1;
    /* indigo-600 */
}

/* Table */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    /* Spacing between rows */
    margin-top: -8px;
}

.premium-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: left;
    /* Fix alignment mismatch */
}

.premium-table tbody tr {
    background-color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    cursor: default;
}

.premium-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.premium-table td {
    padding: 16px 24px;
    vertical-align: middle;
}

.premium-table td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.premium-table td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-badge.active {
    background-color: #d1fae5;
    /* emerald-100 */
    color: #047857;
    /* emerald-700 */
    border-color: #a7f3d0;
}

.status-badge.inactive {
    background-color: #f1f5f9;
    color: #64748b;
}

/* DRE Reports */
.dre-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.dre-row:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
}

.dre-row.subtotal {
    background-color: rgba(99, 102, 241, 0.05);
    /* indigo-50/50 equivalent */
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.dre-row.positive {
    background-color: rgba(16, 185, 129, 0.05);
    /* emerald-50/50 */
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.dre-label {
    font-weight: 500;
    color: #475569;
}

.dre-value {
    font-weight: 700;
    font-size: 1.125rem;
}

.dre-total {
    padding: 24px;
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.dre-total:hover {
    transform: scale(1.02);
}

.transaction-row {
    transition: background-color 0.2s ease;
    border-radius: 12px;
}

.transaction-row:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

@keyframes pulse-indigo {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

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

.animate-enter {
    animation: fadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.animate-modal {
    animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.animate-float {
    animation: fadeIn 1s ease-in-out;
}

/* =========================================
   Print Styles for PDF Export
   ========================================= */
@media print {

    /* Hide UI Chrome */
    aside,
    header .modern-input,
    header button,
    .glass-card button,
    .animate-enter {
        display: none !important;
    }

    /* Reset Background */
    body {
        background: white !important;
        color: black !important;
    }

    /* Full Width Content */
    main {
        width: 100% !important;
        margin: 0 !important;
        padding: 20mm !important;
    }

    /* Glass Cards - Solid for Print */
    .glass-card {
        background: white !important;
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    /* Charts Scaling */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Page Breaks */
    .space-y-6,
    .space-y-8 {
        page-break-inside: avoid;
    }
}

.stagger-1 {
    animation-delay: 100ms;
}

.stagger-2 {
    animation-delay: 200ms;
}

.stagger-3 {
    animation-delay: 300ms;
}

/* Scrollbar */
/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #db2777 100%);
    /* Slightly darker/richer on hover */
}

/* Custom Scrollbar for specific containers */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    /* Slate-300 with opacity */
    border-radius: 99px;
    transition: background 0.3s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    /* Slate-400 on hover */
}

/* Modern Table */
.modern-table {
    border-collapse: separate;
    border-spacing: 0 6px;
    /* Floating rows - slightly tighter */
    width: 100%;
}

.modern-table thead th {
    background: rgba(248, 250, 252, 0.8);
    /* Slate-50 with opacity */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 24px;
}

.modern-table tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.modern-table tbody tr:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.modern-table td {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.25);
    /* Base semi-transparent - lighter */
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.modern-table td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.modern-table td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.4);
}

/* Nav Link */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 14px;
    color: #64748b;
    /* slate-500 */
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #4f46e5;
    /* indigo-600 */
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.85);
    /* Glassy white */
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    color: #4338ca;
    /* indigo-700 */
    font-weight: 600;
}

.nav-link.active i {
    color: #ec4899;
    /* Pink icon for contrast */
}

/* Button Pressed State */
.btn-premium:active,
button:active {
    transform: scale(0.98);
}

/* Modal & Backdrop Styling */
dialog.modal {
    border: none;
    max-width: 90vw;
    outline: none;
    padding: 0;
    overflow: visible;
}

dialog.modal::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: backdropFadeIn 0.3s ease-out;
}

dialog.modal[open] {
    animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

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

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Modal Adjustments */
@media (max-width: 768px) {
    dialog.modal {
        max-width: 95vw;
        margin: 10px;
    }

    .modal-content {
        border-radius: 20px;
    }

    .modal-header {
        padding: 20px 24px 16px;
    }

    .modal-header h3 {
        font-size: 1.125rem;
    }

    .modal-body {
        padding: 20px 24px;
    }

    .modal-footer {
        padding: 16px 24px 20px;
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
        justify-content: center;
    }
}

/* Smooth focus animation for inputs */
.modern-input:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -10px rgba(99, 102, 241, 0.2);
}

/* Utilities */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Privacy Mode Utility */
.privacy-blur {
    filter: blur(8px);
    user-select: none;
    transition: all 0.3s ease;
    cursor: default;
}

.privacy-blur:hover {
    filter: blur(10px);
}

.modal-header-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Sidebar Drawer (Mobile) */
@media (max-width: 767px) {
    .sidebar-drawer {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 50 !important;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        display: flex !important;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    }

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

    .sidebar-drawer .lg\:block {
        display: block !important;
    }

    .sidebar-drawer .lg\:w-72 {
        width: 100% !important;
    }
}

/* Premium Switch */
.premium-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.premium-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 20px;
}

.premium-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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