/**
 * COD Matcher - Technical Dashboard & Data Grid Theme
 * Designed with a premium slate-dark sidebar, indigo/emerald highlights,
 * clear typography hierarchy, and a precise, compact data grid layout.
 */

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

:root {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-border: #1e293b;
    --sidebar-hover: #1e293b;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-success: #10b981;
    --color-warning: #f97316;
    --color-danger: #ef4444;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

/* Global resets & font setups */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main) !important;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.font-mono {
    font-family: 'JetBrains Mono', monospace !important;
}

/* Page Layout Structure */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Sidebar */
.sidebar-wrapper {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
    color: #94a3b8;
}

.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-subtitle {
    color: #818cf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
}

.sidebar-brand-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    letter-spacing: -0.02em;
    font-style: italic;
}

.sidebar-menu {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: var(--sidebar-hover);
}

.sidebar-link.active {
    color: #ffffff;
    background-color: var(--color-primary);
}

.sidebar-link i, .sidebar-link svg {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-status-box {
    background-color: #1e293b;
    border-radius: 8px;
    padding: 12px;
}

.sidebar-status-title {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 6px;
}

.sidebar-status-value {
    color: #34d399;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Status blinker */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

/* Main Content Area */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-header {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.content-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.content-body {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

/* Cards & Bento Grid */
.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.metric-card.highlighted-card {
    border: 2px solid var(--color-primary);
}

.metric-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
}

.metric-subtext {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

.metric-icon-bg {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Data Grid Table */
.grid-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    margin-bottom: 24px;
}

.grid-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.custom-table thead th {
    background-color: #fafbfc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

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

.custom-table tbody tr:hover {
    background-color: #f8fafc;
}

.custom-table tbody td {
    padding: 12px 24px;
    font-size: 0.875rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

/* Badge System */
.badge-tech {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    display: inline-block;
}

.badge-tech-success {
    background-color: #ecfdf5;
    color: #047857;
}

.badge-tech-warning {
    background-color: #fff7ed;
    color: #c2410c;
}

.badge-tech-danger {
    background-color: #fef2f2;
    color: #b91c1c;
}

.badge-tech-info {
    background-color: #eff6ff;
    color: #1d4ed8;
}

/* Form Styling & Dropzone */
.form-control-tech {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: all 0.15s ease;
}

.form-control-tech:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background-color: #fafbfc;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-dropzone:hover {
    border-color: var(--color-primary);
    background-color: #f5f7ff;
}

/* Custom Buttons */
.btn-tech-primary {
    background-color: var(--color-primary);
    color: #ffffff !important;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.btn-tech-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-tech-secondary {
    background-color: #ffffff;
    color: #334155 !important;
    border: 1px solid var(--border-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.btn-tech-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* Pagination container */
.grid-footer {
    padding: 12px 24px;
    background-color: #fafbfc;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Mobile Toggle Header */
.mobile-top-bar {
    display: none;
    height: 56px;
    background-color: var(--sidebar-bg);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: #ffffff;
}

/* Responsiveness */
@media (max-width: 991.98px) {
    .app-wrapper {
        flex-direction: column;
    }
    .sidebar-wrapper {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--sidebar-border);
        display: none; /* Toggle with JS or simple Bootstrap class */
    }
    .sidebar-wrapper.show {
        display: flex;
    }
    .mobile-top-bar {
        display: flex;
    }
    .content-header {
        padding: 0 16px;
    }
    .content-body {
        padding: 16px;
    }
}
