/* SORECO II Association Voting System - Main Styles */
/* Color Theme: Dark Blue (#1a237e, #0d47a1) and White (#ffffff) */

:root {
    --primary-dark: #1a237e;
    --primary-blue: #0d47a1;
    --primary-light: #1976d2;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --text-dark: #212121;
    --text-gray: #757575;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* Center login/register pages only */
body:has(.card:only-child) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Smaller container for login pages */
body:has(.card:only-child) .container {
    max-width: 500px;
}

/* Header (for voting and admin pages only) */
.header {
    background: var(--white);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border-radius: 10px;
}

.header h1 {
    color: var(--primary-dark);
    font-size: 28px;
    text-align: center;
    margin-bottom: 5px;
}

.header p {
    color: var(--text-gray);
    text-align: center;
    font-size: 14px;
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.card-header {
    border-bottom: none;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.card-header h2 {
    color: var(--primary-dark);
    font-size: 24px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

/* Button Styles */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 71, 161, 0.3);
}

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

.btn-success:hover {
    background: #388e3c;
}

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

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

.btn-secondary {
    background: var(--text-gray);
    color: var(--white);
}

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

.btn-block {
    width: 100%;
    display: block;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* 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.6);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
    position: relative;
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    color: var(--primary-dark);
    font-size: 22px;
    margin-bottom: 10px;
}

.modal-body {
    text-align: center;
}

.unique-code-display {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 3px dashed var(--primary-blue);
}

.unique-code-display h2 {
    color: var(--primary-blue);
    font-size: 32px;
    margin: 10px 0;
    letter-spacing: 2px;
}

.modal-footer {
    margin-top: 25px;
    text-align: center;
}

/* Candidate Card */
.candidate-card {
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
    margin-bottom: 15px;
}

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

.candidate-card.selected {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.1) 0%, rgba(26, 35, 126, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(13, 71, 161, 0.3);
}

.candidate-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--light-gray);
}

.candidate-card.selected img {
    border-color: var(--primary-blue);
}

.candidate-card h3 {
    color: var(--primary-dark);
    font-size: 18px;
    margin-bottom: 5px;
}

.candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Ballot Summary */
.ballot-summary {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.ballot-item {
    padding: 15px;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-blue);
}

.ballot-item h4 {
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.ballot-item p {
    color: var(--text-gray);
    font-size: 16px;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid var(--primary-blue);
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid var(--warning);
}

/* Icons */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.check-icon {
    color: var(--success);
    font-size: 24px;
}

.edit-icon {
    color: var(--primary-blue);
    font-size: 24px;
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

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

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design - Tablet */
@media screen and (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
    
    .card {
        padding: 30px 20px;
    }
    
    .candidate-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
}

/* Mobile App-like Interface */
@media screen and (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .card {
        border-radius: 15px;
        padding: 30px 20px;
    }
    
    .form-control {
        padding: 14px 12px;
        font-size: 16px;
    }
    
    .btn {
        padding: 14px 25px;
        font-size: 15px;
        border-radius: 25px;
    }
    
    .candidate-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .candidate-card {
        display: flex;
        align-items: center;
        text-align: left;
        padding: 15px;
    }
    
    .candidate-card img {
        width: 80px;
        height: 80px;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .candidate-card h3 {
        font-size: 16px;
    }
    
    .modal-content {
        width: 95%;
        margin: 30% auto;
        padding: 25px 20px;
    }
    
    .unique-code-display h2 {
        font-size: 28px;
    }
    
    .nav-buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
    }
    
    .nav-buttons .btn {
        flex: 1;
    }
    
    /* Add padding at bottom to prevent content from being hidden by fixed nav */
    .voting-section {
        padding-bottom: 80px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
