* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
header {
    grid-column: 1 / -1;
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

/* Main Content */
main {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 500px;
}

.section {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Upload Section */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 60px 40px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #764ba2;
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: #4CAF50;
    background-color: #e8f5e8;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-area h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
}

/* Conversion Options */
.conversion-options {
    margin-bottom: 30px;
}

.conversion-options label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

#format-select {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

#format-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f1f3f4;
    color: #333;
    border: 2px solid #ddd;
}

.btn-secondary:hover {
    background: #e8eaed;
    border-color: #667eea;
}

/* Loading Section */
.loading-animation {
    margin-bottom: 30px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.progress-bar {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    animation: progress 3s ease-in-out forwards;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 60%; }
    100% { width: 100%; }
}

/* Download Section */
.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}


/* SEO Content Sections */
.features-section {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 2px solid #f0f0f0;
}

.features-section h3 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

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

.feature {
    text-align: center;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.feature h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature p {
    color: #666;
    line-height: 1.5;
}

.conversion-tips {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.conversion-tips h3 {
    color: #333;
    margin-bottom: 15px;
}

.conversion-tips ul {
    list-style: none;
    padding: 0;
}

.conversion-tips li {
    padding: 8px 0;
    color: #555;
    border-bottom: 1px solid #eee;
}

.conversion-tips li:last-child {
    border-bottom: none;
}

.seo-content {
    grid-column: 1 / -1;
    max-width: 800px;
    margin: 40px auto;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.seo-content h2 {
    color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.seo-content h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
}

.seo-content p {
    line-height: 1.7;
    color: #555;
    margin-bottom: 15px;
}

.seo-content ol, .seo-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.seo-content li {
    line-height: 1.6;
    color: #555;
    margin-bottom: 8px;
}

.seo-content strong {
    color: #333;
    font-weight: 600;
}

/* Footer */
footer {
    grid-column: 1 / -1;
    text-align: center;
    color: white;
    padding: 20px;
    opacity: 0.9;
}

footer nav {
    margin-top: 10px;
}

footer nav a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

footer nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .seo-content {
        padding: 20px 15px;
        margin: 20px 10px;
    }
    
    .seo-content h2 {
        font-size: 1.5rem;
    }
    
    .seo-content h3 {
        font-size: 1.2rem;
    }
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Preload critical fonts */
@font-display: swap;

/* File selected state */
.file-selected .upload-area {
    border-color: #4CAF50;
    background-color: #e8f5e8;
}

.file-selected .upload-icon {
    color: #4CAF50;
}

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

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