/* ===== RESET & VARIABLES ===== */
:root {
    /* Dark mode (default) */
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --dark-bg: #0E1117;
    --card-bg: #1F2937;
    --sidebar-bg: #111827;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* ===== LIGHT MODE ===== */
body.light-mode {
    --primary: #484b6a;
    --primary-dark: #3a3d54;
    --danger: #e63946;
    --danger-dark: #c82333;
    --warning: #fb8b24;
    --dark-bg: #fafafa;
    --card-bg: #e4e5f1;
    --sidebar-bg: #484b6a;
    --text-primary: #2b2d42;
    --text-secondary: #9394a5;
    --border-color: #d2d3db;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header i {
    color: var(--primary);
    font-size: 2rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
}

.nav-item i {
    width: 20px;
}

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

.team-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.team-info p {
    margin: 0.25rem 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.header-title p {
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===== STATUS INDICATOR ===== */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--card-bg);
    border-radius: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.status-dot.offline {
    background-color: var(--danger);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

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

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--card-bg);
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-change {
    font-size: 0.875rem;
}

.metric-change.positive {
    color: var(--primary);
}

.metric-change.negative {
    color: var(--danger);
}

/* ===== CHARTS ===== */
.chart-container {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* ===== TABLES ===== */
.table-container {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow-x: auto;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th {
    text-align: left;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ===== BADGES ===== */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge-success {
    background-color: rgba(34, 197, 94, 0.2);
    color: var(--primary);
}

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

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

/* ===== FORMS ===== */
.form-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input[type="range"] {
    padding: 0;
}

.form-input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Radio buttons styling */
input[type="radio"] {
    margin-right: 0.5rem;
}

/* ===== FILE UPLOAD ===== */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: var(--primary);
    background-color: rgba(34, 197, 94, 0.05);
}

.file-upload i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.file-upload p {
    color: var(--text-secondary);
}

/* ===== PREDICTION RESULT ===== */
.result-card {
    background: linear-gradient(135deg, var(--card-bg), var(--sidebar-bg));
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 2rem;
}

.result-card.legit {
    border-left: 4px solid var(--primary);
}

.result-card.fraud {
    border-left: 4px solid var(--danger);
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.result-label {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.probability-bar {
    height: 20px;
    background-color: var(--dark-bg);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.probability-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.probability-fill.high {
    background-color: var(--danger);
}

.probability-fill.medium {
    background-color: var(--warning);
}

.probability-fill.low {
    background-color: var(--primary);
}

/* ===== LOADING ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* ===== ALERTS ===== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-left: 4px solid var(--primary);
    color: var(--primary);
}

/* ===== LIGHT MODE OVERRIDES ===== */
body.light-mode .form-input {
    background-color: white;
    color: var(--text-primary);
}

body.light-mode .metric-card,
body.light-mode .chart-container,
body.light-mode .table-container,
body.light-mode .form-card {
    background-color: white;
}

body.light-mode .status-indicator {
    background-color: white;
}

body.light-mode th {
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .badge-success {
    background-color: rgba(72, 75, 106, 0.1);
}

body.light-mode .badge-danger {
    background-color: rgba(230, 57, 70, 0.1);
}

body.light-mode .badge-warning {
    background-color: rgba(251, 139, 36, 0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-header h2,
    .nav-item span,
    .team-info p {
        display: none;
    }

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

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

    .form-row {
        grid-template-columns: 1fr;
    }
}