/* 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;
    transition: all 0.3s ease;
}

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

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

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(6, 182, 212, 0.1));
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

#language-select {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid #0EA5E9;
    border-radius: 10px;
    padding: 10px 15px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #0EA5E9;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
    backdrop-filter: blur(10px);
    min-width: 180px;
}

#language-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
}

#language-select:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4), 0 0 0 3px rgba(14, 165, 233, 0.1);
}

#language-select option {
    padding: 10px;
    font-weight: 600;
    background: white;
    color: #0EA5E9;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.3),
        0 0 20px rgba(255,255,255,0.3);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.header-content p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

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

/* Cards */
.input-card, .wheel-card, .history-card, .prize-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.1),
        0 1px 3px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    border: 1px solid rgba(14, 165, 233, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    height: fit-content;
    min-height: 800px;
}

.input-card::before, .wheel-card::before, .history-card::before, .prize-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.3), transparent);
}

.input-card:hover, .wheel-card:hover, .history-card:hover, .prize-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.15),
        0 10px 30px rgba(14, 165, 233, 0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

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

/* Input Section */
.input-section {
    height: 100%;
}

.input-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.tab-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    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);
}

/* Mode Selection */
.mode-selection {
    margin-bottom: 30px;
}

.mode-tabs {
    display: flex;
    background: #ffffff;
    border-radius: 10px;
    padding: 5px;
    border: 2px solid #0EA5E9;
}

.mode-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

/* Prize Mode Selection */
.prize-mode-selection {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    border: 2px solid #0EA5E9;
}

.prize-mode-selection h3 {
    font-size: 1.3rem;
    color: #0EA5E9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.prize-mode-tabs {
    display: flex;
    background: #ffffff;
    border-radius: 10px;
    padding: 5px;
    border: 2px solid #0EA5E9;
    margin-bottom: 15px;
}

.prize-mode-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
}

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

.prize-mode-info {
    position: relative;
}

.mode-info {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 8px;
    color: #0EA5E9;
    font-size: 1rem;
    font-weight: 600;
}

.mode-info.active {
    display: flex;
}

.mode-info i {
    font-size: 1rem;
}

/* Auto Mode Controls */
.auto-settings {
    margin-bottom: 15px;
    text-align: center;
}

.auto-settings label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #0EA5E9;
}

.auto-settings select {
    padding: 8px 15px;
    border: 2px solid #0EA5E9;
    border-radius: 8px;
    font-family: inherit;
    background: white;
    color: #0EA5E9;
    font-weight: 500;
}

.auto-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-auto-start {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-auto-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.6);
}

.btn-auto-stop {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
    position: relative;
    z-index: 1500; /* Higher than winner display */
}

.btn-auto-stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.6);
}

.auto-status {
    margin-top: 15px;
    text-align: center;
}

.countdown {
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    animation: pulse 1s infinite;
}

.auto-prize-warning {
    margin-top: 15px;
    text-align: center;
}

.warning-message {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid #fc8181;
    animation: warningPulse 2s infinite;
}

/* Auto controls container with higher z-index when stop button is visible */
.auto-controls {
    position: relative;
    z-index: 1001;
}

@keyframes warningPulse {
    0% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(197, 48, 48, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.4); }
}

.tab-content {
    display: none;
}

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

#bulk-input {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    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: 20px;
}

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

#single-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    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: 15px 30px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

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

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

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

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.6);
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.4);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.6);
}

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

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

@keyframes spinButtonPulse {
    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 5px rgba(72, 187, 120, 0.1); }
    100% { box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4); }
}

/* Participants - Updated with fixed height and scroll */
.participants-section {
    margin-top: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

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

/* Updated participants list with fixed height and scroll */
.participants-list {
    height: 350px; /* Fixed height */
    max-height: 350px; /* Enforce maximum height */
    overflow-y: auto; /* Enable vertical scroll */
    border: 2px solid #0EA5E9;
    border-radius: 10px;
    padding: 20px;
    background: #ffffff;
    position: relative; /* For custom scrollbar positioning */
}

/* Custom scrollbar for participants list */
.participants-list::-webkit-scrollbar {
    width: 8px;
}

.participants-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.participants-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    border-radius: 10px;
}

.participants-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0284c7, #0891b2);
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 12px;
    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: 600;
    font-size: 1rem;
    color: #2d3748;
}

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

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

