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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main layout */
.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Wheel section */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.wheel-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: white;
}

.wheel-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #ff4757;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.spin-button {
    position: absolute;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 5;
}

.spin-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

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

.spin-text {
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Winner display */
.winner-display {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 300px;
    animation: bounceIn 0.8s ease-out;
}

.winner-display.hidden {
    display: none;
}

.winner-display h2 {
    color: #ff6b6b;
    margin: 10px 0;
    font-size: 1.8rem;
}

.winner-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
    word-break: break-word;
}

.celebration {
    font-size: 2rem;
    animation: bounce 1s infinite;
}

/* List section */
.list-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: fit-content;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.clear-button {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.clear-button:hover {
    background: #ff3838;
}

.add-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.bulk-add {
    margin-bottom: 20px;
}

#nameInput, #bulkInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#nameInput:focus, #bulkInput:focus {
    outline: none;
    border-color: #667eea;
}

#bulkInput {
    width: 100%;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.add-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.add-button:hover {
    background: #5a67d8;
}

.entries-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.entries-list {
    list-style: none;
}

.entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.entry-item:hover {
    background: #f8f9fa;
}

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

.entry-name {
    flex: 1;
    word-break: break-word;
}

.remove-button {
    background: #ff4757;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.remove-button:hover {
    background: #ff3838;
}

/* Celebration overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.celebration-overlay.hidden {
    display: none;
}

.fireworks {
    position: relative;
    width: 100%;
    height: 100%;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework 1.5s ease-out infinite;
}

.firework:nth-child(1) {
    top: 20%;
    left: 20%;
    background: #ff6b6b;
    animation-delay: 0s;
}

.firework:nth-child(2) {
    top: 30%;
    right: 20%;
    background: #4ecdc4;
    animation-delay: 0.5s;
}

.firework:nth-child(3) {
    bottom: 30%;
    left: 30%;
    background: #ffe66d;
    animation-delay: 1s;
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes firework {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 currentColor;
    }
    100% {
        transform: scale(10);
        opacity: 0;
        box-shadow: 0 0 0 20px transparent;
    }
}

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

/* Responsive design */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #wheelCanvas {
        width: 300px;
        height: 300px;
    }
    
    .winner-display {
        min-width: 250px;
    }
    
    .add-entry {
        flex-direction: column;
    }
    
    .list-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Custom scrollbar */
.entries-container::-webkit-scrollbar {
    width: 8px;
}

.entries-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.entries-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.entries-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}