@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;800&display=swap');

:root {
    --bg:        #0a0a0f;
    --surface:   #111118;
    --border:    #1e1e2e;
    --accent:    #c8f535;
    --accent2:   #ff6b6b;
    --accent3:   #6bdfff;
    --text:      #e8e8f0;
    --muted:     #5a5a7a;
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Syne', sans-serif;
}

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

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(200,245,53,0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(107,223,255,0.04) 0%, transparent 60%);
}

/* ── Layout ───────────────────────────────────────── */
#mel-dashboard { padding: 2rem 1.5rem 4rem; }

.dashboard-wrap {
    max-width: 860px;
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
}

/* ── Header ───────────────────────────────────────── */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.dash-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-dot {
    width: 12px; height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 16px var(--accent);
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%,100% { opacity: 1; box-shadow: 0 0 16px var(--accent); }
    50%      { opacity: 0.6; box-shadow: 0 0 6px var(--accent); }
}

.dash-logo h1 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--text);
}

.dash-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.1em;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent);
}

.pulse {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.6); opacity: 0.5; }
}

/* ── Cards ────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.4s ease both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200,245,53,0.3), transparent);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: var(--muted);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

/* ── Emoji Picker ─────────────────────────────────── */
emoji-picker {
    --background: #111118;
    --border-color: #1e1e2e;
    --indicator-color: #c8f535;
    --input-border-color: #1e1e2e;
    --input-font-color: #e8e8f0;
    --input-placeholder-color: #5a5a7a;
    --outline-color: #c8f53544;
    --category-emoji-padding: 0.3rem;
    --emoji-size: 1.4rem;
    --emoji-padding: 0.3rem;
    --num-columns: 8;
    width: 340px;
    height: 380px;
}

/* ── Disturb Card ─────────────────────────────────── */
.card--disturb { animation-delay: 0s; }

#current-disturb-label {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

#current-disturb-preview {
    transition: border-left-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

/* ── Manage Disturb ───────────────────────────────── */
.card--disturb-manage { animation-delay: 0.18s; }

.disturb-add-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.disturb-add-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem;
    align-items: center;
}

.disturb-add-row:last-of-type {
    grid-template-columns: 1fr 1fr;
}

.btn-emoji-pick {
    font-size: 1.4rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.btn-emoji-pick:hover { border-color: var(--accent); }

.disturb-list-item { transition: border-color 0.2s, background 0.2s; }

.disturb-list-emoji {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.disturb-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

@media (max-width: 600px) {
    .disturb-add-row { grid-template-columns: auto 1fr; }
    .disturb-add-row:last-of-type { grid-template-columns: 1fr; }
}

/* ── Status Card ──────────────────────────────────── */
.card--status { animation-delay: 0.05s; }

.status-big {
    font-family: var(--font-sans);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.reply-preview {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    padding: 0.75rem 1rem;
    background: rgba(200,245,53,0.04);
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
}

.status-selector {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

select {
    flex: 1;
    min-width: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5a7a' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select:focus { border-color: var(--accent); }

/* ── Mood Card ────────────────────────────────────── */
.card--mood { animation-delay: 0.1s; }

.mood-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent3);
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.mood-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mood-chip {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.mood-chip:hover {
    border-color: var(--accent3);
    color: var(--accent3);
    background: rgba(107,223,255,0.06);
}

.mood-chip.active {
    border-color: var(--accent3);
    background: rgba(107,223,255,0.12);
    color: var(--accent3);
    box-shadow: 0 0 12px rgba(107,223,255,0.2);
}

/* ── Manage Cards ─────────────────────────────────── */
.card--manage       { animation-delay: 0.15s; }
.card--moods-manage { animation-delay: 0.2s; }

.add-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    align-items: center;
}

.add-form--single { grid-template-columns: 1fr auto; }

input[type="text"] {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

input[type="text"]::placeholder { color: var(--muted); }
input[type="text"]:focus { border-color: var(--accent); }

.manage-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.manage-list::-webkit-scrollbar { width: 3px; }
.manage-list::-webkit-scrollbar-track { background: transparent; }
.manage-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    transition: border-color 0.2s;
}

.list-item:hover { border-color: rgba(200,245,53,0.2); }

.list-item-label { flex: 1; font-weight: 600; }
.list-item-reply { flex: 2; color: var(--muted); font-size: 0.75rem; font-family: var(--font-mono); }

.btn-delete {
    background: none;
    border: 1px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.btn-delete:hover {
    border-color: var(--accent2);
    color: var(--accent2);
    background: rgba(255,107,107,0.08);
}

/* ── API Card ─────────────────────────────────────── */
.card--api { animation-delay: 0.25s; }

.api-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.api-method {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(200,245,53,0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent3);
    flex: 1;
    word-break: break-all;
}

.api-hint {
    font-size: 0.78rem;
    color: var(--muted);
    font-family: var(--font-mono);
    line-height: 1.6;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn--primary {
    background: var(--accent);
    color: #0a0a0f;
}

.btn--primary:hover {
    background: #d8ff55;
    box-shadow: 0 0 20px rgba(200,245,53,0.3);
    transform: translateY(-1px);
}

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

.btn--add {
    background: rgba(200,245,53,0.1);
    color: var(--accent);
    border: 1px solid rgba(200,245,53,0.2);
}

.btn--add:hover {
    background: rgba(200,245,53,0.18);
    border-color: var(--accent);
}

.btn--copy {
    background: rgba(107,223,255,0.1);
    color: var(--accent3);
    border: 1px solid rgba(107,223,255,0.2);
    font-size: 0.65rem;
    padding: 0.4rem 0.8rem;
}

.btn--copy:hover {
    background: rgba(107,223,255,0.18);
    border-color: var(--accent3);
}

/* ── Toast ────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: #0a0a0f;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(200,245,53,0.3);
    transform: translateY(120%);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 9999;
    pointer-events: none;
}

.toast.show { transform: translateY(0); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
    .add-form { grid-template-columns: 1fr; }
    .add-form--single { grid-template-columns: 1fr auto; }
    .status-selector { flex-direction: column; align-items: stretch; }
    select { min-width: unset; }

}