/* ============================================
   MKV to MOV Converter — Freecvt.com
   Design System & Full Styles
   ============================================ */

/* ---------- Design Tokens ---------- */
: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, Cantarell, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::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: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
}

/* ---------- Skip Link ---------- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    z-index: 1000;
    font-weight: 500;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 8px;
    color: #fff;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(26, 26, 36, 0.92);
}

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

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary) !important;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo:hover {
    color: var(--accent-hover) !important;
}

/* ---------- Navigation ---------- */
.main-nav {
    position: relative;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 20px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.nav-toggle:hover {
    border-color: var(--border-hover);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-list li a {
    display: block;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

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

.nav-list li a.active {
    color: var(--accent-hover);
    background: var(--accent-glow);
}

/* ---------- Main Content ---------- */
.converter-main {
    flex: 1;
}

.converter-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    font-size: 32px;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

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

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
    opacity: 1;
}

.upload-zone:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-subtext {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 12px;
}

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

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

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

.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);
}

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

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

/* ---------- Buttons ---------- */
.actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
    align-items: center;
}

.btn-convert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3);
}

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

.btn-convert:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.btn-icon {
    font-size: 18px;
}

.btn-clear {
    padding: 14px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}

.btn-clear:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* ---------- Progress ---------- */
.progress-section {
    margin-top: 24px;
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

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

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---------- Results ---------- */
.results-section {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.results-title {
    font-size: 18px;
    color: var(--success);
    margin-bottom: 16px;
    text-align: center;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

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

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

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

.btn-download {
    padding: 8px 16px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
    white-space: nowrap;
    flex-shrink: 0;
}

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

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

.btn-download-all {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}

.btn-download-all:hover {
    background: var(--accent-hover);
}

/* ---------- Error ---------- */
.error-section {
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    text-align: center;
}

.error-text {
    color: var(--error);
    font-size: 14px;
    margin-bottom: 12px;
}

.btn-dismiss {
    padding: 8px 20px;
    background: transparent;
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}

.btn-dismiss:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

/* ---------- How It Works ---------- */
.how-it-works {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.how-it-works .converter-container {
    padding-top: 48px;
    padding-bottom: 48px;
}

.how-it-works h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 32px;
}

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

.step {
    text-align: center;
    padding: 24px 16px;
}

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

.step h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

/* ---------- FAQ ---------- */
.faq-section {
    background: var(--bg-primary);
}

.faq-section .converter-container {
    padding-top: 48px;
    padding-bottom: 48px;
}

.faq-section h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 32px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: var(--bg-secondary);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

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

.faq-item[open] {
    border-color: var(--border-hover);
}

.faq-item summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
}

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

.faq-item summary::after {
    content: '+';
    font-size: 20px;
    color: var(--accent);
    font-weight: 300;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background: var(--bg-tertiary);
}

.faq-item p {
    padding: 0 20px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.footer-inner p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.footer-note {
    font-size: 12px !important;
    color: var(--text-muted);
    opacity: 0.7;
}

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

    .nav-list {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        padding: 8px;
        min-width: 200px;
        max-height: 60vh;
        overflow-y: auto;
        flex-direction: column;
        gap: 2px;
        z-index: 200;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    }

    .nav-list.open {
        display: flex;
    }

    .nav-list li a {
        padding: 10px 14px;
        font-size: 13px;
    }

    h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

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

    .upload-icon {
        font-size: 36px;
    }

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

    .converter-container {
        padding: 24px 16px;
    }

    .btn-convert {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }

    .btn-clear {
        width: 100%;
        justify-content: center;
    }

    .actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 12px;
    }

    .logo {
        font-size: 16px;
    }

    h1 {
        font-size: 20px;
    }

    .file-item {
        padding: 10px 12px;
    }
}

/* ---------- Utilities ---------- */
[hidden] {
    display: none !important;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ---------- Selection ---------- */
::selection {
    background: var(--accent-glow);
    color: var(--text-primary);
}

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

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ---------- Print ---------- */
@media print {
    .site-header,
    .site-footer,
    .how-it-works,
    .faq-section,
    .upload-zone,
    .actions,
    .progress-section {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .results-section {
        border-color: #ccc;
        background: #fff;
    }
}
