/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    --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 -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;

    --max-width: 1200px;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

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

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

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

ul, ol {
    list-style-position: inside;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.625rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ===== Header & Navigation ===== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.main-nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-img {
    width: 32px;
    height: 32px;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* ===== Main Content ===== */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--border-radius-lg);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

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

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

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-section {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
}

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    padding: 2rem 0 3rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.page-header h1 {
    color: var(--primary-color);
}

/* ===== Content Sections ===== */
.content-section {
    margin-bottom: 4rem;
}

.content-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* ===== Intro Section ===== */
.intro {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 3rem;
}

/* ===== Card Grids ===== */
.conversion-grid,
.format-cards,
.comparison-grid,
.resource-grid,
.tool-cards,
.guide-cards,
.feature-cards {
    display: grid;
    gap: 1.5rem;
}

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

.format-cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.comparison-grid,
.resource-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.tool-cards,
.guide-cards {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.feature-cards {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ===== Cards ===== */
.conversion-card,
.format-card,
.comparison-card,
.resource-card,
.tool-card,
.guide-card,
.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-normal);
}

.conversion-card:hover,
.comparison-card:hover,
.resource-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.conversion-card {
    text-decoration: none;
    color: inherit;
}

.conversion-card h3,
.comparison-card h3,
.resource-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.card-icon img {
    width: 100%;
    height: 100%;
}

/* ===== Tool Cards ===== */
.tool-card {
    display: flex;
    flex-direction: column;
}

.tool-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

.tool-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.tool-card h4 {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tool-card ul {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.tool-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* ===== Guide Cards ===== */
.guide-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(14, 165, 233, 0.05));
}

.guide-card h4 {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.guide-card ul {
    margin-bottom: 1.5rem;
}

/* ===== Format Cards ===== */
.format-card {
    text-align: center;
}

.format-card h3 {
    color: var(--primary-color);
}

.format-card .btn {
    margin-top: 1rem;
}

/* ===== Format Links ===== */
.format-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.format-links a {
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.format-links a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== Why Convert / Reasons ===== */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.reason {
    text-align: center;
    padding: 1.5rem;
}

.reason-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
}

.reason h3 {
    margin-bottom: 0.5rem;
}

/* ===== Quick Links ===== */
.quick-links {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    margin-top: 3rem;
}

.links-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.link-column h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.link-column ul {
    list-style: none;
}

.link-column li {
    margin-bottom: 0.5rem;
}

.link-column a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

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

/* ===== Tables ===== */
.converter-table,
.format-overview-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-secondary);
}

.table-link {
    padding: 0.375rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.table-link:hover {
    background: var(--primary-dark);
    color: white;
}

/* ===== More Link ===== */
.more-link {
    text-align: center;
    margin-top: 2rem;
}

.more-link a {
    font-weight: 500;
}

/* ===== Solution List ===== */
.solution-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.solution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.solution-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.solution-item strong {
    color: var(--text-primary);
}

.solution-item span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Links Grid ===== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.link-group h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.link-group ul {
    list-style: none;
}

.link-group li {
    margin-bottom: 0.375rem;
}

.link-group a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ===== Feature List ===== */
.feature-list {
    padding-left: 1.5rem;
}

.feature-list li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ===== Format Details ===== */
.format-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.format-detail {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
}

.format-detail h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.format-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.spec strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.spec {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ===== Recommendation Cards ===== */
.recommendation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.recommendation-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
}

.recommendation-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.recommendation-card pre {
    background: var(--text-primary);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

.recommendation-card code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.recommendation-card ul {
    color: var(--text-secondary);
}

/* ===== Code Tutorial ===== */
.code-tutorial {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
}

.code-tutorial h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.code-tutorial h3:first-child {
    margin-top: 0;
}

.code-tutorial pre {
    background: var(--text-primary);
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-tutorial code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

/* ===== Tip ===== */
.tip {
    padding: 1rem 1.25rem;
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 1.5rem 0;
}

/* ===== Display Options ===== */
.display-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.display-option {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: var(--border-radius);
}

.display-option h4 {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.display-option p {
    margin-bottom: 0;
    font-size: 0.9375rem;
}

/* ===== Footer ===== */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

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

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-bottom p:last-child {
    margin-bottom: 0;
}

/* ===== Mobile Styles ===== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .hero {
        padding: 2.5rem 1.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }

    .quick-links {
        padding: 1.5rem;
    }

    .format-specs {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .solution-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1.5rem 1rem 3rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .conversion-grid,
    .format-cards,
    .comparison-grid,
    .resource-grid,
    .tool-cards,
    .guide-cards {
        grid-template-columns: 1fr;
    }
}
