/* ============================================
   PDF to JPG Converter - Styles
   ============================================ */

/* Local Font Face */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('vendor/fonts/Inter-Variable.woff2') format('woff2');
}

/* CSS Custom Properties */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --secondary: #f59e0b;
    --success: #10b981;
    --error: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #0f172a;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header & Navigation
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

.logo i {
    color: var(--error);
    font-size: 1.75rem;
}

.logo-highlight {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, var(--primary-bg) 0%, #f0f9ff 50%, #fdf2f8 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-badge i {
    font-size: 1rem;
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 8px;
    letter-spacing: -0.01em;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 680px;
    margin: 0 auto;
}

/* ============================================
   Converter Card
   ============================================ */

.converter-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
}

.converter-header {
    text-align: center;
    margin-bottom: 32px;
}

.converter-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.converter-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.upload-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.upload-hint {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 4px 12px;
    background: var(--bg-primary);
    border-radius: 50px;
    border: 1px solid var(--border);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-state p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Results */
.results {
    animation: fadeIn 0.4s ease;
}

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

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #fff;
}

.result-item-info {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.result-item .btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.result-item .btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 40px;
}

.error-icon {
    font-size: 3rem;
    color: var(--error);
    margin-bottom: 16px;
}

.error-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

/* ============================================
   Sections
   ============================================ */

.section {
    padding: 100px 0;
}

.section-dark {
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 60px;
    line-height: 1.7;
}

/* ============================================
   Steps
   ============================================ */

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 40px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.step-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}

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

/* ============================================
   Features Grid
   ============================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    padding: 32px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 52px;
    height: 52px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

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

/* ============================================
   FAQ
   ============================================ */

.faq-list {
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-primary);
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: background var(--transition);
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-question i {
    font-size: 0.85rem;
    color: var(--text-light);
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 24px 20px;
}

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

/* ============================================
   Footer
   ============================================ */

.footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo {
    color: white;
    margin-bottom: 16px;
}

.footer-brand .logo i {
    color: #fca5a5;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 320px;
}

.footer-links h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
}

.footer-links a {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding: 24px 0;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.75rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 0 60px;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .converter-card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

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

    .steps {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .converter-card {
        padding: 16px;
    }

    .upload-area {
        padding: 32px 16px;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}