:root {
    --primary-red: #DA291C;
    --primary-red-dark: #b91f16;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
}

/* Header */
.voting-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.election-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b7280;
    animation: pulse 2s infinite;
}

.status-dot.open {
    background: var(--success-green);
}

.status-dot.closed {
    background: var(--primary-red);
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Container */
.app-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem 2rem;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    padding: 2rem;
}

/* Loading State */
.loading-panel {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-panel p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* Closed State */
.closed-panel {
    text-align: center;
    padding: 4rem 2rem;
}

.closed-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.closed-panel h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.closed-panel p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

/* Voted State */
.voted-panel {
    text-align: center;
    padding: 4rem 2rem;
}

.voted-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.voted-panel h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.voted-panel p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.results-message {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-style: italic;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.voted-panel button {
    margin-top: 1rem;
}

/* Voting Form */
.voting-panel {
    max-width: 800px;
    margin: 0 auto;
}

.election-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.election-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.positions-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.position-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
}

.position-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary-red);
}

.candidates-grid {
    display: grid;
    gap: 1rem;
}

.candidate-option {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.candidate-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.candidate-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    cursor: pointer;
    accent-color: var(--primary-red);
}

.candidate-option.selected {
    background: rgba(218, 41, 28, 0.2);
    border-color: var(--primary-red);
}

.candidate-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: white;
}

.candidate-info p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(218, 41, 28, 0.3);
}

.btn-submit:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(218, 41, 28, 0.4);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 24px;
    height: 24px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-red-dark);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Results */
.results-panel {
    max-width: 900px;
    margin: 0 auto;
}

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

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-position {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
}

.result-position h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary-red);
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

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

.result-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.result-votes {
    color: rgba(255, 255, 255, 0.9);
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-red);
    transition: width 0.5s ease;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-message {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.vote-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.vote-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.vote-summary-position {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.vote-summary-candidate {
    font-weight: 600;
    color: white;
}

/* Utility */
.hidden {
    display: none !important;
}

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

    .header-title {
        font-size: 1.25rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

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

    .btn-submit {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}
