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

:root {
    /* Cores */
    --primary: #0066FF;
    --secondary: #00D4FF;
    --background: #0A0A0A;
    --surface: #1A1A1A;
    --surface-light: #2A2A2A;
    --text: #FFFFFF;
    --text-secondary: #B0B0B0;
    --accent: #FF6B35;
    --success: #00FF88;
    --error: #FF4757;
    --warning: #FFA502;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-surface: linear-gradient(135deg, var(--surface), var(--surface-light));
    --gradient-accent: linear-gradient(135deg, var(--accent), #FF8A65);
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 102, 255, 0.3);
    
    /* Transições */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    
    /* Tipografia */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;
    
    /* Espaçamentos */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: var(--font-primary);
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 102, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 107, 53, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Header */
.header {
    padding: var(--space-lg) 0;
    text-align: center;
    position: relative;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main */
.main {
    padding: var(--space-lg) 0 var(--space-2xl);
}

/* Section Base */
section {
    margin-bottom: var(--space-2xl);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.section-title.success {
    color: var(--success);
}

.section-icon {
    width: 24px;
    height: 24px;
}

.section-description {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Section */
.upload-area {
    background: var(--gradient-surface);
    border: 2px dashed var(--surface-light);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-area:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area.dragover {
    border-color: var(--secondary);
    background: linear-gradient(135deg, var(--surface), rgba(0, 212, 255, 0.1));
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    margin-bottom: var(--space-md);
}

.upload-icon-svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.upload-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.upload-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    box-shadow: var(--shadow-md);
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-input {
    display: none;
}

/* File Info */
.file-info {
    margin-top: var(--space-lg);
    animation: slideIn 0.3s ease;
}

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

.file-details {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-sm);
}

.file-icon {
    width: 24px;
    height: 24px;
    color: var(--success);
}

.file-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: var(--text);
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.remove-file-btn:hover {
    color: var(--error);
    background: rgba(255, 71, 87, 0.1);
}

/* Convert Section */
.convert-section {
    margin-top: var(--space-xl);
    text-align: center;
}

.convert-button {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.convert-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.convert-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.convert-button:hover:not(:disabled)::before {
    left: 100%;
}

.convert-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Processing Section */
.processing-section {
    text-align: center;
    padding: var(--space-2xl);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.processing-content {
    max-width: 400px;
    margin: 0 auto;
}

.processing-animation {
    margin-bottom: var(--space-lg);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--surface-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.processing-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.processing-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

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

/* Results Section */
.results-section {
    animation: slideUp 0.5s ease;
}

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

.results-content {
    background: var(--gradient-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--surface-light);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.results-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.results-actions {
    display: flex;
    gap: var(--space-sm);
}

.action-button {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
    border: none;
}

.action-button.primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.action-button.secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--surface-light);
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.results-data {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid var(--surface-light);
    max-height: 400px;
    overflow-y: auto;
}

.csv-output {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Error Section */
.error-section {
    text-align: center;
    padding: var(--space-xl);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-content {
    max-width: 400px;
    margin: 0 auto;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.error-icon {
    margin-bottom: var(--space-md);
}

.error-icon i {
    width: 48px;
    height: 48px;
    color: var(--error);
}

.error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--error);
    margin-bottom: var(--space-sm);
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.retry-button {
    background: var(--error);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.retry-button:hover {
    background: #e74c3c;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--surface-light);
    padding: var(--space-xl) 0;
    margin-top: var(--space-2xl);
}

.footer-content {
    text-align: center;
}

.footer-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.footer-tech {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.tech-badge {
    background: var(--surface-light);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--surface);
    color: var(--text);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    min-width: 300px;
    animation: toastSlide 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

@keyframes toastSlide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .upload-area {
        padding: var(--space-lg);
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-actions {
        justify-content: center;
    }
    
    .action-button {
        flex: 1;
        justify-content: center;
    }
    
    .toast-container {
        left: var(--space-sm);
        right: var(--space-sm);
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .upload-button,
    .convert-button {
        width: 100%;
        justify-content: center;
    }
    
    .file-details {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .remove-file-btn {
        align-self: flex-end;
    }
}

