/* ============================================
   PDF Converter - Custom CSS
   No third-party dependencies
   AdSense compatible (no global overrides)
   ============================================ */

/* === CSS Variables === */
:root {
    --color-primary: #1a73e8;
    --color-primary-dark: #1557b0;
    --color-primary-light: #e8f0fe;
    --color-secondary: #5f6368;
    --color-success: #0d904f;
    --color-warning: #f9ab00;
    --color-danger: #d93025;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-bg-dark: #202124;
    --color-text: #202124;
    --color-text-light: #5f6368;
    --color-text-lighter: #80868b;
    --color-border: #dadce0;
    --color-border-light: #e8eaed;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --max-width: 1200px;
    --header-height: 64px;
    --transition: 0.2s ease;
    --tool-red: #d93025;
    --tool-red-bg: #fce8e6;
    --tool-blue: #1a73e8;
    --tool-blue-bg: #e8f0fe;
    --tool-green: #0d904f;
    --tool-green-bg: #e6f4ea;
    --tool-orange: #e8710a;
    --tool-orange-bg: #fef7e0;
    --tool-purple: #9334e6;
    --tool-purple-bg: #f3e8fd;
    --tool-teal: #007b83;
    --tool-teal-bg: #e0f7fa;
    --tool-yellow: #f9ab00;
    --tool-yellow-bg: #fef7e0;
    --tool-gray: #5f6368;
    --tool-gray-bg: #f1f3f4;
}

/* === Reset (scoped to .pdf-app) === */
.pdf-app *, .pdf-app *::before, .pdf-app *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-family); font-size: 16px; line-height: 1.6; color: var(--color-text); background: var(--color-bg); -webkit-font-smoothing: antialiased; }

/* === Typography === */
.pdf-app h1, .pdf-app h2, .pdf-app h3, .pdf-app h4 { line-height: 1.3; font-weight: 700; color: var(--color-text); }
.pdf-app h1 { font-size: 2.25rem; }
.pdf-app h2 { font-size: 1.75rem; }
.pdf-app h3 { font-size: 1.25rem; }
.pdf-app p { margin-bottom: 1rem; color: var(--color-text-light); }
.pdf-app a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
.pdf-app a:hover { color: var(--color-primary-dark); }

/* === Container === */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* === Header === */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--color-bg); border-bottom: 1px solid var(--color-border-light); height: var(--header-height); display: flex; align-items: center; }
.header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.site-logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; font-weight: 700; color: var(--color-text); text-decoration: none; }
.site-logo:hover { color: var(--color-primary); }
.logo-icon { width: 32px; height: 32px; background: var(--color-primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 0.9rem; }

/* === Desktop Nav === */
.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: flex; align-items: center; gap: 0.25rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.875rem; font-weight: 500; transition: background var(--transition); }
.nav-dropdown > a:hover { background: var(--color-bg-alt); color: var(--color-primary); }
.nav-arrow { font-size: 0.65rem; transition: transform var(--transition); }
.nav-dropdown:hover .nav-arrow { transform: rotate(180deg); }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: var(--color-bg); border: 1px solid var(--color-border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 0.5rem; z-index: 200; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.875rem; transition: background var(--transition); }
.dropdown-menu a:hover { background: var(--color-bg-alt); color: var(--color-primary); }
.dropdown-menu .tool-icon-sm { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* === Mobile Menu === */
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--color-text); }
.hamburger { display: block; width: 24px; height: 2px; background: currentColor; position: relative; transition: background var(--transition); }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 24px; height: 2px; background: currentColor; left: 0; transition: transform var(--transition); }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.mobile-nav { display: none; position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0; background: var(--color-bg); z-index: 150; overflow-y: auto; padding: 1rem; }
.mobile-nav.active { display: block; }
.mobile-nav-group { margin-bottom: 1.5rem; }
.mobile-nav-group h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-lighter); margin-bottom: 0.5rem; padding: 0 0.5rem; }
.mobile-nav-group a { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.5rem; border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.9rem; }
.mobile-nav-group a:hover { background: var(--color-bg-alt); }

