@import url('footer.css');

/* --- Dark Mode CSS Custom Properties --- */
:root {
    --bg-body: #f8fafc;
    --text-primary: #334155;
    --text-secondary: #64748b;
    --text-heading: #1e293b;
    --text-muted: #94a3b8;
    --text-nav: #475569;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-border-light: #f3f4f6;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --light-bg: #f8fafc;
    --nav-hover-bg: #f1f5f9;
    --drop-zone-bg: #fafafa;
    --drop-zone-border: #cbd5e1;
    --faq-bg: #f8fafc;
    --blue-accent: #3b82f6;
    --blue-accent-hover: #2563eb;
    --green-accent: #059669;
    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.1);
    --progress-track: #e2e8f0;
    --reset-border: #64748b;
    --reset-hover-bg: #1e293b;
    --drag-hover-bg: #eff6ff;
    --focus-ring: rgba(59, 130, 246, 0.1);
    --disabled-bg: #9ca3af;
    --cancel-color: #ef4444;
    --video-thumb-bg: #e2e8f0;
    --footer-bg: #f1f5f9;
    --footer-text: #64748b;
    --footer-border: #e2e8f0;
    color-scheme: light dark;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-heading: #f1f5f9;
    --text-muted: #94a3b8;
    --text-nav: #cbd5e1;
    --card-bg: #1e293b;
    --card-border: #334155;
    --card-border-light: #334155;
    --input-bg: #1e293b;
    --input-border: #475569;
    --light-bg: #1e293b;
    --nav-hover-bg: #334155;
    --drop-zone-bg: #1e293b;
    --drop-zone-border: #475569;
    --faq-bg: #1e293b;
    --shadow-sm: rgba(0, 0, 0, 0.2);
    --shadow-md: rgba(0, 0, 0, 0.3);
    --progress-track: #334155;
    --reset-border: #94a3b8;
    --reset-hover-bg: #f1f5f9;
    --drag-hover-bg: #1e3a5f;
    --focus-ring: rgba(59, 130, 246, 0.3);
    --disabled-bg: #475569;
    --cancel-color: #f87171;
    --video-thumb-bg: #334155;
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --footer-border: #334155;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-body: #0f172a;
        --text-primary: #e2e8f0;
        --text-secondary: #94a3b8;
        --text-heading: #f1f5f9;
        --text-muted: #94a3b8;
        --text-nav: #cbd5e1;
        --card-bg: #1e293b;
        --card-border: #334155;
        --card-border-light: #334155;
        --input-bg: #1e293b;
        --input-border: #475569;
        --light-bg: #1e293b;
        --nav-hover-bg: #334155;
        --drop-zone-bg: #1e293b;
        --drop-zone-border: #475569;
        --faq-bg: #1e293b;
        --shadow-sm: rgba(0, 0, 0, 0.2);
        --shadow-md: rgba(0, 0, 0, 0.3);
        --progress-track: #334155;
        --reset-border: #94a3b8;
        --reset-hover-bg: #f1f5f9;
        --drag-hover-bg: #1e3a5f;
        --focus-ring: rgba(59, 130, 246, 0.3);
        --disabled-bg: #475569;
        --cancel-color: #f87171;
        --video-thumb-bg: #334155;
        --footer-bg: #0f172a;
        --footer-text: #94a3b8;
        --footer-border: #334155;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Side Rail Ads - Desktop Only (160x600 skyscraper) */
