:root {
    --bg-main: #050505;
    --bg-panel: #0f0f10;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    --accent: #ec4899;
    --accent-glow: rgba(236, 72, 153, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #52525b;
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-ui);
    height: 100vh;
    overflow: hidden;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: radial-gradient(circle at top left, #1a1a1a, transparent 40%);
}

.spotlight {
    position: fixed;
    top: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
}

/* LAYOUT */
.app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* MOBILE HEADER */
.mobile-header {
    display: none;
    height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
}

.mobile-logo {
    height: 24px;
    width: auto;
    margin-right: 10px;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SIDEBAR */
.sidebar {
    width: 340px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.back-dashboard-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 8px;
    width: 100%;
    transition: 0.2s;
}

.back-dashboard-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--border-highlight);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.logo-box img {
    height: 24px;
    width: auto;
    border-radius: 4px;
}

.brand-name {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.badge {
    font-size: 0.6rem;
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.sidebar-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* CONTROLS */
.control-section {
    margin-bottom: 30px;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.select-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: 0.2s;
}

.select-container:hover {
    border-color: var(--border-highlight);
}

.select-container i {
    position: absolute;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.select-container i:first-child {
    left: 12px;
}

.select-container .arrow {
    right: 12px;
    font-size: 0.75rem;
    pointer-events: none;
}

select {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 12px 36px;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
}

select option {
    background: #111;
    color: white;
}

/* DISCLAIMER NOTE */
.voice-note {
    font-size: 0.7rem;
    color: #71717a;
    margin-top: 8px;
    line-height: 1.4;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-note i {
    color: var(--accent);
    margin-right: 4px;
}

/* SLIDERS */
.range-group {
    margin-bottom: 20px;
}

.range-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.range-header label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mono-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--bg-panel);
    margin-top: -6px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

input[type=range]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    background: var(--accent);
}

/* STATS */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.stat-title {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ACTIONS */
.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-panel);
}

.action-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 10px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #db2777;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.btn-secondary:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* MAIN EDITOR */
.editor-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at center, #0a0a0a 0%, #050505 100%);
}

.editor-toolbar {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.pulsing-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

.pulsing-dot.busy {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 1s infinite;
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: 0.2s;
}

.tool-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.text-area-wrapper {
    flex: 1;
    padding: 20px 40px;
    position: relative;
}

textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    font-family: var(--font-ui);
    font-size: 1.8rem;
    color: #fff;
    line-height: 1.6;
    font-weight: 500;
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.15);
}

/* VISUALIZER */
.visualizer {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: flex;
    gap: 6px;
    height: 40px;
    align-items: flex-end;
    opacity: 1;
    transition: 0.3s;
    pointer-events: none;
}

.visualizer.hidden {
    opacity: 0;
}

.bar {
    width: 4px;
    background: var(--accent);
    border-radius: 4px;
    height: 4px;
    transition: height 0.1s;
}

.visualizer.playing .bar {
    animation: bounce 0.5s infinite ease-in-out;
}

.visualizer.playing .bar:nth-child(odd) {
    animation-duration: 0.6s;
}

.visualizer.playing .bar:nth-child(even) {
    animation-duration: 0.4s;
}

@keyframes bounce {

    0%,
    100% {
        height: 20%;
    }

    50% {
        height: 100%;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* PLAYBACK */
.playback-bar {
    height: 80px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 20px;
}

.play-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: none;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.play-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.control-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 10px;
    transition: 0.2s;
}

.control-icon:hover {
    color: white;
}

.track-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.track-time,
.track-total {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    width: 45px;
}

.progress-container {
    flex: 1;
    height: 4px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.1s linear;
}

/* TOAST */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #111;
    border: 1px solid #333;
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s forwards;
}

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

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

/* RESPONSIVE */
@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
        height: calc(100vh - 60px);
        margin-top: 60px;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        transform: translateX(-100%);
        border-right: none;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .hidden-mobile {
        display: none;
    }

    .sidebar-header {
        border-bottom: none;
        padding-top: 20px;
    }

    .text-area-wrapper {
        padding: 20px;
    }

    textarea {
        font-size: 1.3rem;
    }

    .playback-bar {
        position: fixed;
        bottom: 0;
        width: 100%;
        z-index: 200;
        padding: 0 15px;
        background: rgba(15, 15, 16, 0.95);
        backdrop-filter: blur(10px);
    }

    .visualizer {
        bottom: 90px;
        right: 20px;
    }
}

