:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --drop-border: rgba(96, 165, 250, 0.4);
    --drop-bg-hover: rgba(59, 130, 246, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Background Orbs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(to right, #ec4899, #8b5cf6);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    z-index: 100;
    box-sizing: border-box;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.site-logo {
    width: 40px;
    height: 40px;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 7.5rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glassmorphism Drop Zone */
.drop-zone {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px dashed var(--drop-border);
    border-radius: 1.5rem;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drop-zone.drag-active {
    border-color: var(--primary-color);
    background: var(--drop-bg-hover);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: opacity 0.3s;
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.drop-zone h2 {
    font-size: 1.5rem;
    font-weight: 500;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Buttons */
.file-input-wrapper {
    position: relative;
    margin-top: 1rem;
}

#file-upload {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Status Overlay */
.status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.status-overlay h3 {
    font-weight: 500;
}

.status-overlay p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-container {
    width: 60%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Results Section */
.result-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

.result-content {
    padding: 1.5rem;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
}

#transcript-text {
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-wrap;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

html {
    scroll-behavior: smooth;
}

/* ==========================================================
   SEO Guide (dismissible, indexable content)
   ========================================================== */
.seo-guide {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.seo-guide.is-collapsed {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 999px;
    align-self: center;
}

.guide-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.75rem 0.75rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.15);
}

.seo-guide.is-collapsed .guide-bar {
    border-bottom: none;
    background: transparent;
    padding: 0.4rem 0.4rem 0.4rem 1.25rem;
}

.guide-bar-label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.guide-toggle {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 0.45rem 0.6rem 0.45rem 0.9rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.guide-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}

.guide-toggle:focus-visible,
.guide-faq summary:focus-visible,
.guide-cta .btn-primary:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.guide-toggle-icon {
    transition: transform 0.3s ease;
}

/* × rotates into a + when collapsed */
.seo-guide.is-collapsed .guide-toggle-icon {
    transform: rotate(45deg);
}

/* NOTE: never set display/visibility on .guide-body – it breaks hidden="until-found" */
.guide-inner {
    padding: 2rem 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    animation: guideIn 0.4s ease-out;
}

@keyframes guideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.guide-section h2 {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.9rem;
    color: var(--text-color);
}

.guide-intro h2 {
    font-size: 1.6rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guide-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #e2e8f0;
}

.guide-section p,
.guide-section li {
    color: #cbd5e1;
    line-height: 1.7;
    font-size: 0.975rem;
}

.guide-section p + p {
    margin-top: 0.75rem;
}

.guide-section strong {
    color: #f1f5f9;
    font-weight: 600;
}

.guide-section a {
    color: #93c5fd;
    text-underline-offset: 3px;
}

.guide-section a:hover {
    color: #bfdbfe;
}

/* Badges & chips */
.guide-badges,
.guide-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.guide-badges li,
.guide-chips li {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    color: #e0e7ff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(129, 140, 248, 0.3);
}

.guide-chips {
    margin: 0.5rem 0 1rem;
}

.guide-chips li {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
}

.guide-note {
    font-size: 0.9rem !important;
    color: var(--text-muted) !important;
}

/* Numbered steps */
.guide-steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.guide-steps li {
    counter-increment: step;
    position: relative;
    padding: 1.25rem 1.1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.guide-steps li:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.35);
}

.guide-steps li::before {
    content: counter(step);
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.guide-steps p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Feature cards */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.guide-card {
    padding: 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.04));
    border: 1px solid var(--card-border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.35);
}

.guide-card p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Bulleted lists */
.guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.guide-list li {
    position: relative;
    padding-left: 1.5rem;
}

.guide-list li::before {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.65em;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
}

/* Comparison table */
.guide-table-wrap {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid var(--card-border);
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.guide-table th,
.guide-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    color: #cbd5e1;
}

.guide-table thead th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-weight: 600;
}

.guide-table tbody th {
    color: var(--text-muted);
    font-weight: 500;
}

.guide-table tbody td:nth-child(2) {
    color: #a5f3fc;
    font-weight: 500;
}

.guide-table tbody tr:last-child th,
.guide-table tbody tr:last-child td {
    border-bottom: none;
}

/* FAQ accordion */
.guide-faq {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guide-faq details {
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.guide-faq details[open] {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(96, 165, 250, 0.3);
}

.guide-faq summary {
    list-style: none;
    cursor: pointer;
    padding: 0.95rem 3rem 0.95rem 1.1rem;
    font-weight: 500;
    color: #e2e8f0;
    position: relative;
    border-radius: 0.85rem;
}

.guide-faq summary::-webkit-details-marker {
    display: none;
}

.guide-faq summary::after {
    content: '';
    position: absolute;
    right: 1.2rem;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.25s ease;
}

.guide-faq details[open] summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.guide-faq summary:hover {
    color: #fff;
}

.guide-faq details p {
    padding: 0 1.1rem 1rem;
    font-size: 0.925rem;
}

/* CTA */
.guide-cta {
    display: flex;
    justify-content: center;
}

.guide-cta .btn-primary {
    display: inline-flex;
    text-decoration: none;
    border-radius: 999px;
    padding: 0.85rem 1.75rem;
    font-weight: 500;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guide-cta .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

@media (max-width: 600px) {
    .app-container {
        padding: 6.5rem 1rem 3rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    .guide-inner {
        padding: 1.5rem 1.25rem 2rem;
    }

    .guide-bar-label {
        font-size: 0.72rem;
    }

    .guide-steps {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .guide-inner,
    .guide-toggle-icon,
    .guide-steps li,
    .guide-card,
    .guide-faq summary::after {
        animation: none;
        transition: none;
    }
}
