/* ==========================================================================
   1. DESIGN SYSTEM VARIABLES (:root)
   ========================================================================== */
:root {
    /* Brand Colors */
    --color-primary:      #2563EB;
    --color-primary-dark: #1D4ED8;
    --color-accent:       #F59E0B;
    --color-accent-dark:  #D97706;
    
    /* Backgrounds & Surfaces */
    --color-dark-bg:      #0F172A;
    --color-card-bg:      #1E293B;
    --color-light-bg:     #F8FAFC;
    --color-white:        #FFFFFF;
    
    /* Text & Borders */
    --color-text:         #0F172A;
    --color-text-muted:   #64748B;
    --color-border:       #E2E8F0;
    
    /* Status Colors */
    --color-success:      #10B981;
    --color-error:        #EF4444;

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body:    'Inter', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    /* Spacing Grid (4px base) */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-6:  24px;
    --space-8:  32px;
    --space-12: 48px;
    --space-16: 64px;
    --space-24: 96px;

    /* Border Radius */
    --radius-btn:   8px;
    --radius-input: 8px;
    --radius-card:  12px;
    --radius-pill:  999px;

    /* Shadows */
    --shadow-card:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-float: 0 8px 32px rgba(37,99,235,.15);
    
    /* Layout */
    --container-max: 1200px;
}

/* ==========================================================================
   2. CSS RESET & GLOBAL BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

img, picture, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

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

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

ul, ol {
    list-style: none;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; font-weight: 700; }
p { margin-bottom: var(--space-4); }
strong { font-weight: 600; }

/* ==========================================================================
   4. LAYOUT & CONTAINERS
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .container { padding: 0 var(--space-8); }
}

/* ==========================================================================
   5. HEADER & NAVIGATION
   ========================================================================== */
.site-header { 
    border-bottom: 1px solid var(--color-border); 
    background: var(--color-white); 
    position: sticky; 
    top: 0; 
    z-index: 100;
}
.header-inner { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 72px; 
    gap: 24px;
}

