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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    flex: 1;
}

section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.upload-section {
    text-align: center;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-content {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.upload-content i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
    display: block;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
    min-height: 44px;
    vertical-align: middle;
    line-height: 1;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: 1px solid #667eea;
}

.btn-primary:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.btn-success:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
}

.btn-secondary:focus {
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.25);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

.btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.file-list {
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.file-icon.image {
    color: #28a745;
}

.file-icon.video {
    color: #007bff;
}

.file-details h4 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.file-details p {
    color: #666;
    font-size: 0.9rem;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.actions {
    text-align: center;
    margin-top: 20px;
}

.actions .btn {
    margin: 0 10px;
}

.progress-container {
    margin: 20px 0;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: #667eea;
}

.current-file {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.results-list {
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.result-item.success {
    border-left: 4px solid #28a745;
}

.result-item.error {
    border-left: 4px solid #dc3545;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.result-status {
    font-size: 1.2rem;
}

.result-status.success {
    color: #28a745;
}

.result-status.error {
    color: #dc3545;
}

.error-section {
    text-align: center;
    color: #dc3545;
}

.error-content i {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error-content h3 {
    margin-bottom: 15px;
}

.error-content p {
    margin-bottom: 20px;
    color: #666;
}

.loading-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;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.faq-item h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.faq-item p {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px 0 20px;
    margin-top: 40px;
    color: white;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-main {
    text-align: center;
    margin-bottom: 30px;
}

.footer-main h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.footer-main p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.footer-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

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

.feature i {
    font-size: 1.2rem;
    color: #ffd700;
}

.feature span {
    font-weight: 500;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-bottom p {
    margin: 0;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Benefits Section */
.benefits-section {
    text-align: center;
    margin-top: 30px;
}

.benefits-section h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 15px;
}

.section-intro {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.info-card {
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.info-card.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.info-card.success {
    background: linear-gradient(135deg, #00d2d3 0%, #54a0ff 100%);
    color: white;
}

.info-card i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.info-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.info-card p {
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.95;
}

/* How it Works Section */
.how-it-works-section {
    margin-top: 40px;
    text-align: center;
}

.how-it-works-section h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 40px;
}

.steps-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 0 auto;
    max-width: 800px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 200px;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 30px;
    right: -45px;
    width: 60px;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    z-index: 2;
    position: relative;
}

.step-content h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.step-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Performance optimizations */
* {
    will-change: auto;
}

.btn {
    contain: layout;
}

.progress-fill {
    contain: layout style;
}

/* Focus management for accessibility */
.upload-area:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Button initial state fixes */
.btn:not(:disabled) {
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Ensure buttons render correctly on initial load */
#browseBtn {
    margin-top: 5px;
    font-family: inherit;
}

/* Fix any button jumping issues */
.btn i {
    flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    section {
        padding: 20px;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .file-item,
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-actions,
    .result-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .actions .btn {
        margin: 5px;
        width: 100%;
        max-width: 200px;
    }

    .faq-section h2 {
        font-size: 1.5rem;
    }

    .faq-item {
        padding: 15px;
    }

    .faq-item h3 {
        font-size: 1.1rem;
    }

    .footer-features {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .feature {
        padding: 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .upload-content i {
        font-size: 2rem;
    }

    .upload-content h3 {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .faq-section h2 {
        font-size: 1.3rem;
    }

    .faq-item h3 {
        font-size: 1rem;
    }

    .footer-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .footer-main h3 {
        font-size: 1.2rem;
    }

    .footer-main p {
        font-size: 0.9rem;
    }

    .benefits-section h2 {
        font-size: 1.6rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .info-card {
        padding: 20px;
    }

    .info-card i {
        font-size: 2.5rem;
    }

    .how-it-works-section h2 {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .steps-container {
        flex-direction: column;
        gap: 25px;
    }

    .step {
        max-width: 100%;
        width: 100%;
    }

    .step:not(:last-child)::after {
        display: none;
    }

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .step-content h3 {
        font-size: 1.1rem;
    }

    .step-content p {
        font-size: 0.9rem;
    }
}
