:root {
    --primary: #00D2FF;
    --primary-gradient: linear-gradient(135deg, #3A7BD5, #00D2FF);
    --secondary: #3A7BD5;
    --accent: #FF0076;

    --bg-dark: #0A0F1D;
    --bg-panel: rgba(17, 24, 39, 0.7);
    --bg-panel-hover: rgba(31, 41, 55, 0.8);

    --border: rgba(58, 123, 213, 0.3);
    --border-hover: rgba(0, 210, 255, 0.5);

    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);

    --success: #10B981;

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;

    /* Premium dark mode background */
    background-image:
        radial-gradient(circle at 15% 50%, rgba(58, 123, 213, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(0, 210, 255, 0.08) 0%, transparent 40%);
}

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

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

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

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.accent-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.glass-panel:hover,
.glass-panel:focus-within {
    border-color: var(--border-hover);
    box-shadow: 0 8px 30px rgba(0, 210, 255, 0.1);
}

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

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

/* Panels */
.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 450px;
    position: relative;
    overflow: hidden;
}

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

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Editor Area */
.editor-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.code-editor {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 300px;
    padding: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

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

/* Drag and Drop Overlay */
.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 10;
}

.editor-container.dragover .drop-overlay {
    opacity: 1;
}

.editor-container.dragover {
    border: 2px dashed var(--primary);
}

.drop-message {
    text-align: center;
    color: var(--primary);
}

.drop-message svg {
    margin-bottom: 1rem;
}

.drop-message p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* File Info Footer */
.file-info {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

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

.file-size {
    color: var(--text-muted);
}

.text-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.text-btn:hover {
    text-decoration: underline;
}

/* Error Message */
.error-msg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--error-bg);
    color: var(--error);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    border-top: 1px solid rgba(239, 68, 68, 0.3);
    z-index: 5;
}

/* Middle Controls */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 200px;
}

@media (max-width: 899px) {
    .controls-panel {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    .control-group {
        flex: 1;
        min-width: 200px;
    }

    .action-buttons {
        flex: 1;
        flex-direction: row !important;
    }
}

.control-group {
    padding: 1rem;
}

.control-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    appearance: none;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

select:hover,
select:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
}

.btn-secondary {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
}

/* Active State for Direction Buttons */
.direction-btn {
    opacity: 0.6;
}

.direction-btn.active {
    opacity: 1;
    border-color: var(--primary);
}

.direction-btn.active.btn-secondary {
    background: rgba(58, 123, 213, 0.15);
}

/* Status Badges */
.status-indicator {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Utils */
.hidden {
    display: none !important;
}

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

.toast.show {
    transform: translate(-50%, 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);
    }
}