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

:root {
    /* Modern "Sleek Election" Theme */
    --color-primary: #2563EB; /* Royal Blue */
    --color-primary-dark: #1D4ED8;
    --color-secondary: #EFF6FF; /* Light Blue */
    --color-secondary-dark: #DBEAFE;
    --color-text-main: #0F172A; /* Blackish/Slate 900 for font */
    --color-text-muted: #475569; /* Slate 600 */
    --color-bg: #F8FAFC; /* Slate 50 */
    --color-white: #FFFFFF;
    
    /* Legacy variable mappings (to keep HTML intact) */
    --color-blue: var(--color-secondary);
    --color-butter: var(--color-white);
    --color-chocolate: var(--color-text-main);
    --color-text: var(--color-text-muted);
    --color-light-gray: var(--color-bg);
    
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 15px 35px rgba(15, 23, 42, 0.1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.8s var(--transition-smooth) forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s var(--transition-smooth) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s var(--transition-smooth) forwards;
}

.delay-100 { animation-delay: 0.1s; opacity: 0; }
.delay-200 { animation-delay: 0.2s; opacity: 0; }
.delay-300 { animation-delay: 0.3s; opacity: 0; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-main);
}

.text-center { text-align: center; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }
.text-4xl { font-size: 2.5rem; }
@media (min-width: 768px) {
    .text-4xl { font-size: 3.5rem; }
}
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

/* Layout & Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Backgrounds */
.bg-blue { background-color: var(--color-blue); }
.bg-butter { background-color: var(--color-butter); }
.bg-white { background-color: var(--color-white); }
.bg-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

/* Components */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background-color: var(--color-secondary-dark);
    transform: translateY(-2px);
}

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

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

.btn-block {
    width: 100%;
}

/* Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

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

.form-control {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    border: 1px solid #94A3B8; /* Slate 400 - Thinner 1px border */
    border-radius: var(--radius-md);
    background-color: var(--color-white);
    transition: var(--transition-smooth);
    font-family: inherit;
    color: var(--color-text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-white);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.text-error {
    color: #E53E3E;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Decorative */
.wave-divider {
    position: relative;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="%23FEEFB8"></path></svg>') no-repeat center center;
    background-size: cover;
}

/* Candidates Grid */
.candidate-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 3px solid transparent;
}

.candidate-card.selected {
    border-color: var(--color-chocolate);
    background-color: var(--color-butter);
}

.candidate-number {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 60px;
    height: 60px;
    background-color: var(--color-blue);
    color: var(--color-chocolate);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 4px solid var(--color-white);
    z-index: 10;
}

.candidate-image {
    width: 100%;
    height: 250px;
    background-color: var(--color-blue);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(67, 47, 46, 0.3);
}

.candidate-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.candidate-name {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.candidate-class {
    color: #666;
    margin-bottom: 1rem;
    font-weight: 500;
}

.candidate-vision {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(67, 47, 46, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: var(--transition-smooth);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    min-width: 800px; /* Ensure table stretches horizontally */
    border-collapse: collapse;
    text-align: left;
    margin-top: 1rem;
    white-space: nowrap; /* Prevent text from wrapping unnecessarily */
}

.table th, .table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table th {
    background-color: var(--color-light-gray);
    font-weight: 700;
    color: var(--color-chocolate);
}

.table tbody tr:hover {
    background-color: rgba(196, 218, 232, 0.1);
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
}

.badge-success {
    background-color: #DEF7EC;
    color: #03543F;
    border: 1px solid #31C48D;
}

.badge-danger {
    background-color: #FDE8E8;
    color: #9B1C1C;
    border: 1px solid #F8B4B4;
}

.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.action-buttons form {
    margin: 0;
    display: flex;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

