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

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

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 3rem;
    color: #4ade80;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #4ade80, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Upload Zone */
.upload-zone {
    background: rgba(255, 255, 255, 0.95);
    border: 3px dashed #e2e8f0;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.upload-zone:hover {
    border-color: #4ade80;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.upload-zone.dragover {
    border-color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
    transform: scale(1.02);
}

.upload-icon i {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.upload-zone:hover .upload-icon i {
    color: #4ade80;
}

.upload-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-weight: 600;
}

.upload-content p {
    color: #64748b;
    font-size: 1rem;
}

.browse-text {
    color: #4ade80;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.supported-formats {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.supported-formats small {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Processing State */
.processing-state {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4ade80;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

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

.processing-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-weight: 600;
}

.processing-content p {
    color: #64748b;
}

/* Result Section */
.result-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.file-icon i {
    font-size: 2.5rem;
    color: #22c55e;
}

.file-details h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.file-details p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-download, .btn-reset {
    flex: 1;
    min-width: 150px;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-download {
    background: linear-gradient(45deg, #22c55e, #16a34a);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.btn-reset {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-reset:hover {
    background: #e2e8f0;
    color: #475569;
    transform: translateY(-2px);
}

/* Preview Section */
.preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.preview-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.preview-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.preview-table th,
.preview-table td {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    text-align: left;
    background: white;
}

.preview-table th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
}

.preview-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

/* Footer */
.footer {
    margin-top: 3rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2.5rem;
    }
    
    .upload-zone {
        padding: 3rem 1rem;
    }
    
    .upload-icon i {
        font-size: 3rem;
    }
    
    .upload-content h2 {
        font-size: 1.25rem;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-download, .btn-reset {
        min-width: 100%;
    }
    
    .file-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .header {
        margin-bottom: 2rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .result-section {
        padding: 1rem;
    }
}

/* Animation for smooth transitions */
.upload-zone, .processing-state, .result-section {
    animation: slideInUp 0.6s ease-out;
}

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

/* Focus states for accessibility */
.upload-zone:focus-within,
.btn-download:focus,
.btn-reset:focus {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

/* Loading animation for buttons */
.btn-download.loading {
    position: relative;
    color: transparent;
}

.btn-download.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}