/* === Hero === */
.hero { text-align: center; padding: 3rem 1.5rem; background: linear-gradient(135deg, var(--color-primary-light) 0%, #f0f6ff 50%, #e8f5e9 100%); }
.hero h1 { font-size: 2.5rem; margin-bottom: 0.75rem; background: linear-gradient(135deg, var(--color-primary), #7c4dff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.15rem; color: var(--color-text-light); max-width: 600px; margin: 0 auto 2rem; }

/* === Tool Grid === */
.tools-section { padding: 2.5rem 0; }
.tools-section-title { font-size: 1.35rem; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.tool-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; background: var(--color-bg); border: 1px solid var(--color-border-light); border-radius: var(--radius-md); transition: all var(--transition); text-decoration: none; color: inherit; }
.tool-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.tool-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-icon svg { width: 24px; height: 24px; }
.tool-card-content h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.tool-card-content p { font-size: 0.85rem; color: var(--color-text-light); margin: 0; line-height: 1.4; }

/* Tool colors */
.tool-color-red { background: var(--tool-red-bg); color: var(--tool-red); }
.tool-color-blue { background: var(--tool-blue-bg); color: var(--tool-blue); }
.tool-color-green { background: var(--tool-green-bg); color: var(--tool-green); }
.tool-color-orange { background: var(--tool-orange-bg); color: var(--tool-orange); }
.tool-color-purple { background: var(--tool-purple-bg); color: var(--tool-purple); }
.tool-color-teal { background: var(--tool-teal-bg); color: var(--tool-teal); }
.tool-color-yellow { background: var(--tool-yellow-bg); color: var(--tool-yellow); }
.tool-color-gray { background: var(--tool-gray-bg); color: var(--tool-gray); }

/* === Tool Page === */
.tool-page { padding: 2rem 0 3rem; }
.tool-header { text-align: center; margin-bottom: 2rem; }
.tool-header .tool-icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: var(--radius-md); }
.tool-header .tool-icon svg { width: 32px; height: 32px; }
.tool-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.tool-header p { font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* === Upload Area === */
.upload-area { max-width: 700px; margin: 0 auto 2rem; border: 2px dashed var(--color-border); border-radius: var(--radius-lg); padding: 3rem 2rem; text-align: center; cursor: pointer; transition: all var(--transition); background: var(--color-bg-alt); position: relative; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--color-primary); background: var(--color-primary-light); }
.upload-area.has-files { border-style: solid; border-color: var(--color-success); background: #e6f4ea; }
.upload-icon { width: 64px; height: 64px; margin: 0 auto 1rem; color: var(--color-text-lighter); }
.upload-area.drag-over .upload-icon { color: var(--color-primary); }
.upload-text { font-size: 1.1rem; font-weight: 500; color: var(--color-text); margin-bottom: 0.5rem; }
.upload-hint { font-size: 0.85rem; color: var(--color-text-lighter); }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* File list */
.file-list { max-width: 700px; margin: 0 auto 1.5rem; list-style: none; }
.file-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: var(--color-bg); border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.file-item-icon { color: var(--color-primary); flex-shrink: 0; }
.file-item-name { flex: 1; font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { font-size: 0.8rem; color: var(--color-text-lighter); flex-shrink: 0; }
.file-item-remove { background: none; border: none; cursor: pointer; color: var(--color-text-lighter); padding: 0.25rem; border-radius: 4px; transition: all var(--transition); }
.file-item-remove:hover { color: var(--color-danger); background: #fce8e6; }

/* === Options Panel === */
.options-panel { max-width: 700px; margin: 0 auto 1.5rem; background: var(--color-bg); border: 1px solid var(--color-border-light); border-radius: var(--radius-md); padding: 1.5rem; }
.options-panel h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--color-text); }
.option-group { margin-bottom: 1rem; }
.option-group:last-child { margin-bottom: 0; }
.option-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--color-text); margin-bottom: 0.375rem; }
.option-group input[type="text"],
.option-group input[type="number"],
.option-group input[type="password"],
.option-group select,
.option-group textarea { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit; color: var(--color-text); background: var(--color-bg); transition: border-color var(--transition); }
.option-group input:focus, .option-group select:focus, .option-group textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.15); }
.option-radio-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.option-radio { display: flex; align-items: center; gap: 0.375rem; cursor: pointer; font-size: 0.875rem; }
.option-radio input[type="radio"] { width: 16px; height: 16px; accent-color: var(--color-primary); }

