/* Voting System Styles - Enhanced Version */

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

/* Layouts - Firefox compatible */
.voting-grid {
    display: -ms-grid; /* IE fallback */
    display: grid;
    -ms-grid-columns: 1fr 1fr 1fr; /* IE fallback */
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    gap: 20px;
    -webkit-gap: 20px; /* Safari fallback */
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .voting-grid {
        display: -moz-grid;
        -moz-grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    }
}

/* Responsive grid columns - Firefox compatible */
@media (max-width: 1200px) {
    .voting-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .voting-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.voting-list {
    display: -webkit-box; /* Safari fallback */
    display: -ms-flexbox; /* IE fallback */
    display: flex;
    -webkit-box-orient: vertical; /* Safari fallback */
    -ms-flex-direction: column; /* IE fallback */
    flex-direction: column;
    gap: 15px;
    -webkit-gap: 15px; /* Safari fallback */
}

.voting-masonry {
    column-count: 3;
    column-gap: 20px;
}

.voting-carousel {
    display: -webkit-box; /* Safari fallback */
    display: -ms-flexbox; /* IE fallback */
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
    gap: 20px;
    -webkit-gap: 20px; /* Safari fallback */
    padding: 10px 0;
    scroll-behavior: smooth;
    -webkit-scroll-behavior: smooth; /* Safari fallback */
}

.voting-carousel .voting-candidate-card {
    -webkit-box-flex: 0; /* Safari fallback */
    -ms-flex: 0 0 300px; /* IE fallback */
    flex: 0 0 300px;
}

/* Card Styles */
.voting-card-default {
    background: #fff;
    -webkit-border-radius: 12px; /* Safari fallback */
    -moz-border-radius: 12px; /* Firefox fallback */
    border-radius: 12px;
    -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Safari fallback */
    -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Firefox fallback */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.voting-card-elevated {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.voting-card-flat {
    background: #fff;
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid #e1e5e9;
}

.voting-card-outlined {
    background: #fff;
    border-radius: 12px;
    border: 2px solid #007cba; /* Fallback for older browsers */
    border: 2px solid var(--primary-color, #007cba);
    box-shadow: none;
}

.voting-candidate-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    -webkit-transition: -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease; /* Safari fallback */
    -moz-transition: -moz-transform 0.3s ease, -moz-box-shadow 0.3s ease; /* Firefox fallback */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.voting-candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #007cba);
}

/* Photo Positions */
.candidate-image-top {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.candidate-image-left {
    position: relative;
    height: 150px;
    width: 150px;
    float: left;
    margin-right: 15px;
    overflow: hidden;
    border-radius: 8px;
}

.candidate-image-right {
    position: relative;
    height: 150px;
    width: 150px;
    float: right;
    margin-left: 15px;
    overflow: hidden;
    border-radius: 8px;
}

.candidate-image-bottom {
    position: relative;
    height: 200px;
    overflow: hidden;
    margin-top: 15px;
}

/* Progress Bar */
.voting-progress {
    width: 100%;
    height: 8px;
    background-color: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

.voting-progress-bar {
    height: 100%;
    background: #007cba; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%); /* Safari fallback */
    background: -moz-linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%); /* Firefox fallback */
    background: linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-percentage {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 0.8em;
    color: var(--primary-color, #007cba);
    font-weight: 600;
}

/* Animations */
.voting-animation-fade .voting-candidate-card {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.voting-animation-slide .voting-candidate-card {
    transform: translateY(30px);
    opacity: 0;
    animation: slideIn 0.6s ease forwards;
}

.voting-animation-bounce .voting-candidate-card {
    animation: bounceIn 0.8s ease forwards;
}

@-webkit-keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@-moz-keyframes fadeIn {
    to {
        opacity: 1;
    }
}

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

@-webkit-keyframes slideIn {
    to {
        -webkit-transform: translateY(0);
        opacity: 1;
    }
}

@-moz-keyframes slideIn {
    to {
        -moz-transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    to {
        -webkit-transform: translateY(0); /* Safari fallback */
        -moz-transform: translateY(0); /* Firefox fallback */
        transform: translateY(0);
        opacity: 1;
    }
}

@-webkit-keyframes bounceIn {
    0% {
        -webkit-transform: scale(0.3);
        opacity: 0;
    }
    50% {
        -webkit-transform: scale(1.05);
    }
    70% {
        -webkit-transform: scale(0.9);
    }
    100% {
        -webkit-transform: scale(1);
        opacity: 1;
    }
}

@-moz-keyframes bounceIn {
    0% {
        -moz-transform: scale(0.3);
        opacity: 0;
    }
    50% {
        -moz-transform: scale(1.05);
    }
    70% {
        -moz-transform: scale(0.9);
    }
    100% {
        -moz-transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        -webkit-transform: scale(0.3); /* Safari fallback */
        -moz-transform: scale(0.3); /* Firefox fallback */
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        -webkit-transform: scale(1.05); /* Safari fallback */
        -moz-transform: scale(1.05); /* Firefox fallback */
        transform: scale(1.05);
    }
    70% {
        -webkit-transform: scale(0.9); /* Safari fallback */
        -moz-transform: scale(0.9); /* Firefox fallback */
        transform: scale(0.9);
    }
    100% {
        -webkit-transform: scale(1); /* Safari fallback */
        -moz-transform: scale(1); /* Firefox fallback */
        transform: scale(1);
        opacity: 1;
    }
}

/* Staggered animations for multiple cards */
.voting-animation-fade .voting-candidate-card:nth-child(1) { animation-delay: 0.1s; }
.voting-animation-fade .voting-candidate-card:nth-child(2) { animation-delay: 0.2s; }
.voting-animation-fade .voting-candidate-card:nth-child(3) { animation-delay: 0.3s; }
.voting-animation-fade .voting-candidate-card:nth-child(4) { animation-delay: 0.4s; }
.voting-animation-fade .voting-candidate-card:nth-child(5) { animation-delay: 0.5s; }
.voting-animation-fade .voting-candidate-card:nth-child(6) { animation-delay: 0.6s; }

.voting-animation-slide .voting-candidate-card:nth-child(1) { animation-delay: 0.1s; }
.voting-animation-slide .voting-candidate-card:nth-child(2) { animation-delay: 0.2s; }
.voting-animation-slide .voting-candidate-card:nth-child(3) { animation-delay: 0.3s; }
.voting-animation-slide .voting-candidate-card:nth-child(4) { animation-delay: 0.4s; }
.voting-animation-slide .voting-candidate-card:nth-child(5) { animation-delay: 0.5s; }
.voting-animation-slide .voting-candidate-card:nth-child(6) { animation-delay: 0.6s; }

.voting-animation-bounce .voting-candidate-card:nth-child(1) { animation-delay: 0.1s; }
.voting-animation-bounce .voting-candidate-card:nth-child(2) { animation-delay: 0.2s; }
.voting-animation-bounce .voting-candidate-card:nth-child(3) { animation-delay: 0.3s; }
.voting-animation-bounce .voting-candidate-card:nth-child(4) { animation-delay: 0.4s; }
.voting-animation-bounce .voting-candidate-card:nth-child(5) { animation-delay: 0.5s; }
.voting-animation-bounce .voting-candidate-card:nth-child(6) { animation-delay: 0.6s; }

.candidate-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.candidate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.candidate-info {
    padding: 20px;
    text-align: center;
}

.candidate-name {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #1a1a1a;
}

.candidate-votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.votes-count {
    font-size: 2em;
    font-weight: bold;
    color: #007cba;
    line-height: 1;
}

.votes-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.voting-actions {
    padding: 0 20px 20px;
}

.vote-button {
    width: 100%;
    background: #0066cc; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, #0066cc 0%, #004499 100%); /* Safari fallback */
    background: -moz-linear-gradient(135deg, #0066cc 0%, #004499 100%); /* Firefox fallback */
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vote-button:hover {
    background: #0052a3; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, #0052a3 0%, #003366 100%); /* Safari fallback */
    background: -moz-linear-gradient(135deg, #0052a3 0%, #003366 100%); /* Firefox fallback */
    background: linear-gradient(135deg, #0052a3 0%, #003366 100%);
    -webkit-transform: translateY(-2px); /* Safari fallback */
    -moz-transform: translateY(-2px); /* Firefox fallback */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Custom Colors Support */
.voting-container[data-primary-color] .vote-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.voting-container[data-primary-color] .voting-progress-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.voting-container[data-primary-color] .progress-percentage {
    color: var(--primary-color);
}

.voting-container[data-primary-color] .votes-count {
    color: var(--primary-color);
}

.voting-container[data-primary-color] .voting-candidate-card:hover {
    border-color: var(--primary-color);
}

.vote-button:active {
    transform: translateY(0);
}

.vote-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal Styles */
.voting-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.voting-modal.show {
    opacity: 1;
    visibility: visible;
}

.voting-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.voting-modal.show .voting-modal-content {
    transform: scale(1);
}

.voting-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.voting-modal-close:hover {
    color: #333;
}

.voting-modal h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.8em;
    text-align: center;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    -webkit-transform: translateY(-2px); /* Safari fallback */
    -moz-transform: translateY(-2px); /* Firefox fallback */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.resend-button {
    background: #f8f9fa;
    color: #007cba;
    border: 2px solid #007cba;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.resend-button:hover {
    background: #007cba;
    color: white;
}

/* Success/Error Messages */
.voting-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

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

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

/* Loading States */
.voting-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: voting-spin 1s linear infinite;
    margin-right: 10px;
}

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

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

@keyframes voting-spin {
    0% { 
        -webkit-transform: rotate(0deg); /* Safari fallback */
        -moz-transform: rotate(0deg); /* Firefox fallback */
        transform: rotate(0deg); 
    }
    100% { 
        -webkit-transform: rotate(360deg); /* Safari fallback */
        -moz-transform: rotate(360deg); /* Firefox fallback */
        transform: rotate(360deg); 
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .voting-container {
        padding: 15px;
    }
    
    .voting-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
    
    .voting-masonry {
        column-count: 1;
    }
    
    .voting-carousel {
        padding: 5px 0;
    }
    
    .voting-carousel .voting-candidate-card {
        flex: 0 0 280px;
    }
    
    /* Améliorations mobile */
    .voting-candidate-card {
        border-radius: 12px;
    }
    
    .candidate-image img {
        border-radius: 12px 12px 0 0;
    }
    
    .voting-modal-content {
        width: 95%;
        max-width: 400px;
        margin: 10px;
        border-radius: 16px;
    }
    
    .voting-steps {
        margin: 15px 0 20px 0;
    }
    
    .voting-steps .step {
        padding: 0 15px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input {
        font-size: 16px; /* Empêche le zoom sur iOS */
        padding: 12px;
    }
    
    .btn-primary {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .candidate-bio-preview p {
        font-size: 11px;
    }
    
    .view-bio-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .candidate-image-left,
    .candidate-image-right {
        float: none;
        width: 100%;
        height: 200px;
        margin: 0 0 15px 0;
    }
    
    .voting-modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .voting-container {
        padding: 10px;
    }
    
    .voting-carousel .voting-candidate-card {
        flex: 0 0 250px;
    }
    
    .candidate-image-top,
    .candidate-image-bottom {
        height: 150px;
    }
    
    .candidate-image-left,
    .candidate-image-right {
        height: 150px;
    }
}

/* Results Shortcode Styles */
.voting-results {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.voting-results h3 {
    margin: 0 0 20px 0;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 10px;
}

.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.result-item .candidate-name {
    flex: 1;
    font-weight: 600;
    color: #333;
    margin-right: 15px;
}

.result-stats {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-right: 15px;
}

.vote-count {
    background: var(--primary-color, #007cba);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
}

.vote-percentage {
    color: var(--primary-color, #007cba);
    font-weight: 600;
    font-size: 1.1em;
}

.result-bar {
    width: 200px;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.result-progress {
    height: 100%;
    background: #007cba; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%); /* Safari fallback */
    background: -moz-linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%); /* Firefox fallback */
    background: linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Candidate Description Styles */
.candidate-description {
    margin: 15px 0;
    line-height: 1.6;
}

.candidate-description p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 0.95em;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color, #007cba);
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.read-more-btn:hover {
    color: var(--secondary-color, #005a87);
    text-decoration: underline;
}

.read-more-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Voting Messages */
.voting-message {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: 500;
}

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

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

/* Vote Button States */
.vote-button {
    position: relative;
    overflow: hidden;
}

.vote-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.voting-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: voting-spin 1s linear infinite;
    margin-right: 8px;
}

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

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

@keyframes voting-spin {
    0% { 
        -webkit-transform: rotate(0deg); /* Safari fallback */
        -moz-transform: rotate(0deg); /* Firefox fallback */
        transform: rotate(0deg); 
    }
    100% { 
        -webkit-transform: rotate(360deg); /* Safari fallback */
        -moz-transform: rotate(360deg); /* Firefox fallback */
        transform: rotate(360deg); 
    }
}

/* Vote Count Animation */
.vote-updated {
    animation: votePulse 0.6s ease-in-out;
    color: #28a745 !important;
    font-weight: bold;
}

/* Indicateur d'étapes */
.voting-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0 30px 0;
    padding: 0;
    position: relative;
}

.voting-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.voting-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 20px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

.step.active .step-number {
    background: var(--primary-color, #007cba);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step.completed .step-number::after {
    content: '✓';
    font-size: 16px;
}

.step.active .step-label {
    color: var(--primary-color, #007cba);
    font-weight: 600;
}

.step.completed .step-label {
    color: #28a745;
}

/* Améliorations du formulaire */
.form-group label {
    display: block;
    margin-bottom: 8px;
}

.form-group label strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.form-group .required {
    color: #dc3545;
    margin-left: 4px;
}

.form-group label small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.form-help {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    font-style: italic;
}

.resend-section {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resend-timer {
    font-size: 13px;
    color: #666;
}

/* Boutons avec spinner */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary .btn-spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .btn-spinner {
    display: block;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Messages de statut */
.voting-messages {
    margin-top: 15px;
}

.voting-messages .message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
}

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

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

.voting-messages .message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Focus Visible pour Accessibilité */
.vote-button:focus,
.btn-primary:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.vote-button:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.vote-button:focus-visible {
    outline: 3px solid #007cba;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.2);
}

/* Screen Reader Only - Accessibilité */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Amélioration du contraste */
.voting-candidate-card {
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.voting-candidate-card:hover {
    border-color: rgba(0, 124, 186, 0.2);
}

.voting-candidate-card:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
}

@-webkit-keyframes votePulse {
    0% { -webkit-transform: scale(1); }
    50% { -webkit-transform: scale(1.2); }
    100% { -webkit-transform: scale(1); }
}

@-moz-keyframes votePulse {
    0% { -moz-transform: scale(1); }
    50% { -moz-transform: scale(1.2); }
    100% { -moz-transform: scale(1); }
}

@keyframes votePulse {
    0% { 
        -webkit-transform: scale(1); /* Safari fallback */
        -moz-transform: scale(1); /* Firefox fallback */
        transform: scale(1); 
    }
    50% { 
        -webkit-transform: scale(1.2); /* Safari fallback */
        -moz-transform: scale(1.2); /* Firefox fallback */
        transform: scale(1.2); 
    }
    100% { 
        -webkit-transform: scale(1); /* Safari fallback */
        -moz-transform: scale(1); /* Firefox fallback */
        transform: scale(1); 
    }
}

/* Modal Improvements */
.voting-modal.show {
    display: -webkit-box !important; /* Safari fallback */
    display: -ms-flexbox !important; /* IE fallback */
    display: flex !important;
    -webkit-box-align: center; /* Safari fallback */
    -ms-flex-align: center; /* IE fallback */
    align-items: center;
    -webkit-box-pack: center; /* Safari fallback */
    -ms-flex-pack: center; /* IE fallback */
    justify-content: center;
}

.voting-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.voting-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.voting-modal-close:hover {
    color: #333;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #007cba);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Groupe de saisie téléphone avec sélecteur de pays */
.phone-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.country-code-select {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 9px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 12px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 15px;
}

.country-code-select:focus {
    outline: none;
    border-color: var(--primary-color, #007cba);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.phone-number-input {
    flex: 1;
    min-width: 0;
}

/* Groupe combiné téléphone + code de vérification */
.phone-input-group-with-code {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.phone-input-group-with-code .phone-input-group {
    flex: 1;
    min-width: 250px;
}

/* Groupe de code de vérification intégré sur la même ligne */
.verification-code-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex: 0 0 auto;
    min-width: 180px;
}

.verification-code-input {
    flex: 0 0 90px;
    padding: 12px 8px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 2px;
    transition: border-color 0.3s ease;
    width: 90px;
}

.verification-code-input:focus {
    outline: none;
    border-color: var(--primary-color, #007cba);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.resend-section-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.resend-button-small {
    background: none;
    border: 2px solid var(--primary-color, #007cba);
    color: var(--primary-color, #007cba);
    cursor: pointer;
    font-size: 12px;
    padding: 12px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 600;
    line-height: 1;
}

.resend-button-small:hover {
    background: var(--primary-color, #007cba);
    color: #fff;
}

.resend-button-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resend-section-inline .resend-timer {
    font-size: 12px;
    color: #646970;
    white-space: nowrap;
    padding: 0 4px;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .phone-input-group-with-code {
        flex-direction: column;
    }
    
    .phone-input-group-with-code .phone-input-group {
        width: 100%;
        min-width: 100%;
    }
    
    .phone-input-group-with-code .verification-code-group {
        width: 100%;
        min-width: 100%;
    }
    
    .verification-code-input {
        flex: 1;
        width: auto;
    }
    
    .resend-section-inline {
        flex: 0 0 auto;
    }
}

@media (max-width: 480px) {
    .phone-input-group {
        flex-direction: column;
    }
    
    .country-code-select {
        width: 100%;
        min-width: 100%;
    }
    
    .phone-number-input {
        width: 100%;
    }
    
    .verification-code-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .verification-code-input {
        width: 100%;
    }
    
    .resend-section-inline {
        width: 100%;
        justify-content: center;
    }
}

.resend-button {
    background: none;
    border: none;
    color: var(--primary-color, #007cba);
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: underline;
    margin-top: 5px;
}

.resend-button:hover {
    color: var(--secondary-color, #005a87);
}

.resend-button:disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}

/* Single Candidate Shortcode Styles */
.voting-single-candidate {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    gap: 20px;
}

.voting-single-candidate .candidate-image {
    flex: 0 0 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
}

.voting-single-candidate .candidate-info {
    flex: 1;
}

.voting-single-candidate .candidate-name {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.voting-single-candidate .candidate-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.voting-single-candidate .candidate-votes {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.voting-single-candidate .votes-count {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color, #007cba);
}

.voting-single-candidate .votes-label {
    color: #666;
    font-size: 0.9em;
}

.voting-single-candidate .voting-actions {
    flex: 0 0 auto;
}

/* Admin Dashboard Styles */
.voting-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.voting-stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-content {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.voting-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.voting-activity-list li {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voting-activity-list li:last-child {
    border-bottom: none;
}

.time {
    color: #999;
    font-size: 0.9em;
}

/* Form Table Styles */
.form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
}

.form-table td {
    padding: 20px 10px;
}

.twilio-settings {
    display: none;
}

.twilio-settings.show {
    display: table-row;
}

/* Notices */
.notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid;
    background: #fff;
}

.notice-success {
    border-left-color: #46b450;
    background: #ecf7ed;
}

.notice-error {
    border-left-color: #dc3232;
    background: #fbeaea;
}

/* Bouton de description du candidat */
.candidate-name {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.candidate-description-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
    color: #666;
    font-size: 16px;
    line-height: 1;
}

.candidate-description-btn:hover {
    background: #f0f0f0;
    color: #0073aa;
    transform: scale(1.1);
}

.candidate-description-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Modal de description */
#candidate-description-modal .voting-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

#candidate-description-content {
    padding: 20px 0;
    line-height: 1.6;
}

#candidate-description-content h1,
#candidate-description-content h2,
#candidate-description-content h3,
#candidate-description-content h4,
#candidate-description-content h5,
#candidate-description-content h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

#candidate-description-content p {
    margin-bottom: 15px;
}

#candidate-description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

#candidate-description-content ul,
#candidate-description-content ol {
    margin: 15px 0;
    padding-left: 20px;
}

#candidate-description-content li {
    margin-bottom: 5px;
}

/* ========================================
   Biography Display Styles
   ======================================== */

/* Bio preview on candidate card */
.candidate-bio-preview {
    margin: 8px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--primary-color, #007cba);
    border-radius: 4px;
}

.candidate-bio-preview p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #555;
}

/* View Biography button */
.candidate-bio-action {
    margin: 15px 0;
}

.view-bio-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.2);
}

.view-bio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.view-bio-btn:active {
    transform: translateY(0);
}

.view-bio-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Bio Modal */
.voting-bio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.voting-bio-modal.show {
    display: flex !important;
}

.voting-bio-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 650px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    position: relative;
}

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

/* Bio Modal Header */
.bio-modal-header {
    background: linear-gradient(135deg, var(--primary-color, #007cba) 0%, var(--secondary-color, #005a87) 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.bio-candidate-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.bio-candidate-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bio-candidate-photo .placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
}

.bio-candidate-photo .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: white;
}

.bio-candidate-name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Bio Modal Body */
.bio-modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: 450px;
    flex: 1;
}

.bio-candidate-content {
    line-height: 1.7;
    font-size: 15px;
    color: #444;
    text-align: left;
    margin: 0;
}

.bio-candidate-content h1,
.bio-candidate-content h2,
.bio-candidate-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--primary-color, #007cba);
    font-weight: 600;
}

.bio-candidate-content h1 {
    font-size: 24px;
}

.bio-candidate-content h2 {
    font-size: 20px;
}

.bio-candidate-content h3 {
    font-size: 18px;
}

.bio-candidate-content p {
    margin-bottom: 14px;
    text-align: left;
    line-height: 1.6;
}

.bio-candidate-content ul,
.bio-candidate-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.bio-candidate-content li {
    margin-bottom: 8px;
}

.bio-candidate-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bio-candidate-content blockquote {
    border-left: 4px solid var(--primary-color, #007cba);
    padding: 16px 20px;
    margin: 20px 0;
    background: rgba(0, 124, 186, 0.05);
    border-radius: 4px;
    font-style: italic;
}

.bio-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.bio-loading .dashicons {
    animation: spin 1s linear infinite;
}

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

.bio-error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}

/* Bio Modal Footer */
.bio-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
}

.vote-from-bio-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.vote-from-bio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.vote-from-bio-btn:active {
    transform: translateY(0);
}

.vote-from-bio-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Responsive Bio Modal */
@media (max-width: 768px) {
    .voting-bio-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .bio-modal-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .bio-candidate-photo {
        width: 100px;
        height: 100px;
    }
    
    .bio-candidate-name {
        font-size: 24px;
    }
    
    .bio-modal-body {
        padding: 20px;
    }
    
    .bio-candidate-content {
        font-size: 15px;
    }
    
    .vote-from-bio-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .voting-bio-modal {
        padding: 10px;
    }
    
    .bio-modal-header {
        padding: 15px;
    }
    
    .bio-candidate-photo {
        width: 80px;
        height: 80px;
    }
    
    .bio-candidate-name {
        font-size: 20px;
    }
    
    .bio-modal-body {
        padding: 15px;
    }
    
    .bio-modal-footer {
        padding: 15px;
    }
}
