/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors - Cyber-Corporate Dark Mode */
    --bg-primary: #0F1115;
    --bg-surface: #181B21;
    --bg-surface-highlight: #232730;
    --accent-primary: #6366F1;
    --accent-secondary: #EC4899;
    --accent-tertiary: #8B5CF6;
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --border: rgba(255, 255, 255, 0.1);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow-primary: 0 4px 20px rgba(99, 102, 241, 0.4);
    --shadow-glow-success: 0 4px 20px rgba(16, 185, 129, 0.4);
    --shadow-glow-error: 0 4px 20px rgba(239, 68, 68, 0.4);

    /* Typography */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 20px;
    top: 20px;
    bottom: 20px;
    width: 240px;
    background: rgba(24, 27, 33, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    font-size: 18px;
    font-weight: 700;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-surface-highlight);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--bg-surface-highlight);
    color: var(--accent-primary);
    box-shadow: var(--shadow-glow-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    margin-top: auto;
}

.user-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 280px;
    padding: 20px 40px 40px 20px;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(24, 27, 33, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-surface-highlight);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    min-width: 300px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow-primary);
}

.search-bar svg {
    color: var(--text-secondary);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    flex: 1;
    font-family: var(--font-family);
    font-size: 14px;
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.search-shortcut {
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-highlight);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background: var(--bg-surface);
    transform: scale(1.05);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ===== HERO SECTION ===== */
.hero-section {
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: var(--spacing-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(99, 102, 241, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow-primary);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.stat-icon-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.stat-icon-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}

.stat-trend-up {
    color: var(--success);
}

.stat-trend-down {
    color: var(--error);
}

/* ===== BENTO GRID ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
}

.bento-card-large {
    grid-column: span 2;
}

.bento-card-full {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
}

.status-badge {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.status-badge-info {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.status-badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* ===== FORMS ===== */
.config-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-input {
    background: var(--bg-surface-highlight);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow-primary);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.input-with-icon {
    position: relative;
}

.input-icon-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.input-icon-btn:hover {
    color: var(--accent-primary);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: white;
    box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-surface-highlight);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-surface);
    border-color: var(--accent-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-surface-highlight);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    margin-top: var(--spacing-md);
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.upload-text {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.upload-subtext {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing-md);
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-surface-highlight);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.file-size {
    color: var(--text-secondary);
    font-size: 12px;
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.file-remove:hover {
    background: var(--bg-surface);
    color: var(--error);
}

.csv-format-info {
    background: var(--bg-surface-highlight);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.info-title {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: var(--spacing-xs);
}

.csv-example {
    display: block;
    background: var(--bg-primary);
    color: var(--accent-primary);
    padding: var(--spacing-sm);
    border-radius: 4px;
    font-size: 11px;
    overflow-x: auto;
    white-space: nowrap;
}

/* ===== PROGRESS ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-surface-highlight);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--spacing-md) 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: rgba(24, 27, 33, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-info {
    border-left: 4px solid var(--accent-primary);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    color: var(--text-secondary);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 240px;
    }

    .bento-card-large {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        left: -240px;
        transition: left 0.3s ease;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        min-width: auto;
    }
}

/* ===== RESULTS TABLE ===== */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-md);
}

.results-table thead {
    background: var(--bg-surface-highlight);
}

.results-table th {
    padding: var(--spacing-md);
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.results-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.results-table tr:hover {
    background: var(--bg-surface-highlight);
}

.error-row {
    color: var(--error);
}

.success-summary {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.success-summary h3 {
    color: var(--success);
    font-size: 24px;
    margin-bottom: var(--spacing-xs);
}
