/* Animation Easing Studio — Sunset Orange Theme */

:root {
    --primary: #E17055;
    --primary-light: #FAB1A0;
    --primary-dark: #D35400;
    --accent: #00B894;
    --accent-light: #55EFC4;
    --bg-base: #1A100A;
    --bg-surface: #2D1A10;
    --bg-elevated: #3E2518;
    --bg-glass: rgba(45, 26, 16, 0.65);
    --text-primary: #F5EDE8;
    --text-secondary: #C4A898;
    --text-muted: #7A5F4F;
    --border: rgba(196, 168, 152, 0.1);
    --border-active: rgba(225, 112, 85, 0.4);
    --success: #00B894;
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 40% at 20% 15%, rgba(225, 112, 85, 0.06), transparent),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(0, 184, 148, 0.04), transparent);
    pointer-events: none;
}

.app {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 20px 0 14px;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px rgba(225, 112, 85, 0.15);
}

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

.tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Main */
.main {
    flex: 1;
    padding: 24px 0;
}

.layout {
    display: grid;
    grid-template-columns: 200px 1fr 260px;
    gap: 16px;
    align-items: start;
}

/* Sidebar */
.sidebar {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.65rem;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

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

.preset-btn.active {
    color: var(--primary-light);
    background: rgba(225, 112, 85, 0.12);
    border-color: var(--border-active);
}

.cp-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.cp-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cp-row label {
    font-size: 0.65rem;
    color: var(--text-muted);
    width: 18px;
}

.cp-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    outline: none;
}

.cp-input:focus {
    border-color: var(--border-active);
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="range"] {
    -webkit-appearance: none;
    flex: 1;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-light);
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-size: 0.68rem;
    color: var(--primary-light);
    font-weight: 600;
    min-width: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.7rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 0 14px rgba(225, 112, 85, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 0 22px rgba(225, 112, 85, 0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--text-secondary);
}

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

.btn-accent {
    background: rgba(0, 184, 148, 0.12);
    color: var(--accent);
    border-color: rgba(0, 184, 148, 0.25);
}

.btn-accent:hover {
    background: rgba(0, 184, 148, 0.2);
}

/* Curve Canvas */
.center-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.curve-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    justify-content: center;
}

.curve-canvas {
    cursor: crosshair;
    border-radius: var(--radius-sm);
    max-width: 100%;
    height: auto;
}

/* Preview */
.preview-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.preview-track {
    position: relative;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-ball {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 0 12px rgba(225, 112, 85, 0.3);
}

.preview-track.vertical {
    height: 12px;
}

.preview-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-sm);
}

/* Compare */
.compare-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.compare-tracks {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compare-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    min-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-track {
    flex: 1;
    position: relative;
    height: 28px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    overflow: hidden;
}

.compare-ball {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Code */
.code-col {
    position: sticky;
    top: 20px;
}

.code-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 14px;
}

.tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--transition);
}

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

.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.code-wrap {
    position: relative;
}

.code-block {
    padding: 14px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-light);
    line-height: 1.7;
    min-height: 160px;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    user-select: text;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity var(--transition);
}

.code-wrap:hover .copy-btn {
    opacity: 1;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    color: var(--success);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(0, 184, 148, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 300ms ease;
    pointer-events: none;
    z-index: 100;
}

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

/* Footer */
.footer {
    padding: 14px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .code-col {
        position: static;
    }
}

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

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

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(196, 168, 152, 0.2);
    border-radius: 3px;
}

::selection {
    background: rgba(225, 112, 85, 0.3);
    color: white;
}

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