/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

.header-content p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 10px rgba(255,255,255,0.2); }
    to { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(255,255,255,0.4); }
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Cards */
.input-card, .wheel-card, .history-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid #0EA5E9;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.input-card:hover, .wheel-card:hover, .history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.input-card h2, .wheel-card h2, .history-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0EA5E9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Input Section */
.method-tabs {
    display: flex;
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 10px;
    padding: 5px;
    border: 2px solid #0EA5E9;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn.active {
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.tab-content {
    display: none;
}

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

#bulk-input {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#bulk-input:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.input-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.single-input-group {
    display: flex;
    gap: 10px;
}

#single-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#single-input:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-2px);
}

.btn-spin {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    font-size: 1.2rem;
    padding: 15px 30px;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
    animation: pulse 2s infinite;
}

.btn-spin:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

.btn-spin:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    animation: none;
}

@keyframes pulse {
    0% { box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4); }
    50% { box-shadow: 0 6px 20px rgba(72, 187, 120, 0.6), 0 0 0 10px rgba(72, 187, 120, 0.1); }
    100% { box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4); }
}

/* Participants */
.participants-section {
    margin-top: 30px;
}

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

.participants-header h3 {
    font-size: 1.2rem;
    color: #0EA5E9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.participants-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #0EA5E9;
    border-radius: 10px;
    padding: 15px;
    background: #ffffff;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #0EA5E9;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.participant-item:hover {
    background: #f0f9ff;
    transform: translateX(5px);
}

.participant-name {
    font-weight: 500;
    color: #2d3748;
}

.remove-participant {
    background: #fed7d7;
    color: #e53e3e;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-participant:hover {
    background: #feb2b2;
    transform: scale(1.1);
}

.empty-state, .empty-history {
    text-align: center;
    color: #a0aec0;
    padding: 40px 20px;
}

.empty-state i, .empty-history i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

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

/* Wheel Section */
.wheel-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    width: 100%;
    overflow: hidden;
}

.wheel-pointer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 2.5rem;
    color: #e53e3e;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
    display: block;
    margin: 0 auto;
    width: 400px;
    height: 400px;
    max-width: 90vw;
    max-height: 90vh;
    animation: none;
}

#wheel-canvas.spinning {
    animation: wheelGlow 1s ease-in-out infinite alternate, spinningPulse 2s ease-in-out infinite;
}

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

.wheel-center {
    position: absolute;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 6px solid #ffffff;
    z-index: 5;
}

@keyframes wheelGlow {
    from { 
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        transform: scale(1);
    }
    to { 
        box-shadow: 0 15px 40px rgba(14, 165, 233, 0.4), 0 0 30px rgba(14, 165, 233, 0.2);
        transform: scale(1.02);
    }
}

.wheel-controls {
    text-align: center;
}

.spin-settings {
    margin-top: 15px;
}

.spin-settings label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #0EA5E9;
    cursor: pointer;
}

/* Winner Display */
.winner-display {
    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.5s ease;
}

.winner-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: bounceIn 0.6s ease;
    max-width: 400px;
    width: 90%;
}

.winner-content i {
    font-size: 3rem;
    color: #f6ad55;
    margin-bottom: 20px;
    animation: rotate 2s linear infinite;
}

.winner-content h3 {
    font-size: 2rem;
    color: #0EA5E9;
    margin-bottom: 20px;
}

.winner-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0EA5E9;
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
    padding: 15px;
    border: 2px solid #0EA5E9;
    border-radius: 10px;
    background-color: #ffffff;
}

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

@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 rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* History Section */
.history-section {
    grid-column: 1 / -1;
}

.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

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

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #ffffff;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 2px solid #0EA5E9;
    animation: slideIn 0.3s ease;
}

.history-winner {
    font-weight: 600;
    color: #0EA5E9;
}

.history-time {
    color: #06B6D4;
    font-size: 0.9rem;
}

/* Confetti */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header-content h1 {
        font-size: 2.5rem;
    }
    
    #wheel-canvas {
        width: 400px;
        height: 400px;
    }
    
    /* Spinning wheel size for tablet */
    #wheel-canvas.spinning {
        width: 550px !important;
        height: 550px !important;
    }
    
    .wheel-center {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .wheel-pointer {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .input-card, .wheel-card, .history-card {
        padding: 20px;
    }
    
    .wheel-container {
        margin: 20px 0;
        padding: 0 10px;
    }
    
    #wheel-canvas {
        width: 350px;
        height: 350px;
    }
    
    /* Spinning wheel size for mobile */
    #wheel-canvas.spinning {
        width: 450px !important;
        height: 450px !important;
    }
    
    .wheel-center {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .wheel-pointer {
        font-size: 2rem;
    }
    
    .participants-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .history-controls {
        flex-direction: column;
    }
    
    .single-input-group {
        flex-direction: column;
    }
    
    .input-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .method-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        margin-bottom: 5px;
    }
    
    .wheel-container {
        margin: 15px 0;
        padding: 0 5px;
    }
    
    #wheel-canvas {
        width: 300px;
        height: 300px;
        max-width: calc(100vw - 30px);
    }
    
    /* Spinning wheel size for small mobile */
    #wheel-canvas.spinning {
        width: 400px !important;
        height: 400px !important;
        max-width: calc(100vw - 20px) !important;
    }
    
    .wheel-center {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .wheel-pointer {
        font-size: 1.8rem;
        top: 12px;
    }
    
    .winner-content {
        padding: 30px 20px;
    }
    
    .winner-content h3 {
        font-size: 1.5rem;
    }
    
    .winner-name {
        font-size: 1.2rem;
    }
}