/* Global Theme Variables */
:root {
    /* New Palette: Midnight & Neon */
    --bg-dark: #0f172a; /* Slate 900 */
    --bg-darker: #020617; /* Slate 950 */
    --accent-primary: #38bdf8; /* Sky 400 */
    --accent-secondary: #818cf8; /* Indigo 400 */
    --accent-success: #34d399; /* Emerald 400 */
    --accent-warning: #fbbf24; /* Amber 400 */
    --accent-danger: #f87171; /* Red 400 */
    
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-bg-hover: rgba(15, 23, 42, 0.8);
    --glass-shimmer: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f1f5f9; /* Slate 100 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --text-muted: #64748b; /* Slate 500 */
}

/* Base Setup */
body {
    background-color: var(--bg-darker);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.08), transparent 25%);
    background-attachment: fixed;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0;
}

.tracking-tight {
    letter-spacing: 0 !important;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glass-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.3), 
        0 10px 10px -5px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(56, 189, 248, 0.1); 
}

/* Custom Gradients */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-brand {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

/* Navigation */
.nav-link {
    position: relative;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--accent-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.2); }
    50% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); }
}

.glow-effect {
    animation: glow-pulse 3s infinite;
}

/* Inputs & Forms */
.glass-input {
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.glass-input::placeholder {
    color: #9ca3af !important;
}

.glass-input:focus {
    background-color: #1e293b !important;
    border-color: #0ea5e9 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Payment Method Badges */
.payment-method-cash {
    background: linear-gradient(135deg, #10b981, #059669);
}

.payment-method-card {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.payment-method-digital {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* Transfer Status Badges */
.transfer-status-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.transfer-status-approved {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.transfer-status-completed {
    background: linear-gradient(135deg, #10b981, #059669);
}

.transfer-status-cancelled {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Location Card Styles */
.location-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.62));
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.28);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.32);
    box-shadow: 0 24px 40px rgba(2, 6, 23, 0.42), 0 0 24px rgba(56, 189, 248, 0.08);
}

.location-card h3,
.location-card .font-semibold,
.location-card .font-medium {
    color: var(--text-primary) !important;
}

.location-card p,
.location-card .text-gray-600 {
    color: var(--text-secondary) !important;
}

.location-card .border-gray-200 {
    border-color: var(--glass-border) !important;
}

.location-card .bg-blue-100 {
    background: rgba(56, 189, 248, 0.16) !important;
}

.location-card .text-blue-600 {
    color: var(--accent-primary) !important;
}

.location-card .text-green-600 {
    color: var(--accent-success) !important;
}

.location-card .text-red-600,
.location-card .text-red-700 {
    color: var(--accent-danger) !important;
}

.location-card .bg-gray-100 {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
}

.location-card .bg-gray-100:hover {
    background: rgba(255, 255, 255, 0.14) !important;
}

.location-card .bg-red-100 {
    background: rgba(248, 113, 113, 0.14) !important;
}

.location-card .bg-red-100:hover {
    background: rgba(248, 113, 113, 0.22) !important;
}

/* Receipt Preview */
.receipt-preview {
    background: #fafafa;
    border: 1px dashed #d1d5db;
    font-family: 'Courier New', monospace;
}

/* Custom scrollbar for modals */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Fix autofill styling for dark theme inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    border-color: #475569 !important;
}

/* Dark theme form inputs */
.dark-input {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

.dark-input::placeholder {
    color: #9ca3af !important;
}

.dark-input:focus {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3) !important;
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Mobile Navigation */
.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    body {
        background-image:
            linear-gradient(180deg, rgba(14, 165, 233, 0.08), transparent 260px),
            linear-gradient(0deg, rgba(129, 140, 248, 0.06), transparent 320px);
    }

    body > .fixed.rounded-full {
        display: none;
    }

    .glass-panel {
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    nav.glass-panel {
        top: 0;
        margin: 0;
        border-radius: 0 0 16px 16px;
        border-left: 0;
        border-right: 0;
    }

    nav .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    nav .h-16 {
        height: 4rem;
    }

    nav .space-x-8 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 1rem;
    }

    nav .space-x-4 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0.375rem;
    }

    nav .user-avatar {
        width: 2rem;
        height: 2rem;
    }

    nav a[aria-label] span.text-xl {
        font-size: 1rem;
        max-width: 8.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    nav .flex.items-center.space-x-8 {
        min-width: 0;
    }

    nav .flex.items-center.space-x-4 {
        flex-shrink: 0;
    }

    #search-btn {
        display: none;
    }

    #notification-dropdown,
    #profile-dropdown {
        position: fixed;
        top: 4.75rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        max-height: calc(100vh - 5.5rem);
        overflow-y: auto;
        border-radius: 16px;
    }

    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    section h1.text-5xl {
        font-size: 2.35rem;
        line-height: 1.05;
        overflow-wrap: normal;
    }

    section h1.text-5xl .text-gradient {
        display: block;
    }

    section h1.text-3xl {
        font-size: 1.875rem;
        line-height: 1.15;
    }

    #typed-text {
        display: block;
        min-height: 3.1rem;
    }

    p.text-xl {
        font-size: 1rem;
        line-height: 1.7;
    }

    .glass-card,
    .location-card,
    .receipt-preview {
        border-radius: 14px !important;
    }

    .glass-card:hover,
    .location-card:hover {
        transform: none;
    }

    .glass-card > .absolute {
        display: none;
    }

    button,
    a {
        -webkit-tap-highlight-color: transparent;
    }

    .grid {
        gap: 1rem;
    }

    .flex.space-x-3,
    .flex.space-x-4,
    .flex.space-x-6 {
        gap: 0.75rem;
    }

    .flex.space-x-3 > :not([hidden]) ~ :not([hidden]),
    .flex.space-x-4 > :not([hidden]) ~ :not([hidden]),
    .flex.space-x-6 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0;
    }

    section .flex.flex-col.md\:flex-row,
    section .flex.flex-col.sm\:flex-row {
        align-items: stretch;
        width: 100%;
        max-width: 100%;
    }

    section .flex.flex-col.sm\:flex-row button,
    section .flex.flex-col.sm\:flex-row a,
    section .flex.flex-col.md\:flex-row button,
    section .flex.flex-col.md\:flex-row a {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
        text-align: center;
    }

    section .mt-4.md\:mt-0.flex.space-x-3 {
        flex-direction: column;
        width: 100%;
    }

    section .mt-4.md\:mt-0.flex.space-x-3 button,
    section .mt-4.md\:mt-0.flex.space-x-3 a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .glass-panel > .flex.items-center.justify-between {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .flex.space-x-2.bg-slate-900\/50 {
        width: 100%;
        overflow-x: auto;
    }

    .flex.space-x-2.bg-slate-900\/50 button {
        flex: 0 0 auto;
    }

    section p {
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .overflow-x-auto {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 760px;
    }

    .modal-backdrop {
        padding: 0.75rem;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-backdrop > div {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 1.5rem) !important;
        padding: 1.25rem !important;
        border-radius: 16px !important;
    }

    .modal-backdrop form .grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    #location-cards .text-gray-900 {
        color: var(--text-primary) !important;
    }

    #location-cards .text-gray-500 {
        color: var(--text-secondary) !important;
    }

    .mobile-menu {
        display: block;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 40;
    }
    
    .mobile-menu-content {
        position: fixed;
        top: 0;
        right: 0;
        width: min(88vw, 320px);
        height: 100%;
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
        border-left: 1px solid var(--glass-border);
        z-index: 50;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -24px 0 60px rgba(2, 6, 23, 0.45);
    }
    
    .mobile-menu-content.open {
        transform: translateX(0);
    }
}
