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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #FAFAFA;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    background: #FFFFFF;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    color: #4a5568;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2em;
    color: #718096;
}

/* Sections */
.upload-section,
.controls-section,
.results-section,
.stats-section {
    background: #FFFFFF;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.upload-section:hover,
.controls-section:hover,
.results-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* File Upload */
.file-upload {
    text-align: center;
}

.file-label {
    display: inline-block;
    padding: 20px 40px;
    background: #056656;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 5px 15px rgba(5, 102, 86, 0.4);
}

.file-label:hover {
    background: #034038;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(3, 64, 56, 0.6);
}

.file-label input[type="file"] {
    display: none;
}

.file-icon {
    font-size: 1.3em;
    margin-right: 10px;
}

.file-info {
    margin-top: 20px;
    font-size: 1.1em;
}

.file-success {
    color: #38a169;
    font-weight: 600;
    padding: 15px;
    background: rgba(56, 161, 105, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(56, 161, 105, 0.3);
}

.file-error {
    color: #e53e3e;
    font-weight: 600;
    padding: 15px;
    background: rgba(229, 62, 62, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(229, 62, 62, 0.3);
}

.file-loading {
    color: #2b6cb0;
    font-weight: 600;
    padding: 15px;
    background: rgba(43, 108, 176, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(43, 108, 176, 0.3);
    animation: pulse 2s infinite;
}

/* Controls Section */
.controls-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f7fafc;
    color: #4a5568;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #e2e8f0;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: #edf2f7;
}

.tab-button.active {
    background: #056656;
    color: white;
}

/* Mode Description */
.mode-description {
    margin-bottom: 25px;
}

.mode-desc {
    display: none;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #056656;
}

.mode-desc.active {
    display: block;
}

.mode-desc p {
    margin: 0;
    color: #4a5568;
    font-size: 0.95em;
    line-height: 1.5;
}

.date-range {
    margin-bottom: 30px;
}

.date-inputs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.date-input {
    flex: 1;
    min-width: 200px;
}

.date-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.date-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.date-input input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

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

.winner-amount input {
    width: 100px;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1em;
    text-align: center;
    transition: all 0.3s ease;
}

.winner-amount input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* Buttons */
.pick-winner-btn,
.pick-again-btn {
    background: #056656;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(5, 102, 86, 0.4);
    display: block;
    margin: 0 auto;
}

.pick-winner-btn:hover,
.pick-again-btn:hover {
    background: #034038;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(3, 64, 56, 0.6);
}

.pick-again-btn {
    background: #056656;
    box-shadow: 0 5px 15px rgba(5, 102, 86, 0.4);
    margin-top: 20px;
}

/* Results Section */
.results-section h3 {
    text-align: center;
    color: #4a5568;
    font-size: 1.8em;
    margin-bottom: 25px;
}

.winners-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.winner-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.winner-item:hover {
    transform: translateY(-2px);
}

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

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.winner-number {
    font-size: 2em;
    font-weight: bold;
    color: #4a5568;
    margin-right: 20px;
    min-width: 60px;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-details {
    flex: 1;
}

.winner-email {
    font-size: 1.3em;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.winner-info {
    color: #718096;
    font-size: 1em;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.winner-date {
    font-style: italic;
}

.winner-mode-info {
    color: #056656;
    font-weight: 600;
    font-size: 0.9em;
}

/* Stats Section */
.stats-section h4 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.stats-info p {
    margin-bottom: 8px;
    color: #718096;
    font-size: 1em;
}

/* Fireworks Canvas */
#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    header p {
        font-size: 1em;
    }
    
    .date-inputs {
        flex-direction: column;
    }
    
    .date-input {
        min-width: 100%;
    }
    
    .winner-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .winner-number {
        margin-right: 0;
    }
    
    .winner-info {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .upload-section,
    .controls-section,
    .results-section,
    .stats-section {
        padding: 20px;
    }
    
    .file-label {
        padding: 15px 25px;
        font-size: 1em;
    }
    
    .pick-winner-btn,
    .pick-again-btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}

/* Loading animation for better UX */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse animation for pick winner button */
.pick-winner-btn.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.8);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    }
}

