/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d32f2f;
    --primary-dark: #b71c1c;
    --secondary-color: #2e7d32;
    --accent-color: #ff6f00;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Pages */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card h1 {
    color: var(--primary-color);
    font-size: 32px;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.card h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 16px;
}

/* Formulaires */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Boutons */
.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

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

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

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.btn-large {
    padding: 18px 30px;
    font-size: 18px;
    width: 100%;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #f57c00);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f57c00, var(--warning-color));
}

/* Participants */
.participants-list {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.info-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.participant-item {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.participant-item:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.participant-item.admin-item {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-color: var(--accent-color);
}

.participant-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.participant-code {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

/* Messages */
.error-message {
    color: var(--error-color);
    background: #ffebee;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.success-message {
    color: var(--success-color);
    background: #e8f5e9;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.success-message:not(:empty) {
    display: block;
}

/* Recipient Box */
.recipient-box {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 3px solid var(--primary-color);
}

.recipient-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: capitalize;
}

/* Wishlist Display */
.wishlist-display {
    background: #fafafa;
    padding: 20px;
    border-radius: 10px;
    min-height: 100px;
    border: 2px dashed var(--border-color);
}

.wishlist-content {
    color: var(--text-primary);
}

.wishlist-content ul {
    list-style: none;
    padding: 0;
}

.wishlist-content li {
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.empty-message {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Admin */
.admin-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-controls input {
    flex: 1;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-participant-item {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
}

.admin-participant-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-participant-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    text-transform: capitalize;
}

.admin-participant-code {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.admin-recipient {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: capitalize;
}

.draw-result {
    margin-top: 15px;
    min-height: 50px;
}

/* Wishlists Container */
.wishlists-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wishlist-item {
    background: #fafafa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.wishlist-item h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    text-transform: capitalize;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.recipient-box {
    animation: pulse 2s infinite;
}

/* Responsive - Mobile First */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card h1 {
        font-size: 28px;
    }
    
    .participants-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .admin-controls {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .header h2 {
        text-align: center;
    }
}

/* Améliorations visuelles */
.card h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    margin-right: 8px;
    border-radius: 2px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s;
}

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

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-content h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.modal-content input {
    width: 100%;
    margin-bottom: 15px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 5px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.modal-content .btn {
    width: 100%;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

