* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #003d6b 0%, #004B87 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 800px;
}

.section {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 50px 40px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
    text-align: center;
    border-top: 4px solid #E63946;
}

h1 {
    color: #004B87;
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    color: #6B7280;
    margin-bottom: 30px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

#codeInput {
    width: 100%;
    max-width: 300px;
    padding: 15px 20px;
    font-size: 32px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    letter-spacing: 8px;
    font-weight: 600;
    transition: border-color 0.3s;
}

#codeInput:focus {
    outline: none;
    border-color: #E63946;
}

.btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
}

.logo-small {
    max-width: 220px;
    height: auto;
}

.btn-primary {
    background: #E63946;
    color: white;
    width: 100%;
    max-width: 300px;
}

.btn-primary:hover {
    background: #d62839;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
}

.btn-secondary {
    background: #e8f1f8;
    color: #004B87;
}

.btn-secondary:hover {
    background: #d1e3f0;
}

.btn-danger {
    background: #E63946;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #d62839;
}

.btn-download {
    background: #004B87;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    margin-right: 8px;
}

.btn-download:hover {
    background: #003d6b;
}

.error-message {
    color: #E63946;
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 30px 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #E63946;
}

h2 {
    color: #004B87;
    font-size: 24px;
}

.event-code {
    color: #6B7280;
    font-size: 14px;
    margin-top: 5px;
}

.event-code span {
    font-weight: 600;
    color: #E63946;
    letter-spacing: 2px;
}

.upload-area {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h3 {
    color: #004B87;
    margin-bottom: 20px;
    font-size: 20px;
}

.file-drop-area {
    border: 3px dashed #cbd5e1;
    border-radius: 16px;
    padding: 70px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.file-drop-area:hover {
    border-color: #E63946;
    background: #fef2f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.1);
}

.file-drop-area.drag-over {
    border-color: #E63946;
    background: #fee2e2;
    border-style: solid;
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: #004B87;
    margin-bottom: 15px;
}

.drop-text {
    color: #6B7280;
    font-size: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e8f1f8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #E63946;
    width: 0%;
    transition: width 0.3s;
}

#uploadStatus {
    color: #6B7280;
    font-size: 14px;
    text-align: center;
}

.files-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    background: white;
}

.file-item:hover {
    border-color: #E63946;
    background: #fef2f2;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.1);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #004B87;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-meta {
    font-size: 14px;
    color: #6B7280;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.loading {
    text-align: center;
    color: #6B7280;
    padding: 40px;
}

.empty-state {
    text-align: center;
    color: #6B7280;
    padding: 40px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .card {
        padding: 30px 20px;
        border-radius: 12px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    #codeInput {
        font-size: 24px;
        letter-spacing: 4px;
        padding: 12px 16px;
    }

    .logo {
        max-width: 200px;
    }

    .logo-small {
        max-width: 150px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }

    .header > div {
        width: 100%;
    }

    .header > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .upload-area {
        padding: 20px;
    }

    .file-drop-area {
        padding: 40px 20px;
    }

    .drop-text {
        font-size: 14px;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .files-section {
        padding: 20px;
    }

    .files-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .files-header .btn {
        width: 100%;
    }

    .file-item {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .file-actions {
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
    }

    .file-actions .btn {
        width: 100%;
        margin: 0 !important;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
        min-height: 44px; /* Better touch target */
    }

    .btn-download {
        margin-right: 0;
        margin-bottom: 8px;
    }

    /* Stack buttons vertically on mobile */
    .button-group,
    .header-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .button-group .btn,
    .header-actions .btn {
        width: 100% !important;
    }

    /* Make tables scrollable on mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Improve form inputs on mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px;
    }
}

/* Upload Instructions Box */
.upload-instructions-box {
    background: #f0f4ff;
    border: 2px solid #004B87;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 75, 135, 0.1);
}
