/* ============================================
   SVG to CSS Converter — Styles
   Theme: Fuchsia Neon Dark
   ============================================ */

:root {
    --primary: #D946EF;
    --primary-light: #E879F9;
    --accent: #4ADE80;
    --bg: #1A0A1E;
    --bg-deep: #120812;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --text: #F3EEFA;
    --text-muted: rgba(243, 238, 250, 0.55);
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --transition: 250ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
}

/* --- Header --- */
.app-header {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.1), rgba(74, 222, 128, 0.05));
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(217, 70, 239, 0.5));
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Main Layout --- */
.app-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: calc(100vh - 60px);
}

/* --- Input Section --- */
.input-section {
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    background: rgba(217, 70, 239, 0.1);
    border: 1px solid rgba(217, 70, 239, 0.2);
    border-radius: 8px;
    color: var(--primary-light);
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-action:hover {
    background: rgba(217, 70, 239, 0.18);
    border-color: rgba(217, 70, 239, 0.35);
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.code-textarea {
    flex: 1;
    min-height: 200px;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary-light);
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
}

.code-textarea::placeholder {
    color: var(--text-muted);
}

.code-textarea:focus {
    border-color: rgba(217, 70, 239, 0.4);
}

/* --- Options Bar --- */
.options-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0 0;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.toggle-btn {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    border: 1px solid var(--border-light);
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: background var(--transition), border-color var(--transition);
}

.toggle-btn.active {
    background: rgba(217, 70, 239, 0.2);
    border-color: var(--primary);
}

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform var(--transition), background var(--transition);
}

.toggle-btn.active .toggle-knob {
    transform: translateX(18px);
    background: var(--primary);
}

/* --- Output Section --- */
.output-section {
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

/* --- Format Tabs --- */
.format-tabs {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.format-tab {
    flex: 1;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.format-tab.active {
    background: rgba(217, 70, 239, 0.15);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(217, 70, 239, 0.1);
}

.format-tab:hover:not(.active) {
    color: var(--text);
    background: var(--surface-hover);
}

/* --- Preview --- */
.preview-area {
    margin-bottom: 1rem;
}

.preview-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.preview-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(45deg, rgba(217, 70, 239, 0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(217, 70, 239, 0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(217, 70, 239, 0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(217, 70, 239, 0.06) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-element {
    width: 60%;
    height: 60%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    transition: all 400ms ease;
}

/* --- Code Output --- */
.code-output-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.code-block {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--primary-light);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    margin: 0;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: rgba(217, 70, 239, 0.15);
    border: 1px solid rgba(217, 70, 239, 0.25);
    border-radius: 8px;
    color: var(--primary-light);
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.copy-btn:hover {
    background: rgba(217, 70, 239, 0.25);
}

.copy-btn.copied {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--accent);
}

/* --- Comparison Table --- */
.comparison-table-wrap {
    margin-top: auto;
}

.comparison-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.comparison-table th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .app-main {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .output-section {
        max-height: none;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

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