/* style.css - Premium custom styling for Sirros Data Crossing Dashboard */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #161e31;
    --bg-card: rgba(22, 30, 49, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Harmonious Alert Colors */
    --color-emerald: #10b981;
    --color-emerald-bg: rgba(16, 185, 129, 0.15);
    --color-amber: #f59e0b;
    --color-amber-bg: rgba(245, 158, 11, 0.15);
    --color-rose: #f43f5e;
    --color-rose-bg: rgba(244, 63, 94, 0.15);
    --color-blue: #3b82f6;
    --color-blue-bg: rgba(59, 130, 246, 0.15);
    --color-info: #06b6d4;
    --color-info-bg: rgba(6, 182, 212, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 50%);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.5;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
}

/* Header Section */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.brand-section h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #f8fafc 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.brand-badge {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.75rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.emerald::before { background: var(--color-emerald); }
.stat-card.blue::before { background: var(--color-blue); }
.stat-card.amber::before { background: var(--color-amber); }
.stat-card.rose::before { background: var(--color-rose); }
.stat-card.info::before { background: var(--color-info); }

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: 0.5rem;
    display: flex;
    align-items: baseline;
}

/* Sync Controls Panel */
.controls-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.75rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.sync-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sync-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.sync-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-rose);
}

.sync-status-dot.synced {
    background: var(--color-emerald);
    box-shadow: 0 0 8px var(--color-emerald);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--color-blue);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-success {
    background: var(--color-emerald-bg);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: var(--color-emerald);
    color: white;
}

.btn-amber {
    background: var(--color-amber-bg);
    color: var(--color-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-amber:hover:not(:disabled) {
    background: var(--color-amber);
    color: #000;
    font-weight: 700;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress bar */
.progress-container {
    width: 100%;
    margin-top: 1rem;
    display: none;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-blue), var(--color-info));
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Data Filters and Table Section */
.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.tab.active.divergent { border-color: rgba(245, 158, 11, 0.3); color: var(--color-amber); }
.tab.active.missing-local { border-color: rgba(244, 63, 94, 0.3); color: var(--color-rose); }
.tab.active.missing-sirros { border-color: rgba(244, 63, 94, 0.3); color: var(--color-rose); }

.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

.actions-group {
    display: flex;
    gap: 0.75rem;
}

/* Table styling */
.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th {
    background: #111827;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Comparison specific highlights */
.diff-cell {
    background: rgba(245, 158, 11, 0.06) !important;
    border: 1px dashed rgba(245, 158, 11, 0.3);
}

.diff-value {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sirros-val {
    color: var(--color-amber);
    font-weight: 500;
}

.local-val {
    color: var(--text-primary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.success { background: var(--color-emerald-bg); color: #34d399; }
.badge.warning { background: var(--color-amber-bg); color: #fbbf24; }
.badge.danger { background: var(--color-rose-bg); color: #f87171; }
.badge.info { background: var(--color-blue-bg); color: #60a5fa; }

/* Loading spinner */
.spinner {
    animation: rotate 2s linear infinite;
    width: 16px;
    height: 16px;
    display: inline-block;
}

.spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Empty state styling */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
