/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --primary-dark: #357abd;
    --secondary-color: #6c757d;
    --success-color: #6bcf7f;
    --danger-color: #ff6b6b;
    --warning-color: #ffd93d;
    --background: #0a0e1a;
    --text-color: #333;
    --text-color-light: #666;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Optimisations mobile */
    -webkit-tap-highlight-color: rgba(74, 144, 226, 0.2);
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 15px;
    padding: 5px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

@media (min-width: 769px) {
    .header {
        margin-bottom: 20px;
        padding: 5px;
    }
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

@media (min-width: 769px) {
    .header h1 {
        font-size: 2rem;
    }
}

.header-title-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 769px) {
    .header-title-image {
        max-width: 500px;
    }
}

.header p {
    color: #666;
    font-size: 1rem;
}

.warning-message {
    background-color: rgba(212, 175, 55, 0.15);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 0 0 15px 0;
    color: #f4d03f;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

@media (min-width: 769px) {
    .warning-message {
        font-size: 0.95rem;
        padding: 15px 20px;
        margin: 0 0 20px 0;
    }
}

/* Flèche de scroll */
.scroll-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #d4af37 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
    z-index: 999;
    color: #1a1a1a;
    animation: bounce 2s infinite;
    transition: all 0.3s ease;
}

.scroll-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.7);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .scroll-indicator {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

.round-info {
    margin-bottom: 20px;
    text-align: center;
}

.round-badge {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #d4af37 100%);
    color: #1a1a1a;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Messages d'attente et de confirmation */
.waiting-message,
.confirmation-message {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

.waiting-content,
.confirmation-content {
    max-width: 500px;
    margin: 0 auto;
}

.waiting-icon,
.success-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.waiting-message h2,
.confirmation-message h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.waiting-message p,
.confirmation-message p {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

/* Section de vote */
.voting-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px 15px;
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

/* Message de confirmation intégré dans la section de vote */
.voting-section .confirmation-content {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.voting-section .success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.voting-section .confirmation-content h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.voting-section .confirmation-content p {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    padding: 0 10px;
}

@media (min-width: 769px) {
    .voting-section {
        padding: 30px;
    }
    
    .voting-section .confirmation-content h2 {
        font-size: 1.8rem;
    }
    
    .voting-section .confirmation-content p {
        font-size: 1.1rem;
    }
}

.voting-section h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    text-align: center;
    color: var(--text-color);
}

@media (min-width: 769px) {
    .voting-section h2 {
        font-size: 1.8rem;
    }
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

/* Catégories */
.category-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.category-section:last-child {
    border-bottom: none;
}

.category-header {
    text-align: center;
    margin-bottom: 25px;
}

.category-header h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.category-description {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
}

.category-vote-status {
    font-size: 0.9rem;
    color: #999;
    margin-top: 10px;
}

/* Grille des nominés - Mobile first */
.nominees-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

@media (min-width: 769px) {
    .nominees-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 40px;
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
}

.nominee-card {
    background: #f9f9f9;
    border-radius: var(--border-radius);
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    /* Optimisation tactile mobile */
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(74, 144, 226, 0.2);
}

@media (min-width: 769px) {
    .nominee-card {
        padding: 15px;
    }
}

.nominee-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.nominee-card.selected {
    border-color: var(--primary-color);
    background: #e8f4fd;
}

.nominee-image {
    width: 100%;
    height: 250px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #e0e0e0;
}

@media (min-width: 769px) {
    .nominee-image {
        height: 400px;
    }
}

@media (min-width: 1200px) {
    .nominee-image {
        height: 500px;
    }
}

.nominee-image img,
.nominee-image video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.nominee-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nominee-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nominee-select input[type="radio"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary-color);
    /* Zone tactile minimum 44x44px */
    margin: 12px;
}

@media (min-width: 769px) {
    .nominee-select input[type="radio"] {
        width: 20px;
        height: 20px;
        margin: 0;
    }
}

.nominee-select label {
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
}

/* Section email */
.email-section {
    max-width: 500px;
    margin: 30px auto 0;
    text-align: center;
}

.email-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.email-section input {
    width: 100%;
    padding: 16px;
    font-size: 16px; /* Évite le zoom automatique sur iOS */
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

@media (min-width: 769px) {
    .email-section input {
        font-size: 1rem;
    }
}

.email-section input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Navigation entre catégories */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Boutons */
.btn-primary,
.btn-secondary {
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Zone tactile mobile optimale */
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

@media (min-width: 769px) {
    .btn-primary,
    .btn-secondary {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    max-width: 400px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    min-width: 200px;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Messages d'erreur */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger-color);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    z-index: 1000;
    animation: slideDown 0.3s ease;
    max-width: 90%;
    text-align: center;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Classe utilitaire */
.hidden {
    display: none !important;
}

/* Container pour le bouton de vote */
.submit-vote-container {
    max-width: 500px;
    margin: 30px auto 0;
    text-align: center;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    color: #333;
}

.modal-close:hover {
    background: white;
    transform: scale(1.1);
}

/* Modal image */
.modal-content-image {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content-image img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* Modal vote */
.modal-content-vote {
    position: relative;
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content-vote h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.6rem;
}

.modal-body {
    text-align: center;
}

.modal-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.modal-body input {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.modal-body input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-hint {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0 20px;
    text-align: center;
}

.modal-body .btn-primary {
    width: 100%;
    max-width: 100%;
}

/* Image cliquable avec curseur pointer */
.nominee-image {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.nominee-image:hover {
    opacity: 0.9;
}

/* Mobile optimisations pour les modals */
@media (max-width: 768px) {
    .modal-content-vote {
        padding: 25px 20px;
        width: 95%;
    }
    
    .modal-content-vote h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    
    .submit-vote-container {
        margin-top: 20px;
    }
}

/* Améliorations spécifiques mobiles */
@media (max-width: 768px) {
    /* Espacement optimisé */
    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .email-section {
        margin-top: 20px;
    }
    
    .email-section label {
        font-size: 1rem;
    }
    
    /* Messages d'attente */
    .waiting-message,
    .confirmation-message {
        padding: 40px 15px;
    }
    
    .waiting-icon,
    .success-icon {
        font-size: 3rem;
    }
    
    .waiting-message h2,
    .confirmation-message h2 {
        font-size: 1.5rem;
    }
    
    .waiting-message p,
    .confirmation-message p {
        font-size: 1rem;
        padding: 0 10px;
    }
}

/* Support iOS et Safari mobile */
@supports (-webkit-touch-callout: none) {
    /* Fix pour iOS overflow */
    .nominee-card {
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    /* Éviter les problèmes de scroll sur iOS */
    body {
        position: relative;
        overflow-x: hidden;
    }
}

/* Amélioration de l'accessibilité tactile */
@media (hover: none) and (pointer: coarse) {
    /* Désactiver les effets hover sur tactile */
    .nominee-card:hover {
        transform: none;
    }
    
    .btn-primary:hover:not(:disabled),
    .btn-secondary:hover:not(:disabled) {
        transform: none;
    }
}

/* Mode paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .nominee-image {
        height: 180px;
    }
    
    .header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .voting-section {
        padding: 15px;
    }
}
