@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Variables matching File Tracker (Tailwind gray-800/900) */
html.dark {
    --bg-main: #111827; /* gray-900 */
    --bg-white: #1f2937; /* gray-800 */
    --card-bg: #1f2937;
    --border-color: #374151; /* gray-700 */
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* Fix Stat Cards Centering Issues */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Ensure Analytics Page Styles */
.analytics-dashboard {
    padding: 2rem;
    background: var(--bg-main);
}

.chart-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Report Styles */
.report-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.report-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

html.dark .report-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Analytics KPI Cards Refinement */
.analytics-kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.analytics-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.analytics-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.analytics-kpi-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.analytics-kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}

.analytics-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

/* Dark mode overrides for analytics if needed */
html.dark .analytics-kpi-card {
    background: #1f2937;
    border-color: #374151;
}

/* AI Feature Styles */
.ai-suggest-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white !important;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.ai-suggest-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
    filter: brightness(1.1);
}

.ai-suggest-btn i {
    font-size: 0.8rem;
}

.ai-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

.ai-confidence-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.confidence-high { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.confidence-medium { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.confidence-low { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