.header-left { display: flex; align-items: center; }
.brand-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo img { height: 60px; width: auto; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 800; color: var(--color-text); margin: 0; }
.brand-id { color: #FBBC05; }
.brand-subtitle { font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.05em; text-transform: uppercase; }

.header-right { display: flex; align-items: center; gap: 20px; }
.main-nav .nav-list { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-link { color: var(--color-text-muted); font-weight: 600; font-size: 0.95rem; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.nav-link:hover, .nav-item.active .nav-link { color: var(--color-primary); }

.has-dropdown { position: relative; }
.dropdown-toggle { display: flex; align-items: center; gap: var(--space-1); cursor: pointer; }
.chevron { transition: transform 0.2s ease; }
.dropdown-menu {
    position: absolute; top: 100%; left: 0; background: var(--color-white);
    min-width: 260px; border-radius: var(--radius-card); box-shadow: var(--shadow-card);
    padding: var(--space-3); opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.2s ease; z-index: 101; border: 1px solid var(--color-border);
}
.has-dropdown:hover .dropdown-menu, .has-dropdown.focus-within .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu a {
    display: block; padding: var(--space-2) var(--space-3); color: var(--color-text);
    border-radius: var(--radius-btn); font-weight: 500;
}
.dropdown-menu a:hover { background-color: var(--color-light-bg); color: var(--color-primary); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.icon-btn { 
    background: none; border: none; cursor: pointer; color: var(--color-text-muted); 
    display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: 50%; 
    transition: background 0.2s, color 0.2s; 
}
.icon-btn:hover { color: var(--color-primary); background: var(--color-light-bg); }
.mobile-menu-toggle { display: none; }

.main-nav.mobile-active {
    display: block; position: absolute; top: 72px; left: 0; width: 100%;
    background: var(--color-white); padding: var(--space-4); box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-top: 1px solid var(--color-border);
}
.main-nav.mobile-active .nav-list { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.main-nav.mobile-active .dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding-left: var(--space-4);
}

html.dark-theme .icon-btn:hover { background: #1E293B; }

@media (max-width: 1024px) { 
    .main-nav { display: none; } 
    .mobile-menu-toggle { display: flex; } 
}
@media (max-width: 640px) { 
    .header-inner { gap: 12px; } 
    .brand-title { font-size: 1.1rem; } 
    .brand-logo img { height: 32px; } 
    .header-right { gap: 8px; } 
    .header-actions { margin-left: 0; gap: 4px; } 
}

/* ==========================================================================
   6. HERO SECTION
   ========================================================================== */
.hero-section {
    background-color: var(--color-dark-bg);
    color: var(--color-white);
    padding: var(--space-16) 0 var(--space-24) 0;
    text-align: center;
}
.hero-section h1 { color: var(--color-white); }
.hero-section p {
    color: #94A3B8;
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto var(--space-8) auto;
}
.hero-compact {
    background-color: var(--color-white);
    color: var(--color-text);
    padding: var(--space-8) 0 var(--space-12) 0;
    border-bottom: 1px solid var(--color-border);
}
.hero-compact h1 { color: var(--color-text); }
.hero-compact p { color: var(--color-text-muted); }

/* ==========================================================================
   7. BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; font-weight: 600; font-family: var(--font-body);
    border-radius: var(--radius-btn); cursor: pointer; transition: all 0.2s ease;
    border: 2px solid transparent; text-align: center; line-height: 1.5;
}
.btn-primary { background-color: var(--color-primary); color: var(--color-white); }
.btn-primary:hover {
    background-color: var(--color-primary-dark); color: var(--color-white);
    transform: translateY(-1px); box-shadow: var(--shadow-float);
}
.btn-accent { background-color: var(--color-accent); color: var(--color-white); }
.btn-accent:hover { background-color: var(--color-accent-dark); color: var(--color-white); }
.btn-outline { background-color: transparent; border-color: var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background-color: var(--color-primary); color: var(--color-white); }
.btn-full { width: 100%; }

/* ==========================================================================
   8. TOOL GRID SECTION
   ========================================================================== */
.tool-section { margin-top: calc(var(--space-16) * -1); margin-bottom: var(--space-16); position: relative; z-index: 10; }
.tool-grid {
    display: grid; grid-template-columns: 1fr; gap: var(--space-8);
    background: var(--color-white); padding: var(--space-6);
    border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}
@media (min-width: 1024px) {
    .tool-grid { grid-template-columns: 350px 1fr; padding: var(--space-8); gap: var(--space-12); }
}
.tool-preview-wrapper {
    background: var(--color-light-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius-card); padding: var(--space-6); display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    min-height: 300px; position: sticky; top: 96px;
}

/* ==========================================================================
   9. FORMS
   ========================================================================== */
.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-weight: 600; color: var(--color-text); margin-bottom: var(--space-2); font-size: 0.875rem; }
.form-control {
    width: 100%; padding: 0.75rem 1rem; font-family: var(--font-body); font-size: 1rem;
    color: var(--color-text); background-color: var(--color-white); border: 1px solid var(--color-border);
    border-radius: var(--radius-input); transition: all 0.2s ease;
}
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.file-upload-wrapper {
    position: relative; border: 2px dashed var(--color-border); border-radius: var(--radius-input);
    padding: var(--space-6); text-align: center; background: var(--color-light-bg);
    cursor: pointer; transition: border-color 0.2s ease;
}
.file-upload-wrapper:hover { border-color: var(--color-primary); }
.file-upload-input {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}

/* ==========================================================================
   10. CARD GRIDS (Blog / Categories)
   ========================================================================== */
.card-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin-bottom: var(--space-12); }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); } }
.card {
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-card);
    padding: var(--space-6); transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.card-title { font-size: 1.25rem; margin-bottom: var(--space-2); }

/* Clickable Anchor Cards */
a.card-clickable {
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
    background: var(--color-white); border: 1px solid var(--color-border);
    border-radius: 20px; padding: 28px; margin: 4px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}
