:root {
    --primary-color: #6c5ce7;
    --secondary-color: #fd79a8;
    --success-color: #00b894;
    --danger-color: #d63031;
    --warning-color: #fdcb6e;
    --dark-bg: #1a1a2e;
    --light-bg: #16213e;
    --card-bg: #0f3460;
    --text-light: #ffffff;
    --text-gray: #a8a8a8;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
header {
    background: var(--light-bg);
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
    animation: pulse 2s ease-in-out infinite;
}

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

header h1 {
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
}

/* Section Compteur */
.counter-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.counter-container {
    text-align: center;
}

.counter-title {
    font-size: 3rem;
    margin-bottom: 3rem;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.counter {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.counter-item {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    min-width: 150px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.counter-item:nth-child(1) { animation-delay: 0.1s; }
.counter-item:nth-child(2) { animation-delay: 0.2s; }
.counter-item:nth-child(3) { animation-delay: 0.3s; }
.counter-item:nth-child(4) { animation-delay: 0.4s; }

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

.counter-item:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 15px 50px rgba(108, 92, 231, 0.5);
}

.counter-number {
    display: block;
    font-size: 4rem;
    font-weight: bold;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.counter-label {
    display: block;
    font-size: 1.2rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Canvas Feu d'artifice */
#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    display: none;
}

#fireworksCanvas.active {
    display: block;
}

/* Message Bonne Année */
.new-year-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    padding: 2rem;
}

.new-year-message h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.new-year-message p {
    font-size: 2rem;
    color: var(--warning-color);
}

.animate-text {
    animation: bounceIn 1s ease;
}

.animate-text-delay {
    animation: bounceIn 1s ease 0.5s forwards;
    opacity: 0;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Section Vœux */
.wishes-section {
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

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

.wishes-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Barre de recherche */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    background: var(--card-bg);
    color: var(--text-light);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.5);
    transform: scale(1.02);
}

.search-input::placeholder {
    color: var(--text-gray);
}

.btn-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Liste des vœux */
.wishes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.wish-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.wish-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.4);
    border-color: var(--primary-color);
}

.wish-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wish-author {
    font-weight: bold;
    color: var(--secondary-color);
}

.wish-date {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.wish-content {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--card-bg);
    color: var(--text-light);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.page-btn.active {
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.5);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

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

.wish-form-modal {
    background: rgba(15, 52, 96, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(108, 92, 231, 0.5);
    max-width: 600px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary-color);
}

/* Formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(108, 92, 231, 0.3);
    border-radius: 10px;
    background: var(--dark-bg);
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-light);
    border: 2px solid var(--text-gray);
}

.btn-secondary:hover {
    border-color: var(--text-light);
}

/* Panel Admin */
.admin-panel {
    max-width: 900px;
    width: 95%;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-close {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-close:hover {
    transform: rotate(90deg) scale(1.1);
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    color: var(--text-gray);
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-light);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-wishes-list {
    max-height: 500px;
    overflow-y: auto;
}

.admin-wish-card {
    background: var(--dark-bg);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 2px solid rgba(108, 92, 231, 0.3);
}

.admin-wish-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-wish-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-approve {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-approve:hover {
    transform: scale(1.05);
}

.btn-reject {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reject:hover {
    transform: scale(1.05);
}

.btn-delete {
    background: var(--warning-color);
    color: var(--dark-bg);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    transform: scale(1.05);
}

/* Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-color);
    animation: slideIn 0.3s ease;
}

.popup-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Popup d'accueil */
.welcome-popup {
    max-width: 600px;
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--card-bg) 100%);
    border: 3px solid var(--primary-color);
    box-shadow: 0 25px 70px rgba(108, 92, 231, 0.4);
}

.welcome-popup h2 {
    font-size: 1.8rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite;
}

.welcome-popup a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6);
}

/* Bouton Installation PWA */
.install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.5);
    transition: all 0.3s ease;
    z-index: 999;
}

.install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(108, 92, 231, 0.7);
}

/* Footer */
footer {
    background: var(--light-bg);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 2px solid rgba(108, 92, 231, 0.3);
}

/* Classes utilitaires */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .counter-title {
        font-size: 2rem;
    }
    
    .counter-number {
        font-size: 2.5rem;
    }
    
    .counter-label {
        font-size: 0.9rem;
    }
    
    .new-year-message h1 {
        font-size: 2rem;
    }
    
    .new-year-message p {
        font-size: 1.2rem;
    }
    
    header h1 {
        font-size: 1.1rem;
    }
    
    .logo {
        height: 40px;
    }
    
    .wishes-list {
        grid-template-columns: 1fr;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
