:root {
    --primary: #6C5CE7;
    --primary-hover: #5A4FCF;
    --secondary: #A29BFE;
    --accent: #FD79A8;
    --bg: #0D0B1E;
    --surface: #191636;
    --surface-hover: #231E48;
    --border: #2D2759;
    --text-primary: #F8FAFC;
    --text-secondary: #8B85C1;
    --error: #FF4757;
    --success: #2ED573;

    --radius: 12px;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'Menlo', 'Courier New', monospace;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    /* Subtle background glow */
    background-image: radial-gradient(circle at 10% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(253, 121, 168, 0.05) 0%, transparent 40%);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.accent-text {
    color: var(--accent);
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s var(--transition);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Main Workspace */
.converter-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    animation: fadeInUp 0.5s var(--transition);
}

@media (min-width: 900px) {
    .converter-workspace {
        flex-direction: row;
        align-items: stretch;
    }
}

/* Panels */
.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(108, 92, 231, 0.2);
    border-color: var(--primary);
}

.glass-panel {
    background: rgba(25, 22, 54, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 11, 30, 0.4);
    border-radius: var(--radius) var(--radius) 0 0;
}

.format-selector {
    display: flex;
    gap: 1rem;
}

.format-selector span {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.format-selector span.active {
    color: var(--primary);
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary);
}

/* Editor */
.editor-wrapper {
    flex: 1;
    position: relative;
    padding: 1rem 1.5rem;
}

.code-editor {
    width: 100%;
    height: 100%;
    resize: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--mono);
    font-size: 0.9rem;
    line-height: 1.6;
    outline: none;
}

.code-editor::placeholder {
    color: rgba(139, 133, 193, 0.3);
}

/* Middle Controls */
.controls-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

@media (min-width: 900px) {
    .controls-panel {
        padding: 0 1rem;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px -5px rgba(108, 92, 231, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.95);
}

.btn-round {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 0;
}

.options-wrapper {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: max-content;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.option-row input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Error Messages */
.error-msg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 71, 87, 0.1);
    color: var(--error);
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
    font-family: var(--mono);
    border-top: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: 0 0 var(--radius) var(--radius);
}

.hidden {
    display: none !important;
}

/* Footer */
.footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
}

.shortcuts {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 0.75rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.3);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}