a.card-clickable:hover {
    transform: translateY(-8px); border-color: var(--color-primary);
    box-shadow: 0 20px 40px -10px rgba(37,99,235,0.15);
}
a.card-clickable .card-cta {
    margin-top: auto; font-weight: 700; font-size: 0.9rem; color: var(--color-primary);
    display: flex; align-items: center; gap: 4px; transition: color 0.2s ease;
}
a.card-clickable:hover .card-cta { color: var(--color-primary-dark); }
html.dark-theme a.card-clickable { background: var(--color-card-bg); border-color: rgba(255,255,255,0.1); }
html.dark-theme a.card-clickable:hover { border-color: var(--color-primary); }

/* ==========================================================================
   11. FEATURES & HOW IT WORKS
   ========================================================================== */
.features-section, .how-it-works-section { padding: var(--space-16) 0; background: var(--color-white); }
.how-it-works-section { background: var(--color-light-bg); }
.step-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); text-align: center; }
@media (min-width: 768px) { .step-grid { grid-template-columns: repeat(3, 1fr); } }
.step-icon {
    width: 64px; height: 64px; background: var(--color-primary); color: var(--color-white);
    border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800; margin: 0 auto var(--space-4) auto;
}

/* ==========================================================================
   12. FAQ ACCORDION
   ========================================================================== */
