/*
 * Premium Neon Glassmorphic CSS Design System
 * Tailored for ION Quotation & Billing Dashboard
 */

:root {
    --bg-main: #040610;
    --bg-surface: #0a0e1a;
    --bg-surface-glass: rgba(10, 14, 26, 0.75);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-glow: rgba(139, 92, 246, 0.2);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #8b5cf6; /* Violet */
    --primary-glow: rgba(139, 92, 246, 0.45);
    --secondary: #06b6d4; /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.45);
    --accent: #f43f5e; /* Rose */
    --warning: #f59e0b; /* Amber */
    --success: #10b981; /* Emerald */
    --danger: #ef4444; /* Red */
    
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
    
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.2);
    
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset and Core Layout */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.007) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.007) 1px, transparent 1px),
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.12) 0px, transparent 40%),
        radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 40%),
        radial-gradient(at 50% 100%, rgba(217, 70, 239, 0.08) 0px, transparent 50%);
    background-size: 32px 32px, 32px 32px, 100% 100%, 100% 100%, 100% 100%;
    background-attachment: fixed;
    font-size: 0.95rem;
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1f2937;
}

/* Top Navigation Bar */
.navbar {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 1050;
    box-shadow: var(--shadow-sm);
    padding: 0 28px;
    transition: var(--transition-smooth);
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), rgba(6, 182, 212, 0.4), transparent);
}

.navbar-brand img {
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.navbar-brand:hover img {
    transform: scale(1.08) rotate(2deg);
}

/* Sidebar Navigation */
.sidebar {
    width: 270px;
    position: fixed;
    top: 70px;
    bottom: 0;
    left: 0;
    padding: 28px 18px;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
    z-index: 1000;
}

.sidebar a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.98rem;
    transition: var(--transition-smooth);
    border-radius: 14px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    position: relative;
}

.sidebar a i {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.025);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}
.sidebar a:hover i {
    transform: scale(1.15) rotate(-3deg);
}

.sidebar a.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.12) 0%, rgba(139, 92, 246, 0.02) 100%);
    color: #fff;
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: inset 0 0 12px rgba(139, 92, 246, 0.05);
}

.sidebar a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: linear-gradient(180deg, #8b5cf6, #d946ef);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary-glow);
}

.sidebar a.active i {
    color: #c084fc;
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.4));
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Main Content Area */
.main-content {
    margin-left: 270px;
    padding: 106px 48px 48px;
    min-height: 100vh;
    transition: var(--transition-smooth);
}

/* Dashboard Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-md);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s, box-shadow 0.4s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), 0 0 25px var(--border-glow);
    border-color: rgba(139, 92, 246, 0.25);
}

.card-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.2px;
}

/* Metric / Stat Card Design */
.card-metric {
    padding: 28px;
    position: relative;
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(10, 14, 26, 0.8) 100%);
}

.card-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
}

.card-metric.border-success::before { background: var(--success); }
.card-metric.border-warning::before { background: var(--warning); }
.card-metric.border-danger::before { background: var(--danger); }
.card-metric.border-primary::before { background: var(--primary); }

.card-metric h5 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.card-metric h3 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.5px;
    font-family: 'Outfit', sans-serif;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Glassmorphism Filters Card */
.card-filter {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    margin-bottom: 28px;
    padding: 24px;
    border-radius: 20px;
}

/* Form Controls & Inputs */
.form-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.form-control, .form-select {
    background-color: rgba(17, 24, 39, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(17, 24, 39, 0.8);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    color: #fff;
}

.input-group-text {
    background-color: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 12px;
}

/* Premium Glass Table */
.card-table {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-surface);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #0e1324;
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    padding: 18px 24px;
}

.table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.02) !important;
}

.table td {
    padding: 18px 24px;
    color: var(--text-secondary);
    vertical-align: middle;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.003);
}

/* Buttons */
.btn {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-size: 0.92rem;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-gradient {
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
    z-index: 1;
}

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

.btn-gradient:hover::before {
    left: 150%;
}

.btn-gradient:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5), 0 0 15px rgba(217, 70, 239, 0.25);
    color: #fff;
}

.btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

.btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Status Badges - Glowing pastels */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.05);
}

.status-partial {
    background-color: rgba(6, 182, 212, 0.08);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.05);
}

.status-converted {
    background-color: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
}

/* CKEditor Custom Styling for Dark Mode */
.ck.ck-editor__main>.ck-editor__editable {
    background: rgba(17, 24, 39, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
    border-radius: 0 0 12px 12px !important;
    padding: 16px 20px !important;
}

.ck.ck-toolbar {
    background: #0e1324 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px 12px 0 0 !important;
}

.ck.ck-button {
    color: var(--text-secondary) !important;
}

.ck.ck-button:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

.ck.ck-button.ck-on {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #c084fc !important;
}

/* 3D Card / Container Styling */
.card-3d {
    background: rgba(17, 24, 39, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.card-3d:hover {
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: var(--shadow-md);
}

/* Login Page Styling */
.login-body {
    background-color: #03050c;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
        linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: rgba(10, 14, 26, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg), 0 0 50px rgba(139, 92, 246, 0.15);
    border-radius: 28px;
    padding: 54px 44px;
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Alert Styling */
.alert {
    border-radius: 14px;
    padding: 16px 24px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.15);
}

.alert-info {
    background-color: rgba(6, 182, 212, 0.08);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.15);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.08);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.15);
}

/* Pagination Control Styling */
.pagination .page-link {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-secondary);
    padding: 12px 18px;
    transition: var(--transition-smooth);
    border-radius: 8px;
}

.pagination .page-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.pagination .page-item.disabled .page-link {
    background-color: rgba(10, 14, 26, 0.45);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* Mobile Responsive Adjustments */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        top: 70px;
        width: 270px;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        background-color: rgba(6, 8, 16, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 106px 20px 48px;
    }
    
    .sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

.sidebar-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
}

.sidebar-toggle.active i {
    transform: rotate(90deg);
    color: #c084fc;
}
