@import 'animations.css';

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #ffffff;
    --sidebar-active-bg: #eef2ff;
    --sidebar-active-text: #4f46e5;
    --sidebar-text: #4b5563;
    --top-header-height: 64px;
    --accent-blue: #4f46e5;
    --bg-light: #f9fafb;
    --border-color: #f3f4f6;
}

body.dashboard-body {
    background-color: var(--bg-light);
    display: flex;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #f8fafc;
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.nav-item i {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    text-align: center;
}

[data-lucide] {
    width: 18px;
    height: 18px;
}

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

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.search-bar {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    width: 400px;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    margin-left: 8px;
    width: 100%;
    font-size: 0.875rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}

.user-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Dashboard Content */
.dashboard-content {
    padding: 32px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.welcome-msg {
    color: #64748b;
    font-size: 0.875rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.stat-footer {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-footer.voters { color: #10b981; }
.stat-footer.candidates { color: #3b82f6; }
.stat-footer.votes { color: #10b981; }

.stat-footer i { margin-right: 6px; }

/* Analytics Charts */
.analytics-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.analytics-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.analytics-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.analytics-card .card-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}

.chart-filter {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: #4b5563;
    outline: none;
}

.chart-container {
    position: relative;
    height: 240px;
    width: 100%;
}

/* Table Section */
.content-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.section-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.btn-new-election {
    background: #2563eb;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-new-election:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-new-election:active {
    transform: translateY(0) scale(0.98);
}

.election-table {
    width: 100%;
    border-collapse: collapse;
}

.election-table th {
    background: #f9fafb;
    padding: 12px 24px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.election-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-ongoing {
    background: #dcfce7;
    color: #166534;
}

.status-preparing {
    background: #fef3c7;
    color: #92400e;
}

.status-finished {
    background: #f1f5f9;
    color: #475569;
}

.quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.select-status {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    background: #f9fafb;
}

.btn-update {
    background: #2563eb;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-update:hover {
    transform: translateY(-1px);
    filter: brightness(110%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-update:active {
    transform: translateY(0) scale(0.95);
}

.flatlogic-badge {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-light: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --border-color: #334155;
    --sidebar-active-bg: #334155;
    --sidebar-active-text: #6366f1;
    color: #f1f5f9;
}

body.dark-theme .top-header {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .stat-card,
body.dark-theme .analytics-card,
body.dark-theme .content-section,
body.dark-theme .settings-card,
body.dark-theme .modal-content {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .sidebar-brand,
body.dark-theme .user-name,
body.dark-theme .stat-value,
body.dark-theme .card-title,
body.dark-theme .section-title,
body.dark-theme .settings-info h3,
body.dark-theme .modal-title,
body.dark-theme h1 {
    color: #f1f5f9 !important;
}

body.dark-theme .welcome-msg,
body.dark-theme .user-role,
body.dark-theme .stat-label,
body.dark-theme .settings-info p {
    color: #94a3b8;
}

body.dark-theme .search-bar {
    background: #334155;
}

body.dark-theme .search-bar input {
    color: #f1f5f9;
}

body.dark-theme .election-table th {
    background: #334155;
    color: #94a3b8;
    border-color: #475569;
}

body.dark-theme .election-table td {
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-theme .nav-item:hover {
    background: #334155;
}

body.dark-theme .flatlogic-badge {
    background: #1e293b;
    color: #f1f5f9;
}

/* Global Dark Theme Overrides */
body.dark-theme .audit-table,
body.dark-theme .audit-table th,
body.dark-theme .table-container,
body.dark-theme .content-section,
body.dark-theme .settings-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .audit-table td,
body.dark-theme .election-table td {
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark-theme .audit-table th,
body.dark-theme .election-table th {
    background: #334155 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

body.dark-theme .action-badge {
    background: #334155;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

body.dark-theme input, 
body.dark-theme select, 
body.dark-theme textarea {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .sidebar-brand,
body.dark-theme .user-name,
body.dark-theme .stat-value,
body.dark-theme .card-title,
body.dark-theme .section-title,
body.dark-theme .settings-info h3,
body.dark-theme .modal-title,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3 {
    color: #f1f5f9 !important;
}

body.dark-theme .nav-item {
    color: #94a3b8;
}

body.dark-theme .nav-item:hover {
    background: #334155;
    color: #f1f5f9;
}

body.dark-theme .nav-item.active {
    background: #334155;
    color: #6366f1;
}