.empty-state, .empty-history, .empty-prizes {
    text-align: center;
    color: #a0aec0;
    padding: 60px 30px;
}

.empty-state i, .empty-history i, .empty-prizes i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

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

/* Prize Section */
.prize-section {
    height: 100%;
    width: 100%;
    display: none;
}

.prize-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.prize-input-methods {
    margin-bottom: 40px;
}

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

.prize-tab-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.prize-tab-content {
    display: none;
}

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

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

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

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

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

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

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

.prizes-section {
    margin-top: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

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

/* Updated prizes list with fixed height and scroll */
.prizes-list {
    height: 300px; /* Fixed height */
    max-height: 300px; /* Enforce maximum height */
    overflow-y: auto; /* Enable vertical scroll */
    border: 2px solid #0EA5E9;
    border-radius: 10px;
    padding: 20px;
    background: #ffffff;
    width: 100%;
    position: relative; /* For custom scrollbar positioning */
}

/* Custom scrollbar for prizes list */
.prizes-list::-webkit-scrollbar {
    width: 8px;
}

.prizes-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.prizes-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    border-radius: 10px;
}

.prizes-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0284c7, #0891b2);
}

.prize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #0EA5E9;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

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

.prize-item.current-prize {
    background: linear-gradient(135deg, #fef5e7, #fed7aa);
    border-color: #f59e0b;
}

.prize-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.prize-name {
    font-weight: 600;
    font-size: 1rem;
    color: #2d3748;
}

.current-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.remove-prize {
    background: #fed7d7;
    color: #e53e3e;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

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

/* Wheel Section */
.wheel-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.wheel-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    position: relative;
    overflow: hidden;
}

.wheel-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0 0 0;
    width: 100%;
    flex: 1;
    min-height: 600px;
    overflow: visible;
}

.wheel-pointer {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 4rem;
    color: #e53e3e;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
    transition: none;
    will-change: auto;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.8),
        0 0 10px rgba(229, 62, 62, 0.6),
        0 0 20px rgba(229, 62, 62, 0.4);
    animation: pointerPulse 1.5s ease-in-out infinite;
}

@keyframes pointerPulse {
    0% { 
        transform: translateX(-50%) scale(1);
        filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
    }
    50% { 
        transform: translateX(-50%) scale(1.1);
        filter: drop-shadow(0 4px 12px rgba(229, 62, 62, 0.8));
    }
    100% { 
        transform: translateX(-50%) scale(1);
        filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
    }
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.3),
        0 0 0 5px #e53e3e,
        0 0 0 8px rgba(229, 62, 62, 0.3);
    transition: none;
    display: block;
    margin: 0 auto;
    width: 500px;
    height: 500px;
    max-width: 500px;
    max-height: 500px;
    animation: none;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    position: relative;
}

#wheel-canvas.spinning {
    box-shadow: 
        0 15px 40px rgba(14, 165, 233, 0.4), 
        0 0 30px rgba(14, 165, 233, 0.2),
        0 0 0 3px #e53e3e,
        0 0 0 6px rgba(229, 62, 62, 0.5),
        0 0 50px rgba(229, 62, 62, 0.3);
}

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

/* Enhanced arrow pointer */
.wheel-pointer i {
    animation: arrowPulse 1s ease-in-out infinite;
}

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

/* Spin Button Container - Positioned directly below wheel */
.spin-button-container {
    display: flex;
    justify-content: center;
    margin: -10px 0 20px 0;
    padding: 0;
}

