* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    font-weight: 600;
}

main {
    padding: 40px;
}

.candidate-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.candidate-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.candidate-image {
    flex-shrink: 0;
}

.candidate-image img {
    width: 240px;
    height: 240px;
    border-radius: 12px;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.candidate-details {
    flex: 1;
    min-width: 200px;
}

.candidate-name {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.candidate-number {
    font-size: 1.5em;
    font-weight: 600;
    color: #4a90e2;
    margin-bottom: 10px;
}

.candidate-symbol {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.symbol-label {
    font-size: 1.2em;
    font-weight: 600;
    color: #4a90e2;
}

.symbol-icon {
    font-size: 2.0em;
    line-height: 1;
    color: #000000;
}

.search-section {
    margin-bottom: 30px;
}

.search-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a90e2;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.result-section {
    margin-top: 30px;
    padding: 25px;
    border-radius: 10px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
}

.status-message.voted {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.status-message.can-vote {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.voter-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.voter-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

.voter-info-item:last-child {
    border-bottom: none;
}

.voter-info-label {
    font-weight: 600;
    color: #495057;
}

.voter-info-value {
    color: #212529;
}

.register-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

.register-form h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #c3e6cb;
}

.footer {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 10px;
    text-align: center;
    margin-top: 30px;
}

.footer p {
    margin: 0;
    font-size: 1.0em;
    font-weight: 500;
}

@media (max-width: 600px) {
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .candidate-info {
        flex-direction: column;
        text-align: center;
    }
    
    .candidate-image img {
        width: 200px;
        height: 200px;
    }
    
    .candidate-name {
        font-size: 1.5em;
    }
    
    .voter-info-item {
        flex-direction: column;
    }
    
    .voter-info-label {
        margin-bottom: 5px;
    }
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stats-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.stats-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #4a90e2;
    line-height: 1.2;
}

/* Admin Pages Styles */
.login-section {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

.admin-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.voters-table-container {
    margin-top: 30px;
}

.loading-message {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #666;
}

.no-voters-message {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #666;
    background: #f8f9fa;
    border-radius: 12px;
}

.voters-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.voters-table thead {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
}

.voters-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
}

.voters-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    text-align: right;
}

.voters-table tbody tr:hover {
    background-color: #f8f9fa;
}

.voters-table tbody tr:last-child td {
    border-bottom: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.modal-content p {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .admin-controls {
        flex-direction: column;
    }
    
    .admin-controls .btn {
        width: 100%;
    }
    
    .voters-table {
        font-size: 0.9em;
    }
    
    .voters-table th,
    .voters-table td {
        padding: 8px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons .btn {
        width: 100%;
    }
}

