/* CSS Variables & Reset */
:root {
    --primary: #ff4500;
    /* Reddit Orange */
    --primary-hover: #ff5714;
    --secondary: #1a1a1b;
    /* Reddit Dark */
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-main: #1c1c1c;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #ff5418;
    /* Slightly lighter orange for dark mode contrast */
    --primary-hover: #ff6a35;
    --background: #0f0f10;
    --surface: #18181b;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #27272a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

[data-theme="dark"] .hero-bg {
    background: radial-gradient(circle at top center, rgba(255, 69, 0, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
}

[data-theme="dark"] .hero-title {
    background: linear-gradient(135deg, #ffffff 0%, #d1d1d1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .info-card.large,
[data-theme="dark"] .bg-gradient-1 {
    background: linear-gradient(135deg, #18181b 0%, #202024 100%);
}

[data-theme="dark"] .bg-gradient-1 h3 {
    background: linear-gradient(90deg, #ff6b35, #ff9f5a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .about-section {
    background: linear-gradient(to bottom, #18181b 0%, #0f0f10 100%);
}

[data-theme="dark"] .header {
    background: rgba(15, 15, 16, 0.8);
    border-color: var(--border);
}

[data-theme="dark"] .logo-icon path[fill="currentColor"] {
    fill: var(--primary);
}

[data-theme="dark"] .logo-icon path[stroke="currentColor"] {
    stroke: var(--primary);
}

[data-theme="dark"] .nav-link {
    color: var(--text-main);
}

[data-theme="dark"] .hero-subtitle {
    color: #e2e8f0;
    /* Brighter text for readability */
}

[data-theme="dark"] .input-wrapper {
    border-color: rgba(255, 69, 0, 0.4);
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.15);
    /* Orange glow */
}

[data-theme="dark"] #url-input {
    background: #202024;
    color: var(--text-main);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    height: 70px;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--primary);
}

/* Theme Toggle Button */
.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--text-main);
    transition: var(--transition);
    margin-right: 1rem;
}

.theme-btn:hover {
    background: rgba(128, 128, 128, 0.1);
    color: var(--primary);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
}

.bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 0;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top center, rgba(255, 69, 0, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1c1c1c 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.input-wrapper {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}



/* Result Container */
.result-container {
    max-width: 700px;
    margin: 2rem auto 0;
    text-align: left;
    animation: fadeIn 0.3s ease;
}

.result-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .result-card {
        flex-direction: row;
        align-items: flex-start;
    }
}

.result-thumb {
    width: 100%;
    max-width: 250px;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

.result-info {
    flex: 1;
    width: 100%;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.media-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.media-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.media-type {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-main);
}

.media-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.download-link-btn {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.download-link-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Loading State */
.loader {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 69, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="dark"] .media-item {
    background: #202024;
}

@media (min-width: 640px) {
    .input-wrapper {
        flex-direction: row;
        padding: 0.75rem;
    }
}

.input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

#url-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 4px);
    background: var(--background);
    transition: var(--transition);
}

#url-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(255, 69, 0, 0.1);
}

#paste-btn {
    position: absolute;
    right: 12px;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
}

#paste-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Icon placeholder in input */
.input-container::before {
    content: '';
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    pointer-events: none;
}

.download-btn {
    background: var(--primary);
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.2);
}

.download-btn:active {
    transform: translateY(0);
}

.input-tip {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
    opacity: 0.8;
}

/* Sections General */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

/* How It Works */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.step-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.step-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 69, 0, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.step-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Features */
.features {
    background: white;
}

[data-theme="dark"] .features {
    background: var(--background);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--background);
    transition: var(--transition);
}

.feature-card:hover {
    background: #fff5f2;
    /* Light orange tint */
}

[data-theme="dark"] .feature-card:hover {
    background: #27272a;
    /* Lighter dark */
}

.feature-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

/* FAQ */
.accordion {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accordion-item {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: left;
    background: transparent;
    transition: var(--transition);
    color: var(--text-main);
}

[data-theme="dark"] .accordion-header {
    color: var(--text-main);
}

.accordion-header:hover {
    background: rgba(0, 0, 0, 0.01);
}

.accordion-header[aria-expanded="true"] {
    color: var(--primary);
}

.accordion-header[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.chevron {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-content {
    height: 0;
    overflow: hidden;
    padding: 0 1.25rem;
    color: var(--text-muted);
    transition: height 0.3s ease-out, padding 0.3s ease;
}

.accordion-header[aria-expanded="true"]+.accordion-content {
    height: auto;
    padding: 0 1.25rem 1.25rem;
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-main);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.copyright {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Info Section (Grid) */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-card.large {
        grid-column: span 2;
        display: flex;
        align-items: center;
        text-align: left;
    }

    .info-card.large .info-content {
        flex: 1;
        padding-right: 2rem;
    }

    .info-card.large .info-visual {
        flex: 1;
        height: 100%;
        min-height: 200px;
    }
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.info-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.info-card.large {
    background: linear-gradient(135deg, #fff 0%, #fff8f6 100%);
    border-color: rgba(255, 69, 0, 0.1);
}

.info-visual {
    background: var(--background);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.grid-deco {
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--primary) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
    min-height: 150px;
}

.text-link {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    margin-top: 1rem;
}

/* Tips Section (Bento Grid) */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    grid-auto-rows: minmax(180px, auto);
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .span-2 {
        grid-column: span 2;
    }

    .span-3 {
        grid-column: span 3;
    }
}

.bento-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: var(--transition);
}

.bento-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.bento-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.bento-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.bento-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
    z-index: 2;
}

/* Bento Variants */
.bg-gradient-1 {
    background: linear-gradient(135deg, #ffefe6 0%, #fff 100%);
    border: none;
}

.bg-gradient-1 h3 {
    background: linear-gradient(90deg, #ff4500, #ff8c00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-deco-circle {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: rgba(255, 69, 0, 0.05);
    border-radius: 50%;
}

.bg-dark {
    background: #1a1a1b;
    color: white;
    border: none;
}

.bg-dark h3,
.bg-dark p {
    color: rgba(255, 255, 255, 0.9);
}

.bg-dark .text-muted {
    color: rgba(255, 255, 255, 0.6);
}

.flex-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.lock-icon {
    opacity: 0.5;
    transform: rotate(-15deg);
}

/* About Section (Typography Focus) */
.about-section {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 69, 0, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.about-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .about-content-wrapper {
        flex-direction: row;
        align-items: flex-start;
        gap: 4rem;
    }

    .about-header {
        flex: 1;
        position: sticky;
        top: 100px;
    }

    .about-text {
        flex: 2;
    }
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 69, 0, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.text-left {
    text-align: left;
    margin-bottom: 0;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-text p:first-child::first-letter {
    float: left;
    font-size: 3.5rem;
    line-height: 1;
    font-weight: 700;
    color: var(--text-main);
    padding-right: 0.5rem;
    margin-top: -0.2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: var(--shadow-lg);
        border-bottom: 1px solid var(--border);
    }

    .nav.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }
}