.faq-section { padding: var(--space-12) 0; max-width: 800px; margin: 0 auto; }
.accordion-item { border-bottom: 1px solid var(--color-border); }
.accordion-trigger {
    width: 100%; text-align: left; background: none; border: none; padding: var(--space-4) 0;
    font-size: 1.125rem; font-weight: 700; font-family: var(--font-heading); color: var(--color-text);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.accordion-icon { transition: transform 0.3s ease; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion-inner { padding-bottom: var(--space-4); color: var(--color-text-muted); }
.accordion-item.active .accordion-icon { transform: rotate(180deg); }

/* ==========================================================================
   13. BREADCRUMBS
   ========================================================================== */
.breadcrumb-container { padding: var(--space-4) 0; background: var(--color-light-bg); border-bottom: 1px solid var(--color-border); }
.breadcrumb-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 0.875rem; }
.breadcrumb-item a { color: var(--color-text-muted); }
.breadcrumb-item::after { content: "/"; margin-left: var(--space-2); color: var(--color-border); }
.breadcrumb-item.active { color: var(--color-text); font-weight: 500; }
.breadcrumb-item.active::after { display: none; }

/* ==========================================================================
   14. FOOTER
   ========================================================================== */
.site-footer { background-color: var(--color-dark-bg); color: #94A3B8; padding: var(--space-16) 0 0 0; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); margin-bottom: var(--space-12); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-brand-logo { margin-bottom: 16px; display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.footer-brand-img { object-fit: contain; }
.footer-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.footer-brand-title { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; color: #FFFFFF; }
.footer-brand-id { color: #FBBC05; }
.footer-brand-subtitle { font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; color: #94A3B8; letter-spacing: 0.05em; text-transform: uppercase; }
.footer-desc { color: #94A3B8; font-size: 0.95rem; line-height: 1.6; }

.footer-heading { color: var(--color-white); font-size: 1.125rem; margin-bottom: var(--space-4); }
.footer-links li { margin-bottom: var(--space-2); }
.footer-links a { color: #94A3B8; transition: color 0.2s ease, padding-left 0.2s ease; }
.footer-links a:hover { color: var(--color-white); padding-left: 4px; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: var(--space-6) 0; text-align: center; font-size: 0.875rem; }
.disclaimer { margin-top: var(--space-2); font-size: 0.75rem; opacity: 0.7; }

/* ==========================================================================
   15. UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; background: var(--color-primary); color: var(--color-white); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.mt-8 { margin-top: var(--space-8); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }

/* ==========================================================================
   16. PRINT STYLES
   ========================================================================== */
@media print {
    .site-header, .site-footer, .hero-section, .header-cta, 
    .how-it-works-section, .faq-section, .template-gallery-section, .download-actions-grid {
        display: none !important;
    }
    body { background: #fff; color: #000; }
    .tool-grid { box-shadow: none; padding: 0; }
}

/* ==========================================================================
   17. PRO TOOL UI COMPONENTS
   ========================================================================== */
.pro-tool-container { display: flex; flex-direction: column; gap: 2rem; margin-top: -3rem; position: relative; z-index: 10; }
.pro-panel { background: var(--color-white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1.5rem; border: 1px solid var(--color-border); }
.pro-section-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--color-light-bg); color: var(--color-primary-dark); display: flex; align-items: center; gap: 0.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.segmented-control { display: flex; background: var(--color-light-bg); padding: 4px; border-radius: 8px; border: 1px solid var(--color-border); }
.segmented-control label { flex: 1; text-align: center; padding: 8px; cursor: pointer; font-weight: 600; font-size: 0.875rem; border-radius: 6px; transition: all 0.2s; }
.segmented-control input:checked + span { background: var(--color-white); box-shadow: 0 2px 4px rgba(0,0,0,0.1); color: var(--color-primary); display: block; padding: 6px; border-radius: 6px; }
.segmented-control input { display: none; }

@media(min-width: 1024px) {
    .pro-tool-container { flex-direction: row; align-items: flex-start; }
    .pro-form-panel { flex: 1; min-width: 0; }
    #previewPanel { width: 500px; position: sticky; top: 100px; }
    .close-preview-btn, .fab-preview, #mobileScrollToDownload { display: none !important; }
    .preview-content-wrapper { margin-bottom: 1.5rem; }
}

@media (max-width: 1023px) {
    .pro-tool-container { flex-direction: column; }
    #previewPanel { width: 100%; position: relative; background: transparent; box-shadow: none; border: none; padding: 0; }
    .preview-content-wrapper { display: flex; flex-direction: column; background: var(--color-white); padding: 1.25rem; border-radius: var(--radius-card); box-shadow: var(--shadow-card); border: 1px solid var(--color-border); margin-bottom: 1rem; transition: all 0.3s ease; }
    .preview-content-wrapper.is-sticky-mobile { position: fixed; top: 85px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 450px; box-shadow: 0 25px 80px rgba(0,0,0,0.6); z-index: 1000; border: 2px solid var(--color-primary); animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1); margin-bottom: 0; max-height: calc(100vh - 100px); overflow-y: auto; }
    @keyframes modalPop { 0% { opacity: 0; transform: translate(-50%, -20px) scale(0.98); } 100% { opacity: 1; transform: translate(-50%, 0) scale(1); } }
    .preview-content-wrapper .canvas-container { padding: 4px; margin-bottom: 12px !important; background: transparent !important; box-shadow: none; }
    .preview-content-wrapper canvas { max-height: 250px; object-fit: contain; }
    .close-preview-btn, #mobileScrollToDownload { display: none; }
    .preview-content-wrapper.is-sticky-mobile .close-preview-btn { display: flex; position: absolute; top: -12px; right: -12px; background: var(--color-white); color: var(--color-error); border: 2px solid var(--color-border); border-radius: 50%; width: 32px; height: 32px; font-size: 1.3rem; font-weight: bold; align-items: center; justify-content: center; cursor: pointer; z-index: 1010; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
    .preview-content-wrapper.is-sticky-mobile #mobileScrollToDownload { display: block; }
    .fab-preview { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--color-primary); color: var(--color-white); border: none; border-radius: 50px; padding: 8px 16px; font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; box-shadow: 0 4px 15px rgba(37,99,235,0.4); z-index: 99; cursor: pointer; animation: pulse-ring 2s infinite; }
    @keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,0.7); } 70% { box-shadow: 0 0 0 8px rgba(37,99,235,0); } 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); } }
    .download-section { background: var(--color-white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1.5rem; border: 1px solid var(--color-border); }
    .download-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .download-actions-grid > button:first-child { grid-column: span 2; }
}
@media (max-width: 480px) { .preview-content-wrapper canvas { max-height: 200px; } }
@media (min-width: 1024px) { .download-actions-grid { display: grid; grid-template-columns: 1fr; gap: 12px; } .download-section { margin-top: 1.5rem; } }

/* ==========================================================================
   18. PREMIUM SEO CONTENT STYLING & FAQ
   ========================================================================== */
.seo-content-section { background: var(--color-white); padding: 3rem; border-radius: var(--radius-card); border: 1px solid var(--color-border); margin-top: 3rem; box-shadow: var(--shadow-card); }
.seo-heading { color: var(--color-primary-dark); margin-top: 2.5rem; margin-bottom: 1.5rem; font-size: 1.75rem; border-bottom: 3px solid var(--color-primary); padding-bottom: 8px; display: inline-block; }
.seo-subheading { color: var(--color-text); margin-top: 2rem; margin-bottom: 1rem; font-size: 1.35rem; border-bottom: 2px solid var(--color-border); padding-bottom: 6px; }
.seo-content-section p { color: var(--color-text-muted); line-height: 1.8; margin-bottom: 1rem; font-size: 1.05rem; }
.seo-content-section ul { margin-left: 1.5rem; margin-bottom: 1.5rem; color: var(--color-text-muted); line-height: 1.8; }
.seo-content-section li { margin-bottom: 0.75rem; }

.premium-card-ui { background: linear-gradient(145deg, var(--color-white), var(--color-light-bg)); border-radius: 24px; box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08); padding: 4rem; border: 1px solid rgba(226, 232, 240, 0.8); }
.premium-card-ui .seo-heading { position: relative; padding-bottom: 12px; margin-bottom: 2rem; border: none; }
.premium-card-ui .seo-heading::after { content: ''; position: absolute; bottom: 0; left: 0; width: 60px; height: 4px; background: var(--color-primary); border-radius: 2px; }
.premium-card-ui .seo-subheading { border-left: 4px solid var(--color-accent); padding-left: 1rem; margin-top: 3rem; border-bottom: none; }
.premium-card-ui p { font-size: 1.1rem; line-height: 1.85; color: #475569; }
ul.styled-list { margin-left: 0; padding-left: 0; }
ul.styled-list li { position: relative; padding-left: 2rem; margin-bottom: 1rem; font-size: 1.1rem; color: #475569; }
ul.styled-list li::before { content: '✓'; position: absolute; left: 0; color: var(--color-success); font-weight: bold; }
@media (max-width: 768px) { .premium-card-ui { padding: 2rem 1.5rem; border-radius: 16px; } }

.faq-wrapper { max-width: 850px; margin: 0 auto; }
.faq-floating-card { background: var(--color-white); border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); margin-bottom: 16px; border: 1px solid var(--color-border); transition: box-shadow 0.3s ease; overflow: hidden; }
.faq-floating-card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.faq-floating-card .faq-question { font-size: 1.15rem; font-weight: 700; color: var(--color-text); padding: 1.25rem 1.5rem; cursor: pointer; list-style: none; position: relative; }
.faq-floating-card .faq-question::-webkit-details-marker { display: none; }
.faq-floating-card .faq-question::after { content: '+'; position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 400; color: var(--color-primary); transition: transform 0.3s ease; }
.faq-floating-card[open] .faq-question::after { content: '−'; transform: translateY(-50%) rotate(180deg); }
.faq-floating-card .faq-answer { padding: 0 1.5rem 1.5rem 1.5rem; font-size: 1.05rem; line-height: 1.7; color: var(--color-text-muted); border-top: 1px solid var(--color-light-bg); margin-top: 0.5rem; padding-top: 1rem; }

/* Dark mode overrides for UI elements */
html.dark-theme .premium-card-ui { background: var(--color-card-bg); border-color: rgba(255,255,255,0.1); }
html.dark-theme .premium-card-ui p, html.dark-theme ul.styled-list li { color: #94A3B8; }
html.dark-theme .faq-floating-card { background: var(--color-card-bg); border-color: rgba(255,255,255,0.1); }
html.dark-theme .faq-floating-card .faq-question { color: var(--color-white); }

/* ==========================================================================
   20. 404 ERROR PAGE STYLES
   ========================================================================== */
.error-hero { background: linear-gradient(145deg, var(--color-white), var(--color-light-bg)); padding: 6rem 1rem 4rem 1rem; text-align: center; border-bottom: 1px solid var(--color-border); }
.error-code { font-size: clamp(4rem, 10vw, 8rem); font-family: var(--font-heading); font-weight: 800; color: var(--color-primary); line-height: 1; margin-bottom: 1rem; text-shadow: 0 10px 30px rgba(37,99,235,0.2); }
.error-title { font-size: clamp(1.5rem, 4vw, 2.5rem); color: var(--color-text); margin-bottom: 1rem; }
.error-desc { color: var(--color-text-muted); font-size: 1.1rem; max-width: 500px; margin: 0 auto 2.5rem auto; }
.quick-nav-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 3rem; }
.nav-pill { display: inline-flex; align-items: center; padding: 10px 24px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-pill); font-weight: 600; color: var(--color-text); text-decoration: none; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.nav-pill:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,99,235,0.1); }
.error-search-box { max-width: 500px; margin: 0 auto; position: relative; }
.error-search-input { width: 100%; padding: 16px 24px; border-radius: var(--radius-pill); border: 2px solid var(--color-border); font-size: 1.1rem; font-family: var(--font-body); outline: none; transition: border-color 0.2s ease; background: var(--color-white); color: var(--color-text); }
.error-search-input:focus { border-color: var(--color-primary); }
.error-search-btn { position: absolute; right: 8px; top: 8px; bottom: 8px; background: var(--color-primary); color: white; border: none; border-radius: var(--radius-pill); padding: 0 20px; font-weight: 600; cursor: pointer; transition: background 0.2s ease; }
.error-search-btn:hover { background: var(--color-primary-dark); }
html.dark-theme .error-hero { background: var(--color-dark-bg); }
html.dark-theme .nav-pill { background: var(--color-card-bg); border-color: rgba(255,255,255,0.1); }
html.dark-theme .error-search-input { background: var(--color-card-bg); border-color: rgba(255,255,255,0.1); }

/* ==========================================================================
   21. TEMPLATE GALLERY STYLES
   ========================================================================== */
.template-gallery-section { padding: 4rem 0; }
.gallery-category-title { font-family: var(--font-heading); font-size: 2.2rem; font-weight: 800; color: var(--color-dark-bg); margin-bottom: 0.5rem; }
.gallery-category-desc { font-size: 1.15rem; color: var(--color-text-muted); margin-bottom: 3rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-bottom: 5rem; }

.template-card { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.template-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }

.template-visual { height: 260px; background: #E2E8F0; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; border-bottom: 1px solid var(--color-border); padding: 10px; }
.template-visual canvas { border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; opacity: 0; transition: opacity 0.3s ease; }
.template-visual canvas.rendered { opacity: 1; }

.template-visual::before { content: ""; position: absolute; width: 30px; height: 30px; border: 3px solid rgba(0,0,0,0.1); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 1s linear infinite; z-index: 1; }
.template-visual.loaded::before { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.template-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.template-tag { align-self: flex-start; background: var(--color-light-bg); color: var(--color-primary); font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.template-name { font-size: 1.3rem; font-weight: 800; color: var(--color-dark-bg); margin-bottom: 0.5rem; line-height: 1.2; }
.template-desc { font-size: 0.95rem; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 1.5rem; }

/* FIX: Ensure template action buttons override generic link hover styles */
.template-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.btn-action { text-align: center; display: block; width: 100%; padding: 10px; font-weight: 600; border-radius: 6px; font-size: 0.9rem; cursor: pointer; border: none; text-decoration: none; transition: background 0.2s, color 0.2s; }

.btn-download { background: var(--color-light-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-download:hover { background: #E2E8F0; color: var(--color-text) !important; }

.btn-generate { background: var(--color-primary); color: #ffffff !important; }
.btn-generate:hover { background: var(--color-primary-dark); color: #ffffff !important; } /* Fixes hover overlap issue */

html.dark-theme .template-card { background: var(--color-card-bg); border-color: rgba(255,255,255,0.1); }
html.dark-theme .gallery-category-title { color: var(--color-white); }
html.dark-theme .template-name { color: var(--color-white); }
html.dark-theme .template-visual { background: #0F172A; border-color: rgba(255,255,255,0.1); }
html.dark-theme .template-tag { background: #0F172A; }
html.dark-theme .btn-download { background: #0F172A; color: var(--color-white); border-color: rgba(255,255,255,0.1); }
html.dark-theme .btn-download:hover { background: #1E293B; color: var(--color-white) !important; }