/* ============================================
   PDF to Excel Converter - Modern CSS
   Green accent theme
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0f0a;
    --bg-secondary: #121a12;
    --bg-card: #161f16;
    --bg-card-hover: #1a251a;
    
    --text-primary: #ffffff;
    --text-secondary: #a0b0a0;
    --text-muted: #607060;
    
    --accent-primary: #10b981;
    --accent-secondary: #059669;
    --accent-tertiary: #34d399;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    
    --gradient-primary: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, #047857 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.3);
    
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 0%, rgba(5, 150, 105, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(52, 211, 153, 0.08) 0%, transparent 50%);
}

.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 1.5rem;
    background: rgba(10, 15, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Main Content */
.main {
    position: relative;
    z-index: 1;
    padding-top: 5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1.5rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gradient-subtle);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease 0.2s both;
}

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

/* Converter Section */
.converter-section {
    padding: 2rem 1.5rem 4rem;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.converter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Upload Zone */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border-color-hover);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(16, 185, 129, 0.02);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-2px);
}

.upload-zone.dragover {
    box-shadow: var(--shadow-glow);
}

.upload-zone.has-file {
    display: none;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    color: var(--accent-primary);
    opacity: 0.8;
    transition: transform var(--transition-normal);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.upload-formats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.format-badge {
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Options Section */
.options-section {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.option-group {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.option-label {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.format-buttons, .ocr-buttons {
    display: flex;
    gap: 0.5rem;
}

.format-btn, .ocr-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.format-btn svg, .ocr-btn svg {
    width: 18px;
    height: 18px;
}

.format-btn:hover, .ocr-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-hover);
}

.format-btn.active, .ocr-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.option-hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File Info */
.file-info {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-info-content svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}

.file-name {
    font-weight: 500;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-remove {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.btn-remove:hover {
    color: var(--accent-error);
}

.btn-remove svg {
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn-convert {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-primary);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-convert:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-convert.loading .btn-text {
    opacity: 0;
}

.btn-convert.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Progress Section */
.progress-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

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

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Results Section */
.results-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    animation: fadeInUp 0.4s ease;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.results-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.results-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-success);
}

/* Results Stats */
.results-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Preview Section */
.preview-section {
    margin-bottom: 1.25rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.preview-header h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.btn-action.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.btn-action svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.preview-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.preview-table th,
.preview-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-primary);
}

.preview-table td {
    color: var(--text-secondary);
}

.preview-table tr:last-child td {
    border-bottom: none;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 1rem;
}

.btn-download {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--accent-success);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-download:hover {
    background: #0ea271;
    transform: translateY(-1px);
}

.btn-download svg {
    width: 18px;
    height: 18px;
}

.btn-new {
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-new:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.feature {
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.feature:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-subtle);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.faq-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.25rem;
}

.faq-item {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand .logo {
    font-size: 1.1rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    
    .hero {
        padding: 3rem 1rem 1.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .converter-card {
        padding: 1.5rem;
    }
    
    .upload-zone {
        padding: 2rem 1.5rem;
    }
    
    .format-buttons {
        flex-direction: column;
    }
    
    .results-stats {
        flex-direction: column;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .converter-card {
        padding: 1.25rem;
    }
    
    .ocr-buttons {
        flex-direction: column;
    }
}