.spin-button-container .btn-spin {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    font-size: 1.4rem;
    padding: 20px 40px;
    box-shadow: 
        0 6px 20px rgba(72, 187, 120, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
    animation: spinButtonPulse 2s infinite;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.spin-button-container .btn-spin:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(72, 187, 120, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.spin-button-container .btn-spin:disabled {
    background: linear-gradient(135deg, #a0aec0, #718096);
    cursor: not-allowed;
    animation: none;
    opacity: 0.6;
}

.wheel-controls {
    text-align: center;
    position: relative;
    z-index: 1;
}

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

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

/* Winner Display - Modified to not cover auto controls */
.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;
    pointer-events: none; /* Allow clicks to pass through to elements below */
}

.winner-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: bounceIn 0.6s ease;
    max-width: 500px;
    width: 90%;
    pointer-events: auto; /* Enable clicks within the winner content */
}

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

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

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

.winner-prize {
    margin-bottom: 30px;
}

.prize-info {
    background: linear-gradient(135deg, #fef5e7, #fed7aa);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #92400e;
}

.prize-info i {
    font-size: 1.8rem;
    color: #f59e0b;
    animation: none;
}

.winner-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

@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;
}

/* Export Section */
.export-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-item.cancelled {
    background: #fef2f2;
    border-color: #fca5a5;
}

.history-winner {
    font-weight: 600;
    color: #0EA5E9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-prize {
    color: #f59e0b;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 5px 0;
}

.cancelled-badge {
    background: #fca5a5;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ok-badge {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

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

/* Export Section */
.export-section {
    grid-column: 1 / -1;
}

.export-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modal Styles */
.modal {
    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;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: bounceIn 0.4s ease;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid #0EA5E9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: center;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
}

/* Winners Table */
.winners-table-container {
    overflow-x: auto;
}

.winners-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.winners-table th,
.winners-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.winners-table th {
    background: linear-gradient(135deg, #0EA5E9, #06B6D4);
    color: white;
    font-weight: 600;
    text-align: center;
}

.winners-table td {
    text-align: center;
}

.winners-table tbody tr:hover {
    background: #f0f9ff;
}

.winners-table tbody tr:last-child td {
    border-bottom: none;
}

.status-ok {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

.signature-cell {
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #f9fafb;
}

/* 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;
}

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

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white !important;
        font-size: 12pt;
        line-height: 1.4;
        color: #000 !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .header, .main-content, .footer {
        display: none !important;
    }
    
    .modal {
        position: static !important;
        background: none !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .modal-content {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .modal-header {
        background: #0EA5E9 !important;
        color: white !important;
        padding: 20px !important;
        border-radius: 0 !important;
        text-align: center;
        page-break-after: avoid;
    }
    
    .modal-body {
        padding: 20px !important;
    }
    
    .modal-footer {
        display: none !important;
    }
    
    .modal-close {
        display: none !important;
    }
    
    .winners-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 0 !important;
        font-size: 11pt !important;
        page-break-inside: avoid;
    }
    
    .winners-table th {
        background: #0EA5E9 !important;
        color: white !important;
        padding: 12px 8px !important;
        border: 1px solid #000 !important;
        font-weight: bold !important;
        text-align: center !important;
    }
    
    .winners-table td {
        padding: 12px 8px !important;
        border: 1px solid #000 !important;
        text-align: center !important;
        vertical-align: middle !important;
    }
    
    .winners-table tbody tr:nth-child(even) {
        background: #f8f9fa !important;
    }
    
    .signature-cell {
        height: 40px !important;
        background: white !important;
        border: 1px solid #000 !important;
    }
    
    .status-ok {
        background: #d1fae5 !important;
        color: #065f46 !important;
        padding: 4px 8px !important;
        border-radius: 4px !important;
        font-weight: bold !important;
    }
    
    .status-cancelled {
        background: #fee2e2 !important;
        color: #991b1b !important;
        padding: 4px 8px !important;
        border-radius: 4px !important;
        font-weight: bold !important;
    }
    
    /* Print page settings */
    @page {
        margin: 1cm;
        size: A4;
    }
    
    /* Ensure table doesn't break across pages */
    .winners-table {
        page-break-inside: avoid;
    }
    
    .winners-table thead {
        display: table-header-group;
    }
    
    .winners-table tbody {
        display: table-row-group;
    }
}

/* Prize Empty Dialog */
.prize-empty-dialog .dialog-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;
    animation: fadeIn 0.3s ease;
}

.prize-empty-dialog .dialog-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.5s ease;
    max-width: 500px;
    width: 90%;
    margin: 20px;
}

.prize-empty-dialog .dialog-icon {
    font-size: 4rem;
    color: #f59e0b;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.prize-empty-dialog h3 {
    font-size: 1.8rem;
    color: #e53e3e;
    margin-bottom: 20px;
    font-weight: 700;
}

.prize-empty-dialog p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.6;
}

.prize-empty-dialog .dialog-ok-btn {
    margin-top: 20px;
    font-size: 1.1rem;
    padding: 15px 30px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .header-content h1 {
        font-size: 2.5rem;
    }
    
    #wheel-canvas {
        width: 450px;
        height: 450px;
        max-width: 450px;
        max-height: 450px;
    }
    
    .wheel-center {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .wheel-pointer {
        font-size: 3rem;
    }
    
    .wheel-container {
        min-height: 500px;
    }
    
    .input-card, .wheel-card, .history-card, .prize-card {
        min-height: 700px;
    }
    
    /* Adjust list heights for tablet */
    .participants-list {
        height: 300px;
        max-height: 300px;
    }
    
    .prizes-list {
        height: 250px;
        max-height: 250px;
    }
    
    .language-selector {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        text-align: center;
    }
    
    #language-select {
        min-width: 160px;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .container {
        padding: 20px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .input-card, .wheel-card, .history-card, .prize-card {
        padding: 30px;
        width: 100%;
        max-width: none;
        min-height: 600px;
    }
    
    .wheel-container {
        margin: 30px 0 0 0;
        padding: 0 10px;
        min-height: 450px;
    }
    
    #wheel-canvas {
        width: 400px;
        height: 400px;
        max-width: 400px;
        max-height: 400px;
    }
    
    .wheel-center {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .wheel-pointer {
        font-size: 3rem;
        top: 15px;
    }
    
    .spin-button-container .btn-spin {
        font-size: 1.2rem;
        padding: 18px 35px;
    }
    
    .participants-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .prizes-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .history-controls {
        flex-direction: column;
    }
    
    .single-input-group {
        flex-direction: column;
    }
    
    .prize-input-group {
        flex-direction: column;
    }
    
    .prize-input-actions {
        flex-direction: column;
    }
    
    .prize-method-tabs {
        flex-direction: column;
    }
    
    .prize-tab-btn {
        margin-bottom: 5px;
    }
    
    .input-actions {
        flex-direction: column;
    }
    
    .auto-buttons {
        flex-direction: column;
    }
    
    .winner-actions {
        flex-direction: column;
    }
    
    .export-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .prize-mode-tabs {
        flex-direction: column;
    }
    
    .prize-mode-btn {
        margin-bottom: 5px;
    }
    
    .modal-content {
        width: 95vw;
        margin: 10px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .winners-table th,
    .winners-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    /* Adjust list heights for mobile */
    .participants-list {
        height: 250px;
        max-height: 250px;
    }
    
    .prizes-list {
        height: 200px;
        max-height: 200px;
    }
    
    .language-selector {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        text-align: center;
    }
    
    #language-select {
        min-width: 150px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .method-tabs {
        flex-direction: column;
    }
    
    .mode-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        margin-bottom: 5px;
    }
    
    .mode-btn {
        margin-bottom: 5px;
    }
    
    .prize-mode-selection {
        padding: 20px;
    }
    
    .prize-mode-selection h3 {
        font-size: 1.2rem;
    }
    
    .wheel-container {
        margin: 20px 0 0 0;
        padding: 0 5px;
        min-height: 400px;
    }
    
    #wheel-canvas {
        width: 320px;
        height: 320px;
        max-width: 320px;
        max-height: 320px;
    }
    
    .wheel-center {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .wheel-pointer {
        font-size: 2.8rem;
        top: 12px;
    }
    
    .spin-button-container .btn-spin {
        font-size: 1.1rem;
        padding: 16px 30px;
    }
    
    .winner-content {
        padding: 40px 25px;
    }
    
    .winner-content h3 {
        font-size: 2rem;
    }
    
    .winner-name {
        font-size: 1.5rem;
    }
    
    .winners-table th,
    .winners-table td {
        padding: 8px 5px;
        font-size: 0.8rem;
    }
    
    .modal-header h2 {
        font-size: 1.4rem;
    }
    
    .input-card, .wheel-card, .history-card, .prize-card {
        min-height: 500px;
    }
    
    /* Adjust list heights for small mobile */
    .participants-list {
        height: 200px;
        max-height: 200px;
    }
    
    .prizes-list {
        height: 180px;
        max-height: 180px;
    }
    
    .language-selector-top {
        margin-bottom: 15px;
    }
    
    .language-wrapper #language-select {
        min-width: 110px;
        font-size: 12px;
    }
    
    .language-wrapper {
        padding: 6px 10px;
    }
}