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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F5F5F5;
    color: #333;
    line-height: 1.6;
}

/* Enhanced Header Styles */
header {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(211, 47, 47, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Public page header layout */
body.public-page .header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

body.public-page .header-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    padding: 0;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Admin page header layout */
body.admin-page .header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

body.admin-page .header-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 0.5rem 0;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.admin-page .admin-info {
    align-self: center;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Button styles (reusing for general buttons) */
.btn-primary {
    background: #D32F2F;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background: #B71C1C;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.3);
}

.btn-secondary {
    background: #757575;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-edit, .btn-delete {
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #2196F3;
    color: white;
}

.btn-edit:hover {
    background: #0b7dda;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Admin Info Section (for admin.html) */
.admin-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.admin-info span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Enhanced Dashboard Styles */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 20px;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    min-height: calc(100vh - 120px);
}

/* Animated Background */
.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.1) 0%, rgba(211, 47, 47, 0.05) 70%, transparent 100%);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.floating-element:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    width: 120px;
    height: 120px;
}

.floating-element:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 7s;
    width: 100px;
    height: 100px;
}

.floating-element:nth-child(3) {
    bottom: 20%;
    left: 60%;
    animation-delay: 14s;
    width: 90px;
    height: 90px;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.3;
    }
    75% {
        transform: translate(40px, 10px) scale(1.05);
        opacity: 0.4;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    z-index: 1;
    margin-bottom: 3rem;
}

.stats-showcase {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.main-stat-card {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    border-radius: 20px;
    padding: 2.5rem;
    color: white;
    box-shadow: 0 15px 35px rgba(211, 47, 47, 0.3);
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.main-stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.stat-icon {
    font-size: 4rem;
    opacity: 0.9;
    animation: pulse 2s infinite ease-in-out;
}

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

.stat-content {
    flex: 1;
    z-index: 1;
}

.stat-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 500;
}

.counter {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-percentage {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    opacity: 0.9;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-progress {
    position: relative;
    z-index: 1;
}

.progress-ring svg {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

#progressCircle {
    transition: stroke-dashoffset 1s ease-in-out;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.mini-stat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.mini-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #D32F2F;
}

.mini-stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.mini-stat-content {
    flex: 1;
}

.mini-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #D32F2F;
    margin: 0 0 0.25rem 0;
}

.mini-stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Charts Section */
.charts-section {
    position: relative;
    z-index: 1;
}

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #D32F2F, #B71C1C);
    border-radius: 2px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(211, 47, 47, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    color: #D32F2F;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: #D32F2F;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-card.enhanced {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-card.enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #D32F2F, #B71C1C);
}

.chart-card.enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

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

.chart-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-btn {
    background: #f5f5f5;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.chart-btn:hover {
    background: #e0e0e0;
}

.chart-btn.active {
    background: #D32F2F;
    color: white;
}

.chart-container-3d {
    position: relative;
    height: 350px;
    margin-bottom: 1.5rem;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    padding: 1rem;
}

.chart-container-3d canvas {
    max-width: 100%;
    height: 100% !important;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-item-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #D32F2F;
    margin-bottom: 0.25rem;
}

.stat-item-label {
    font-size: 0.8rem;
    color: #666;
}

/* Insights Section */
.insights-section {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.05) 0%, rgba(183, 28, 28, 0.02) 100%);
    border-radius: 20px;
    border: 1px solid rgba(211, 47, 47, 0.1);
}

.insights-title {
    font-size: 1.5rem;
    color: #333;
    margin: 0 0 2rem 0;
    text-align: center;
    font-weight: 600;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.insight-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.insight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    border-color: #D32F2F;
}

.insight-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.insight-content h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.insight-content p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 3D Chart Animations */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Settings Section */
.settings-section {
    padding: 2rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.setting-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.setting-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    border-color: #D32F2F;
}

.setting-header h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.setting-header p {
    margin: 0 0 1.5rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.setting-form {
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #D32F2F;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.setting-status {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
    display: none;
}

.setting-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.setting-status.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.setting-info {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    color: #D32F2F;
    font-weight: 600;
    font-size: 1.1rem;
}

.chart-card.enhanced {
    animation: fadeInUp 0.8s ease-out;
}

.chart-card.enhanced:nth-child(1) {
    animation-delay: 0.1s;
}

.chart-card.enhanced:nth-child(2) {
    animation-delay: 0.2s;
}

.insight-card {
    animation: fadeInUp 0.8s ease-out;
}

.insight-card:nth-child(1) {
    animation-delay: 0.3s;
}

.insight-card:nth-child(2) {
    animation-delay: 0.4s;
}

.insight-card:nth-child(3) {
    animation-delay: 0.5s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .main-stat-card {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

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

    .charts-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .chart-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .counter {
        font-size: 2.5rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-icon {
    font-size: 1.5rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Main Layout */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Dashboard Styles */
.dashboard {
    display: grid;
    gap: 20px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 5px solid #D32F2F;
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.counter {
    font-size: 2.5rem;
    font-weight: bold;
    color: #D32F2F;
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.chart-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

/* Admin Styles */
.admin-tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    border-right: 1px solid #e0e0e0;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn.active {
    background-color: #D32F2F;
    color: white;
}

.tab-btn:hover:not(.active) {
    background-color: #f5f5f5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Candidates Section */
.candidates-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.candidate-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.candidate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.candidate-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #D32F2F;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
    font-size: 1.2rem;
}

.candidate-name {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.candidate-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Form Styles */
.vote-input-section, .reset-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #D32F2F;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}

/* Button Styles */
.btn-primary {
    background-color: #D32F2F;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #B71C1C;
}

.btn-secondary {
    background-color: #666;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-danger {
    background-color: #D32F2F;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    font-weight: bold;
}

.btn-danger:hover {
    background-color: #B71C1C;
}

.btn-admin {
    background-color: transparent;
    color: white;
    border: 2px solid white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-admin:hover {
    background-color: white;
    color: #D32F2F;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* Login Modal Specific Styles */
#loginModal .modal-content {
    text-align: center;
}

#loginModal h3 {
    color: #D32F2F;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#loginForm {
    margin-top: 15px;
}

.message {
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Warning Box */
.warning-box {
    background-color: #FFF3E0;
    border: 1px solid #FFB74D;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.warning-box h4 {
    color: #F57C00;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    header h2 {
        font-size: 1rem;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

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

    .admin-tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .tab-btn:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }

    main {
        padding: 10px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

/* Loading and Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #D32F2F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Table Styles for Votes */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.votes-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.votes-table th,
.votes-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.votes-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.votes-table tr:hover {
    background-color: #f9f9f9;
}

.votes-table .action-buttons {
    display: flex;
    gap: 5px;
}

.votes-table .btn-edit,
.votes-table .btn-delete {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin: 0;
}

.votes-table .btn-edit {
    background-color: #0275d8;
}

.votes-table .btn-edit:hover {
    background-color: #025aa5;
}

.votes-table .btn-delete {
    background-color: #d9534f;
}

.votes-table .btn-delete:hover {
    background-color: #c9302c;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button.active {
    background-color: #D32F2F;
    color: white;
    border-color: #D32F2F;
}

.pagination button:hover:not(.active) {
    background-color: #f0f0f0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
    word-wrap: break-word;
}

.notification-success {
    background-color: #4CAF50;
}

.notification-error {
    background-color: #f44336;
}

.notification-warning {
    background-color: #ff9800;
}

.notification-info {
    background-color: #2196F3;
}

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