/* ============================================
   UpscaleImage.AI — Styles
   Modern, clean design for AI tool site
   ============================================ */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --success: #10b981;
    --bg: #0f0f23;
    --bg-card: #1a1a2e;
    --bg-elevated: #252540;
    --bg-hover: #2a2a4a;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

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

a:hover {
    color: var(--accent-light);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

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

.logo:hover {
    color: var(--text);
}

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

.logo-icon {
    flex-shrink: 0;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}

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

/* Hero */
.hero {
    padding: 60px 0 30px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--success) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

.hero-subtitle strong {
    color: var(--text);
}

/* Tool Section */
.tool-section {
    padding: 20px 24px 60px;
}

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

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.drag-over {
    transform: scale(1.01);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color var(--transition);
}

.upload-area:hover .upload-icon {
    color: var(--primary-light);
}

.upload-content h2 {
    font-size: 22px;
    font-weight: 600;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 15px;
}

.upload-formats {
    font-size: 13px !important;
    color: var(--text-muted) !important;
}

.upload-btn {
    margin-top: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Editor Area */
.editor-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hidden {
    display: none !important;
}

/* Controls Bar */
.controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.scale-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scale-controls label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.scale-buttons {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 8px;
}

.scale-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.scale-btn:hover {
    color: var(--text);
    background: var(--bg-elevated);
}

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

.output-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.output-info .arrow {
    color: var(--primary);
    font-weight: 700;
}

.output-info strong {
    color: var(--text);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Comparison View */
.comparison-container {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.comparison-wrapper {
    position: relative;
    display: flex;
    height: 500px;
    overflow: hidden;
}

.comparison-before,
.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.comparison-before canvas,
.comparison-after canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.comparison-before {
    z-index: 1;
    clip-path: inset(0 50% 0 0);
}

.comparison-after {
    z-index: 0;
}

.comparison-label {
    position: absolute;
    top: 16px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.comparison-before .comparison-label {
    left: 16px;
}

.comparison-after .comparison-label {
    right: 16px;
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    z-index: 10;
    cursor: ew-resize;
}

.slider-line {
    width: 2px;
    height: 100%;
    background: white;
    margin: 0 auto;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.slider-handle svg {
    width: 20px;
    height: 20px;
}

.comparison-hint {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Processing */
.processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

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

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

.progress-bar {
    width: 300px;
    max-width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* How It Works */
.how-it-works {
    padding: 80px 0;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 48px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

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

.step-card: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: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.step-icon {
    margin-bottom: 20px;
}

.step-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

/* Features */
.features {
    padding: 80px 0;
    background: var(--bg-card);
}

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

.feature-card {
    padding: 30px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform var(--transition);
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 28px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* FAQ */
.faq {
    padding: 80px 0;
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-item summary {
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 22px;
    color: var(--primary);
    font-weight: 300;
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    background: var(--bg-elevated);
}

.faq-item p {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

/* Blog */
.blog-section {
    padding: 80px 0;
    background: var(--bg-card);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.blog-card {
    padding: 28px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.blog-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.blog-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-card h3 a {
    color: var(--text);
}

.blog-card h3 a:hover {
    color: var(--primary-light);
}

.blog-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.blog-card time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 60px 0 30px;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-top: 12px;
    max-width: 300px;
}

.footer-links h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 4px 0;
    transition: color var(--transition);
}

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

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        padding: 40px 0 20px;
    }

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

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .scale-controls {
        justify-content: center;
    }

    .output-info {
        justify-content: center;
    }

    .action-buttons {
        justify-content: center;
    }

    .comparison-wrapper {
        height: 300px;
    }

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

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .scale-btn {
        padding: 8px 14px;
    }
}