/* === Buttons === */
.convert-actions { text-align: center; margin-bottom: 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 2rem; border: none; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all var(--transition); text-decoration: none; }
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { background: var(--color-border); color: var(--color-text-lighter); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #0b7a43; }
.btn-lg { padding: 1rem 3rem; font-size: 1.1rem; border-radius: var(--radius-md); }

/* === Progress === */
.progress-container { max-width: 500px; margin: 0 auto 2rem; display: none; }
.progress-container.active { display: block; }
.progress-bar { width: 100%; height: 6px; background: var(--color-border-light); border-radius: 3px; overflow: hidden; margin-bottom: 0.5rem; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: 3px; width: 0%; transition: width 0.3s ease; animation: progress-pulse 1.5s ease-in-out infinite; }
@keyframes progress-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.progress-text { text-align: center; font-size: 0.85rem; color: var(--color-text-light); }

/* === Download Area === */
.download-area { max-width: 500px; margin: 0 auto 2rem; text-align: center; padding: 2rem; background: #e6f4ea; border-radius: var(--radius-md); display: none; }
.download-area.active { display: block; }
.download-area .success-icon { width: 56px; height: 56px; margin: 0 auto 1rem; color: var(--color-success); }
.download-area h3 { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--color-success); }
.download-area p { font-size: 0.9rem; margin-bottom: 1.25rem; }

/* === Error Area === */
.error-area { max-width: 500px; margin: 0 auto 2rem; text-align: center; padding: 1.5rem; background: #fce8e6; border-radius: var(--radius-md); display: none; }
.error-area.active { display: block; }
.error-area p { color: var(--color-danger); font-weight: 500; }

/* === Content Sections === */
.tool-content { max-width: 800px; margin: 0 auto; padding-top: 2rem; }
.content-section { margin-bottom: 2.5rem; }
.content-section h2 { font-size: 1.5rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--color-border-light); }
.content-section p { margin-bottom: 0.75rem; line-height: 1.7; }
.content-section ol, .content-section ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.content-section li { margin-bottom: 0.5rem; line-height: 1.6; color: var(--color-text-light); }

/* Steps */
.steps-list { list-style: none; padding: 0; counter-reset: step; }
.steps-list li { counter-increment: step; display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--color-border-light); }
.steps-list li:last-child { border-bottom: none; }
.steps-list li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; flex-shrink: 0; }

/* FAQ */
.faq-item { border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); margin-bottom: 0.75rem; overflow: hidden; }
.faq-question { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; cursor: pointer; background: var(--color-bg); border: none; width: 100%; text-align: left; font-size: 0.95rem; font-weight: 600; font-family: inherit; color: var(--color-text); transition: background var(--transition); }
.faq-question:hover { background: var(--color-bg-alt); }
.faq-arrow { font-size: 0.8rem; transition: transform var(--transition); flex-shrink: 0; }
.faq-item.active .faq-arrow { transform: rotate(180deg); }
.faq-answer { padding: 0 1.25rem; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.active .faq-answer { max-height: 500px; padding: 0 1.25rem 1.25rem; }
.faq-answer p { font-size: 0.9rem; line-height: 1.6; }

/* === Related Tools === */
.related-tools { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-border-light); }
.related-tools h2 { font-size: 1.35rem; margin-bottom: 1rem; }
.related-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.75rem; }

/* === Breadcrumb === */
.breadcrumb { padding: 1rem 0 0; font-size: 0.85rem; }
.breadcrumb a { color: var(--color-text-light); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb span { color: var(--color-text-lighter); margin: 0 0.375rem; }
.breadcrumb .current { color: var(--color-text); font-weight: 500; }

/* === Footer === */
.site-footer { background: var(--color-bg-dark); color: #e8eaed; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: #fff; font-size: 0.9rem; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.footer-col a { display: block; color: #9aa0a6; font-size: 0.85rem; padding: 0.2rem 0; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid #3c4043; font-size: 0.8rem; color: #9aa0a6; }

/* === Static Pages === */
.static-page { max-width: 800px; margin: 0 auto; padding: 2rem 0 3rem; }
.static-page h1 { margin-bottom: 1.5rem; }
.static-page h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
.static-page p, .static-page li { color: var(--color-text-light); line-height: 1.7; }

/* === Responsive === */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: 1rem; }
    .hero { padding: 2rem 1rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .tool-header h1 { font-size: 1.5rem; }
    .upload-area { padding: 2rem 1rem; }
    .upload-icon { width: 48px; height: 48px; }
    .options-panel { padding: 1rem; }
    .btn-lg { padding: 0.875rem 2rem; font-size: 1rem; width: 100%; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 0 1rem; }
    .content-section h2 { font-size: 1.25rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .pdf-app h1 { font-size: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .tool-card { padding: 1rem; }
    .option-radio-group { flex-direction: column; }
}

@media print {
    .site-header, .site-footer, .upload-area, .convert-actions, .progress-container, .download-area, .error-area { display: none; }
}

.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; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
