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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #334155;
    --text-light: #f1f5f9;
    --text-gray: #94a3b8;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gold-gradient: linear-gradient(135deg, #ffd700, #ffed4e);
    --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    --glow: 0 0 20px rgba(99, 102, 241, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        var(--bg-dark);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Header */
.header {
    padding: 2rem 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

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

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-gray);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.back-link:hover {
    color: var(--text-light);
    background: var(--gradient);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.logo-section {
    text-align: center;
    flex: 1;
}

.header-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 15px;
    box-shadow: var(--glow);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.logo-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.logo-section p {
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    align-items: start;
}

/* Configuration Section */
.config-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: var(--shadow);
    position: sticky;
    top: 2rem;
}

.config-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.input-row {
    display: flex;
    gap: 0.75rem;
}

.input-row input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-add {
    padding: 0.75rem 1.5rem;
    background: var(--gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

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

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

/* Lists */
.participants-list,
.prizes-list {
    margin-bottom: 2rem;
}

.participants-list h3,
.prizes-list h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.participants-container,
.prizes-container {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-light);
    border-radius: 10px;
    padding: 1rem;
}

.participants-container::-webkit-scrollbar,
.prizes-container::-webkit-scrollbar {
    width: 4px;
}

.participants-container::-webkit-scrollbar-track,
.prizes-container::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 2px;
}

.participants-container::-webkit-scrollbar-thumb,
.prizes-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.participant-item,
.prize-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.participant-item:hover,
.prize-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.participant-name,
.prize-name {
    font-weight: 500;
    color: var(--text-light);
}

.remove-btn {
    background: var(--error-color);
    border: none;
    color: white;
    padding: 0.4rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.no-participants,
.no-prizes,
.no-history {
    text-align: center;
    color: var(--text-gray);
    padding: 2rem 1rem;
}

.no-participants i,
.no-prizes i,
.no-history i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Wheel Section */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.wheel-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: var(--accent-color);
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: pointerBounce 2s ease-in-out infinite;
}

@keyframes pointerBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

.wheel {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    position: relative;
    background: var(--bg-card);
    border: 8px solid var(--accent-color);
    box-shadow: 
        var(--shadow),
        0 0 50px rgba(245, 158, 11, 0.3),
        inset 0 0 50px rgba(0, 0, 0, 0.2);
    transition: transform 4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    margin: 0 auto;
    display: block;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.center-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 0.25rem;
}

.center-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.center-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

.wheel-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.wheel-segment-svg {
    transition: all 0.3s ease;
    cursor: pointer;
}

.wheel-segment-svg:hover {
    filter: brightness(1.1);
    stroke-width: 3;
}

.empty-wheel-message {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.empty-wheel-message i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-wheel-message p {
    max-width: 200px;
}

.spin-btn {
    padding: 1.5rem 3rem;
    background: var(--gold-gradient);
    border: none;
    border-radius: 50px;
    color: var(--bg-dark);
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 
        var(--shadow),
        0 0 30px rgba(255, 215, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        var(--shadow),
        0 0 40px rgba(255, 215, 0, 0.6);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
}

.spin-btn:disabled {
    background: var(--text-gray);
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

.spin-btn.spinning {
    background: var(--error-color);
    animation: spinBtnPulse 0.5s ease-in-out infinite alternate;
}

@keyframes spinBtnPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.wheel-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.control-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Results Section */
.results-container {
    position: sticky;
    top: 2rem;
}

.current-result {
    margin-bottom: 2rem;
}

.result-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 
        var(--shadow),
        0 0 30px rgba(16, 185, 129, 0.2);
    animation: resultSlideIn 0.5s ease-out;
}

@keyframes resultSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    animation: resultIconBounce 1s ease-in-out infinite;
}

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

.result-card h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.winner-info {
    margin-bottom: 2rem;
}

.winner-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.winner-prize {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 600;
}

.result-btn {
    padding: 1rem 2rem;
    background: var(--gradient);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* History */
.history-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: var(--shadow);
}

.history-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-container {
    max-height: 300px;
    overflow-y: auto;
}

.history-container::-webkit-scrollbar {
    width: 4px;
}

.history-container::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 2px;
}

.history-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--success-color);
    transition: all 0.3s ease;
    animation: historyItemSlide 0.3s ease-out;
}

@keyframes historyItemSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-item:hover {
    background: var(--bg-card);
    transform: translateX(5px);
}

.history-number {
    background: var(--success-color);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    font-weight: 600;
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.history-info {
    flex: 1;
}

.history-winner {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.history-prize {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.history-time {
    color: var(--text-gray);
    font-size: 0.8rem;
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: var(--accent-color);
    border-radius: 50%;
    animation: particleFloat 6s linear infinite;
    opacity: 0.6;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    animation: confettiFall 3s linear infinite;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .config-card,
    .results-container {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .back-link {
        align-self: flex-start;
    }
    
    .main-content {
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .wheel {
        width: 300px;
        height: 300px;
    }
    
    .wheel-center {
        width: 80px;
        height: 80px;
    }
    
    .center-logo {
        width: 30px;
        height: 30px;
    }
    
    .center-text {
        font-size: 0.6rem;
    }
    
    .segment-content {
        font-size: 0.7rem;
    }
    
    .spin-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .config-card,
    .history-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .wheel {
        width: 250px;
        height: 250px;
    }
    
    .spin-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .input-row {
        flex-direction: column;
    }
    
    .wheel-controls {
        flex-direction: column;
        align-items: center;
    }
}

/* Animations spéciales */
.wheel.spinning {
    animation: wheelGlow 2s ease-in-out infinite alternate;
}

@keyframes wheelGlow {
    from {
        box-shadow: 
            var(--shadow),
            0 0 50px rgba(245, 158, 11, 0.3),
            inset 0 0 50px rgba(0, 0, 0, 0.2);
    }
    to {
        box-shadow: 
            var(--shadow),
            0 0 80px rgba(245, 158, 11, 0.6),
            inset 0 0 50px rgba(0, 0, 0, 0.2);
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* États de focus pour l'accessibilité */
button:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Transitions fluides */
* {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
