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

:root {
    --primary-color: #E63946;
    --primary-dark: #C72C38;
    --success-color: #00C875;
    --error-color: #E63946;
    --text-primary: #2B2D31;
    --text-secondary: #676879;
    --border-color: #E0E0E0;
    --bg-light: #F5F5F5;
    --bg-dark: #1A1A1D;
    --bg-gray: #2B2D31;
    --bg-white: #FFFFFF;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-gray) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
}

/* Header */
header {
    background: #000000;
    color: white;
    padding: 40px 24px 32px;
    text-align: center;
    position: relative;
}

.logo {
    width: 240px;
    height: auto;
    margin-bottom: 16px;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

header p {
    font-size: 16px;
    opacity: 0.85;
    color: #F1F1F1;
}

/* Main Content */
main {
    padding: 32px 24px;
}

/* Form Sections */
.form-section {
    margin-bottom: 32px;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.1);
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-light);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 97, 255, 0.05);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-subtext {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.browse-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.browse-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.browse-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.file-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* File Info Display */
.file-info-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#fileName {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

#fileSize {
    font-size: 14px;
    color: var(--text-secondary);
}

.remove-btn {
    background: var(--error-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.remove-btn:hover {
    background: #C73A4E;
    transform: scale(1.1);
}

/* Progress Section */
#progressSection {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-light);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00C875);
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

/* Status Messages */
.status-message {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-weight: 500;
    text-align: center;
}

.status-message.success {
    background: rgba(0, 200, 117, 0.1);
    color: #00864D;
    border: 2px solid var(--success-color);
}

.status-message.error {
    background: rgba(228, 66, 88, 0.1);
    color: #B8293E;
    border: 2px solid var(--error-color);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.submit-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* Footer */
footer {
    background: var(--bg-light);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .container {
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    header h1 {
        font-size: 24px;
    }

    main {
        flex: 1;
        padding: 24px 20px;
    }

    .upload-area {
        padding: 32px 16px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .upload-text {
        font-size: 16px;
    }

    .input-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Touch-friendly tap areas */
@media (hover: none) {
    .browse-btn,
    .submit-btn {
        min-height: 48px;
    }

    .remove-btn {
        width: 40px;
        height: 40px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        max-width: 100%;
    }

    header {
        padding: 20px 24px;
    }

    .upload-area {
        padding: 24px 16px;
    }
}

/* Animation for form submission */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.input-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--error-color);
    animation: shake 0.3s ease;
}