.side-rail-ad {
    display: none;
}
@media (min-width: 1100px) {
    .side-rail-ad {
        display: block;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100;
        width: 160px;
    }
    .side-rail-ad.left {
        left: 10px;
    }
    .side-rail-ad.right {
        right: 10px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 2rem;
    flex-grow: 1;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    background: none;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover {
    background-color: var(--nav-hover-bg);
}

.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 3px var(--shadow-sm);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.main-nav a {
    text-decoration: none;
    color: var(--text-nav);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}
.main-nav a:hover {
    background-color: var(--nav-hover-bg);
    color: var(--text-heading);
}
.main-nav a.active {
    background-color: var(--blue-accent);
    color: white;
}

.header { text-align: center; margin-bottom: 2rem; }
.logo { font-size: 2rem; font-weight: 700; color: var(--text-heading); margin-bottom: 0.5rem; margin-top: 0; }
.subtitle { font-size: 1rem; color: var(--text-secondary); font-weight: 400; margin: 0; }
/* Hero banner for LCP */
.hero-banner { contain: layout style paint; }
.intro-text { font-size: 1.1rem; color: var(--text-nav); text-align: center; margin-bottom: 2.5rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.upload-box { background: var(--card-bg); border-radius: 12px; padding: 2rem; margin-bottom: 2rem; box-shadow: 0 1px 3px var(--shadow-md); border: 1px solid var(--card-border); transition: all 0.3s ease; }
#drop-zone { border: 2px dashed var(--drop-zone-border); border-radius: 8px; padding: 3rem 2rem; text-align: center; cursor: pointer; transition: all 0.3s ease; background: var(--drop-zone-bg); display: flex; flex-direction: column; justify-content: center; align-items: center; }
#drop-zone.drag-hover { border-color: var(--blue-accent); background: var(--drag-hover-bg); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.upload-icon { font-size: 3rem; margin-bottom: 1rem; color: var(--text-muted); }
.drop-text { font-size: 1.1rem; color: var(--text-nav); margin-bottom: 1.5rem; font-weight: 500; }
.choose-video-button { background: var(--blue-accent); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 6px; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
#progress-container { background: var(--light-bg); border-radius: 8px; padding: 1.5rem; border: 1px solid var(--card-border); }
.progress-bar { width: 100%; height: 8px; background: var(--progress-track); border-radius: 4px; overflow: hidden; margin-top: 0.5rem;}
#progress-fill { width: 0%; height: 100%; background: var(--blue-accent); border-radius: 4px; transition: width 0.1s linear; }
#upload-status { font-size: 0.9rem; font-weight: 500; text-align: center; }

.options-box { background: var(--card-bg); border-radius: 12px; padding: 2rem; box-shadow: 0 1px 3px var(--shadow-md); border: 1px solid var(--card-border); }
.options-box.disabled { opacity: 0.5; pointer-events: none; }
.options-title { font-size: 1.2rem; font-weight: 600; color: var(--text-heading); margin-bottom: 1.5rem; text-align: center; }
.duration-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 2rem; }
.duration-btn { background: var(--nav-hover-bg); color: var(--text-nav); border: 1px solid var(--card-border); padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.9rem; font-weight: 500; cursor: pointer; text-decoration: none; text-align: center; display: block; }
.custom-form { background: var(--light-bg); padding: 2rem; border-radius: 8px; border: 1px solid var(--card-border); display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.custom-form input[type="number"] { flex-grow: 1; min-width: 120px; padding: 0.8rem 1rem; border: 1px solid var(--input-border); border-radius: 6px; font-size: 1rem; transition: border-color 0.2s ease; background: var(--input-bg); color: var(--text-primary); }
.custom-form input[type="number"]:focus { outline: none; border-color: var(--blue-accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.custom-btn { background: var(--green-accent); color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 6px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.3s ease; }
#download-container { background: var(--card-bg); border-radius: 12px; padding: 2rem; margin-top: 2rem; box-shadow: 0 1px 3px var(--shadow-md); border: 1px solid var(--card-border); text-align: center; }
.download-options { display: flex; flex-direction: column; gap: 1rem; }
.download-options button { display: block; width: 100%; text-decoration: none; padding: 1rem; border-radius: 8px; font-weight: 600; font-size: 1.1rem; font-family: inherit; cursor: pointer; border: none; }
#download-zip-btn { background: var(--green-accent); color: white; }
#download-all-btn { background: var(--blue-accent); color: white; }
.download-options button:disabled { background: var(--disabled-bg); cursor: not-allowed; }
.download-note { font-size: 0.8rem; color: var(--text-secondary); margin-top: 1.5rem; }
.hidden { display: none !important; }

#reset-zone { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--card-border); }
#reset-btn { background: transparent; border: 2px solid var(--reset-border); color: var(--reset-border); padding: 0.75rem 1.5rem; width: 100%; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
#reset-btn:hover { background: var(--reset-hover-bg); border-color: var(--reset-hover-bg); color: white; }
[data-theme="dark"] #reset-btn:hover { color: #0f172a; }

.faq-container { background: var(--card-bg); border-radius: 12px; padding: 2rem; margin-top: 2rem; box-shadow: 0 1px 3px var(--shadow-md); border: 1px solid var(--card-border); }
.faq-title { font-size: 1.5rem; font-weight: 600; color: var(--text-heading); margin-bottom: 1.5rem; text-align: center; }
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item { background: var(--faq-bg); border: 1px solid var(--card-border); border-radius: 8px; transition: all 0.3s ease; }
.faq-item summary { font-size: 1.1rem; font-weight: 500; color: var(--text-primary); padding: 1rem 1.25rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; transition: background-color 0.2s ease; }
.faq-item summary:hover { background-color: var(--nav-hover-bg); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ''; border-style: solid; border-color: var(--blue-accent); border-width: 0 2px 2px 0; display: inline-block; height: 8px; width: 8px; transform: rotate(45deg); transition: transform 0.3s ease-in-out; }
.faq-item[open] > summary { border-bottom: 1px solid var(--card-border); }
.faq-item[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq-item p { color: var(--text-nav); padding: 1.25rem; margin: 0; }

.content-section { background: var(--card-bg); border-radius: 12px; padding: 2rem; margin-bottom: 2rem; box-shadow: 0 1px 3px var(--shadow-md); border: 1px solid var(--card-border); }
.content-title { font-size: 1.5rem; font-weight: 600; color: var(--text-heading); text-align: center; margin-bottom: 2rem; }
.features-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; list-style: none; padding: 0; }
.feature-card { background: var(--card-bg); border-radius: 16px; padding: 1.5rem 1rem; text-align: center; border: 1px solid var(--card-border-light); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03); transition: all 0.3s ease; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.07); }
.feature-card-icon-wrapper { width: 64px; height: 64px; background: var(--light-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem auto; border: 1px solid var(--card-border-light); }
.feature-icon { font-size: 2rem; }
.feature-card h3 { font-size: 1rem; font-weight: 600; color: var(--text-heading); margin-bottom: 0.25rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }

/* --- Policy & Blog Page Styles --- */
.policy-container { background: var(--card-bg); border-radius: 12px; padding: 2rem 2.5rem; margin-bottom: 2rem; box-shadow: 0 1px 3px var(--shadow-md); border: 1px solid var(--card-border); text-align: left; }
.policy-container h1 { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--text-heading); }
.policy-container h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; color: var(--text-heading); border-bottom: 1px solid var(--card-border); padding-bottom: 0.5rem;}
.policy-container p { margin-bottom: 1rem; }
.policy-container ul { list-style-position: inside; padding-left: 1rem; margin-bottom: 1rem; }
.policy-container ol { list-style-position: inside; padding-left: 1rem; margin-bottom: 1rem; }
.policy-container li { margin-bottom: 1rem; }
.policy-container a { color: var(--blue-accent); text-decoration: none; font-weight: 500; }
.policy-container a:hover { text-decoration: underline; }
.blog-post .post-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 2rem; border-bottom: 1px solid var(--card-border); padding-bottom: 1rem; }
.blog-list-container { background: var(--card-bg); border-radius: 12px; padding: 2rem 2.5rem; box-shadow: 0 1px 3px var(--shadow-md); border: 1px solid var(--card-border); }
.blog-list-container h1 { font-size: 1.8rem; color: var(--text-heading); margin-bottom: 2rem; text-align: center; }
.post-card { border-bottom: 1px solid var(--card-border); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.post-card:last-child { border-bottom: none; margin-bottom: 0; }
.post-card h2 { font-size: 1.4rem; color: var(--text-heading); margin-bottom: 0.5rem; }
.post-excerpt { color: var(--text-nav); margin-bottom: 1rem; }
.read-more-btn { color: var(--blue-accent); text-decoration: none; font-weight: 600; }
.read-more-btn:hover { text-decoration: underline; }

/* --- SEO Read More --- */
.seo-article { text-align: left; }
.seo-article h2 { text-align: center; }
.seo-article p { margin-bottom: 0.75rem; }
.seo-article a { color: var(--blue-accent); text-decoration: none; font-weight: 500; }
.seo-article a:hover { text-decoration: underline; }
.seo-read-more > summary { list-style: none; }
.seo-read-more > summary::-webkit-details-marker { display: none; }
.seo-read-more[open] > summary span { display: inline-block; transform: rotate(180deg); }

/* --- Responsive Adjustments --- */
@media (max-width: 640px) {
    .container { max-width: 100%; margin: 0 1rem; }
    .upload-box, .options-box, .faq-container, .content-section, .policy-container { padding: 2rem 1.5rem; }
    .custom-form { flex-direction: column; }
    .custom-form input[type="number"],
    .custom-form .custom-btn { width: 100%; }
    .features-list { grid-template-columns: repeat(2, 1fr); }
    .main-nav { flex-direction: column; text-align: center; }
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
}

/* --- Video Preview Card --- */
.video-preview-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}
.video-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--video-thumb-bg);
}
.video-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.video-filename {
    font-size: 0.9rem;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Parts List --- */
#parts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}
.part-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--light-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.part-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.part-number {
    font-weight: 600;
    color: var(--text-heading);
    min-width: 50px;
}
.part-range {
    color: var(--text-secondary);
}
.part-size {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.part-download-btn {
    background: var(--blue-accent);
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.part-download-btn:hover {
    background: var(--blue-accent-hover);
}

/* --- Cancel Button --- */
.cancel-btn {
    display: block;
    margin: 1rem auto 0;
    background: transparent;
    border: 2px solid var(--cancel-color);
    color: var(--cancel-color);
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cancel-btn:hover {
    background: var(--cancel-color);
    color: white;
}
.cancel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Loading Pulse Animation --- */
.loading-pulse {
    display: inline-block;
    animation: loadingPulse 1.5s ease-in-out infinite;
}
@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Keyframe Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* --- Tools Grid (Internal Linking) --- */
.tools-grid-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.tool-link-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tool-link-card:hover {
    border-color: var(--blue-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-sm);
}
.tool-link-card h4 {
    font-size: 0.95rem;
    margin: 0;
    color: var(--blue-accent);
}
.tool-link-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* --- SEO Read More Section --- */
.seo-read-more summary::-webkit-details-marker {
    display: none;
}
.seo-read-more summary {
    list-style: none;
}
.seo-read-more[open] summary span {
    transform: rotate(180deg);
}
