/* ============================================
   Freecvt.com — DOCX to TXT Converter Styles
   Dark Theme Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0f0f14;
    --bg-secondary: #1a1a24;
    --bg-tertiary: #24243a;
    --border-color: #2e2e48;
    --border-hover: #6366f1;
    --text-primary: #e0e0e0;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #22c55e;
    --error: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --max-w: 640px;
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    color: var(--accent-hover);
}

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

/* --- Skip Link (Accessibility) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    font-size: 24px;
}

/* --- Hamburger Menu --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

/* --- Nav --- */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex-wrap: wrap;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-links.open {
    max-height: 600px;
}

.nav-links a {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-glow);
    font-weight: 600;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Upload Zone --- */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.08);
}

.upload-zone.drag-over {
    transform: scale(1.01);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.upload-zone h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 14px;
}

.upload-zone .supported-formats {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* --- File List --- */
.file-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease;
}

.file-item:hover {
    border-color: var(--border-hover);
}

.file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

.file-status.pending {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
}

.file-status.converting {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    animation: pulse 1.5s ease-in-out infinite;
}

.file-status.done {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.file-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    display: none;
}

.progress-bar.visible {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* --- Convert Button --- */
.btn-convert {
    display: block;
    width: 100%;
    padding: 16px 24px;
    margin-top: 24px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-convert:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.btn-convert:active:not(:disabled) {
    transform: translateY(0);
}

.btn-convert:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-convert:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* --- Download Section --- */
.download-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius);
    display: none;
}

.download-section.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.download-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--success);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-download:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.btn-download:active {
    transform: translateY(0);
}

/* --- Error Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 90vw;
    text-align: center;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- How It Works --- */
.how-it-works {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
}

.how-it-works h2 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 24px;
}

.step {
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.step:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.step h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.step p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Info Section --- */
.info-section {
    margin-top: 48px;
    padding: 32px 0;
    border-top: 1px solid var(--border-color);
}

.info-section h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.info-section p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.info-section ul {
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}

.info-section ul li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-section ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
    margin-top: auto;
}

.site-footer p {
    font-size: 13px;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 12px 24px 24px;
        gap: 4px;
        z-index: 999;
    }

    .nav-links a {
        padding: 10px 16px;
        width: 100%;
    }

    .hero h1 {
        font-size: 26px;
    }

    .upload-zone {
        padding: 36px 16px;
    }

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

@media (max-width: 480px) {
    .hero h1 {
        font-size: 22px;
    }

    .hero .subtitle {
        font-size: 14px;
    }

    .main-content {
        padding: 24px 16px 40px;
    }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Focus Visible --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.main-content {
    animation: slideUp 0.4s ease;
}

/* --- Utility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
