:root {
    --primary: #c41e3a;
    --primary-dark: #9a1830;
    --primary-light: #e84a5f;
    --secondary: #ff6b6b;
    --accent: #ffd93d;
    --dark: #1a1a2e;
    --light: #fff5f5;
    --text: #333;
    --text-light: #666;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--light);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links span {
    color: white;
    font-weight: 500;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    margin-bottom: 2rem;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
}

.category-section {
    margin: 2rem 0;
}

.category-section h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
}

.office-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fafafa;
    border-radius: 10px;
}

.office-section h3 {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

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

.candidate-card {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.candidate-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.2);
}

.candidate-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.candidate-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.candidate-card p {
    color: var(--text-light);
}

.sig-icon {
    font-size: 0.9em;
    margin-left: 0.3em;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.4);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
}

.candidate-profile {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.15);
}

.candidate-header {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.candidate-photo {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    border: 4px solid var(--primary);
}

.candidate-photo-placeholder {
    width: 250px;
    height: 250px;
    background: #e0e0e0;
    border-radius: 15px;
    border: 4px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.candidate-photo-placeholder::before {
    content: '';
    width: 80px;
    height: 80px;
    background: #999;
    border-radius: 50%;
    position: absolute;
    top: 50px;
}

.candidate-photo-placeholder::after {
    content: '';
    width: 140px;
    height: 100px;
    background: #999;
    border-radius: 70px 70px 0 0;
    position: absolute;
    bottom: 30px;
}

.candidate-card .candidate-photo-placeholder {
    width: 100%;
    height: 200px;
}

.candidate-card .candidate-photo-placeholder::before {
    width: 60px;
    height: 60px;
    top: 30px;
}

.candidate-card .candidate-photo-placeholder::after {
    width: 100px;
    height: 70px;
    bottom: 20px;
}

.candidate-info h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.office {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.category-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.election-date {
    margin-top: 1rem;
    color: var(--text-light);
}

.candidate-bio {
    padding-top: 2rem;
    border-top: 2px solid var(--light);
}

.candidate-bio h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.candidate-bio p {
    line-height: 1.8;
    color: var(--text);
}

.comments-section {
    margin-top: 2rem;
}

.comments-section h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
}

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

.comment-form .btn {
    margin-top: 1rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(196, 30, 58, 0.1);
    border-left: 4px solid var(--primary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-header strong {
    color: var(--primary);
}

.comment-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.comment p {
    line-height: 1.6;
}

.no-comments {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card h1 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 1.5rem;
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid #fecaca;
}

.auth-note {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
}

.admin-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.1);
}

.admin-section h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.admin-form {
    display: grid;
    gap: 1rem;
    max-width: 600px;
}

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

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    color: var(--primary);
    font-weight: 600;
}

.admin-table tr:hover {
    background: var(--light);
}

footer {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--dark) 100%);
    color: white;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .candidate-header {
        flex-direction: column;
        align-items: center;
    }

    .candidate-photo {
        width: 100%;
        max-width: 250px;
    }

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

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    float: right;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.close-modal:hover {
    color: var(--primary);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 2rem;
    border-bottom: 2px solid var(--primary);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
}

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

.tab-btn.active {
    color: var(--primary);
    background: var(--light);
    border: 2px solid var(--primary);
    border-bottom: none;
    margin-bottom: -2px;
}