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

:root {
    --bg-dark: #020617;
    --bg-sidebar: #050b1a;
    --bg-surface: #0f172a;
    --bg-elevated: #1e293b;
    --primary: #6366f1;
    --primary-rgb: 99, 102, 241;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.06);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

body.light-mode {
    --bg-dark: #fdfbf0;
    --bg-sidebar: #f5f4ea;
    --bg-surface: #ffffff;
    --bg-elevated: #fefefe;
    --primary: #4f46e5;
    --primary-rgb: 79, 70, 229;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --accent: #d97706;
    --success: #059669;
    --danger: #dc2626;
    --text: #1f2937;
    --text-dim: #6b7280;
    --border: rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }

body { background: var(--bg-dark); color: var(--text); height: 100dvh; width: 100dvw; overflow: hidden; display: flex; flex-direction: column; }

button { cursor: pointer; border: none; outline: none; transition: var(--transition); }

/* --- TITLE BAR (OCULTA NO MOBILE) --- */
.title-bar { display: none; }

/* --- APP SHELL (MOBILE BOTTOM NAV) --- */
.app-shell { display: flex; flex-direction: column; flex: 1; overflow: hidden; width: 100%; }
.sidebar { width: 100%; height: 70px; background: var(--bg-sidebar); border-top: 1px solid var(--border); border-right: none; display: flex; flex-direction: row; padding: 0 10px; flex-shrink: 0; z-index: 50; order: 2; justify-content: space-around; align-items: center; }
body.stage-mode-active .sidebar { display: none; }
.nav-group { display: flex; flex-direction: row; gap: 5px; width: auto; flex: 1; justify-content: space-around; }
.nav-group.bottom { margin-top: 0; flex: 0; }
.nav-item { background: transparent; color: var(--text-dim); padding: 8px; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; font-weight: 600; width: auto; flex: 1; }
.nav-item i { width: 24px; height: 24px; flex-shrink: 0; }
.nav-item:hover { background: rgba(0,0,0,0.03); color: var(--text); }
body.light-mode .nav-item:hover { background: rgba(0,0,0,0.05); }
.nav-item.active { background: transparent; color: var(--primary); box-shadow: none; }
.nav-item.active i { filter: drop-shadow(0 0 10px var(--primary-glow)); }

/* --- WORKSPACE SELECTOR --- */
.workspace-selector {
    margin-bottom: 20px;
    padding: 10px;
    position: relative;
    z-index: 100;
}

.workspace-current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.workspace-current:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.workspace-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.workspace-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.workspace-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.workspace-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.workspace-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 10px;
    right: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
    z-index: 1000;
}

.workspace-dropdown.show {
    display: flex;
}

.workspace-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: var(--transition);
}

.workspace-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.workspace-option.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.workspace-option i {
    width: 18px;
    height: 18px;
}

.workspace-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.btn-add-workspace {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    font-size: 13px;
    background: transparent;
    color: var(--primary);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

/* MAIN VIEWPORT */
.main-viewport { flex: 1; position: relative; overflow: hidden; background: radial-gradient(circle at 0% 0%, #111827 0%, #020617 100%); order: 1; }
body.light-mode .main-viewport { background: var(--bg-dark); }
.view { height: 100%; width: 100%; display: flex; flex-direction: column; padding: 20px 15px; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* HEADERS */
.view-header { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; flex-shrink: 0; }
.header-left h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }

/* LIBRARY */
.search-wrapper { background: rgba(0,0,0,0.05); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 18px; display: flex; align-items: center; gap: 12px; width: 100%; }
body.light-mode .search-wrapper { background: var(--bg-surface); }
.search-wrapper input { background: transparent; border: none; color: var(--text); outline: none; flex: 1; font-size: 16px; }
.content-scroll { flex: 1; overflow-y: auto; padding-right: 5px; padding-bottom: 20px; }
.song-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.song-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 16px 16px 16px; display: flex; flex-direction: column; gap: 8px; position: relative; transition: var(--transition); padding-right: 90px; }
.song-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: var(--shadow-xl); background: var(--bg-elevated); }

.card-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.btn-action {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(0,0,0,0.1);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}
body.light-mode .btn-action { background: var(--bg-elevated); }
.btn-action:hover { transform: scale(1.1); }
.btn-action.edit:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-action.delete:hover { background: var(--danger); color: white; border-color: var(--danger); }

.song-card:hover .card-actions { opacity: 1; }

/* LIST VIEW OVERRIDES */
.song-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.song-card.list-view {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}
.song-card.list-view h3 {
    margin: 0;
    font-size: 16px;
    flex: 2;
}
.song-card.list-view p.artist {
    margin: 0;
    font-size: 14px;
    flex: 2;
}
.song-card.list-view .card-tags {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.song-card.list-view .card-actions {
    position: static;
    opacity: 1;
    margin-left: 15px;
}
.editor-workspace { flex: 1; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; padding-bottom: 20px; }
.editor-pane { flex: none; min-height: clamp(200px, 40vh, 400px); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.pane-header { padding: 12px 20px; font-size: 10px; font-weight: 800; color: var(--text-dim); background: rgba(0,0,0,0.05); border-bottom: 1px solid var(--border); letter-spacing: 1px; }
body.light-mode .pane-header { background: var(--bg-sidebar); }

#main-editor {
    flex: 1;
    padding: 25px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono) !important;
    font-weight: 700 !important;
    font-size: 16px;
    line-height: 1.4;
    letter-spacing: 0px;
    word-spacing: 0px;
    resize: none;
    outline: none;
    overflow-y: auto;
    white-space: pre;
    -webkit-appearance: none;
    appearance: none;
    -webkit-font-smoothing: antialiased;
    caret-color: var(--primary);
}

#main-editor::selection {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

.preview-scroll { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; background: rgba(0,0,0,0.1); }
body.light-mode .preview-scroll { background: rgba(0,0,0,0.03); }

.mini-card-preview {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: var(--font-mono) !important;
    font-weight: 700 !important;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}

/* --- STAGE VIEW --- */
.stage-view { padding: 0 !important; background: var(--bg-dark); position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 100; }
.stage-header { padding: 15px; display: flex; flex-direction: column; gap: 15px; border-bottom: 1px solid var(--border); background: var(--bg-dark); z-index: 10; }
.stage-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; }
.active-card-wrapper { width: 100%; height: 100%; }

.chord-card-stage { background: transparent; border: none; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; }

.chord-text {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    white-space: pre;
    color: var(--text);
    font-family: var(--font-mono) !important;
    font-weight: 700 !important;
    line-height: 1.4;
    letter-spacing: 0px;
    word-spacing: 0px;
    display: block;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}

.line-chord, .line-lyric { display: block; min-height: 1.4em; white-space: pre; font-family: inherit; font-weight: inherit; }
.line-chord { color: var(--accent); font-weight: 800; }
.line-lyric { color: var(--text); opacity: 0.85; }

/* LYRICS ONLY MODE */
.lyrics-only-mode .line-chord { display: none; }
.lyrics-only-mode .line-lyric { opacity: 1; text-align: left; white-space: pre-wrap; }
.btn-player-action.lyrics-active { background: var(--primary); color: white; border-color: var(--primary); }

/* SECTIONS & TAGS */
.line-section-header {
    display: inline-block;
    font-size: 10px;
    font-weight: 900;
    color: white;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s ease;
}

/* Color Coding for Badges */
.line-section-header[data-type="intro"],
.line-section-header[data-type="solo"],
.line-section-header[data-type="instrumental"],
.line-section-header[data-type="preludio"],
.line-section-header[data-type="riff"] { background: #3b82f6; }

.line-section-header[data-type="refrao"],
.line-section-header[data-type="coro"],
.line-section-header[data-type="chorus"],
.line-section-header[data-type="gancho"],
.line-section-header[data-type="hook"] { background: var(--accent); }

.line-section-header[data-type="ponte"],
.line-section-header[data-type="bridge"],
.line-section-header[data-type="pre-refrao"],
.line-section-header[data-type="pre-chorus"],
.line-section-header[data-type="interludio"],
.line-section-header[data-type="passagem"] { background: #a855f7; }

.line-section-header[data-type="final"],
.line-section-header[data-type="outro"],
.line-section-header[data-type="ending"],
.line-section-header[data-type="coda"],
.line-section-header[data-type="fim"] { background: #ef4444; }

.line-section-header[data-type="verso"],
.line-section-header[data-type="estrofe"],
.line-section-header[data-type="verse"],
.line-section-header[data-type="parte 1"],
.line-section-header[data-type="parte 2"],
.line-section-header[data-type="parte 3"] { background: #64748b; }

/* Progress Bar Color Transition */
#player-progress-fill {
    transition: width 0.3s ease, background 0.5s ease;
}

/* SETTINGS TABS */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}
.settings-tab {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.settings-tab.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.2);
}


/* --- FORM & UI COMPONENTS --- */
.input-standard {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
body.light-mode .input-standard { background: rgba(0,0,0,0.05); }
.input-standard:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-dim);
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-secondary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
}
.btn-icon-only:hover {
    background: var(--bg-elevated);
    color: var(--primary);
}

.btn-player-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    transition: var(--transition);
}
body.light-mode .btn-player-action { background: rgba(0, 0, 0, 0.03); }
.btn-player-action:hover { background: var(--primary); color: white; border-color: var(--primary); }

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    transition: border-color 0.1s, box-shadow 0.1s;
}


body.light-mode .glass-card { background: rgba(255, 255, 255, 0.5); }

.player-stat {
    background: var(--bg-elevated);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.player-stat .label { font-size: 9px; font-weight: 800; color: var(--primary); opacity: 0.8; letter-spacing: 1px; }
.player-stat .value { font-size: 20px; font-weight: 800; color: var(--text); }

/* METRONOME PULSE */
@keyframes pulse-glow {
    0% { transform: scale(1); box-shadow: 0 0 0px var(--primary-glow); opacity: 0.5; }
    50% { transform: scale(1.2); box-shadow: 0 0 20px var(--primary); opacity: 1; }
    100% { transform: scale(1); box-shadow: 0 0 0px var(--primary-glow); opacity: 0.5; }
}

#import-url-input {
    background: transparent;
    border: none;
    color: var(--text);
    outline: none;
}

#btn-import-magic {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#btn-import-magic:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--glow);
}

/* Ajuste para o Metrônomo no Player */
.metronome-orb {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    display: inline-block;
}
.metronome-active {
    animation: pulse-glow var(--bpm-speed, 0.5s) infinite;
}

.player-stat { display: flex; flex-direction: column; align-items: flex-end; }
.player-stat .label { font-size: 9px; font-weight: 800; color: var(--text-dim); letter-spacing: 1px; }
.player-stat .value { font-size: 16px; font-weight: 800; color: var(--text); }
.player-stat.active .value { color: var(--accent); }

/* FOOTER & BUTTONS */
.stage-footer { padding: 15px; display: flex; flex-direction: column; gap: 15px; background: var(--bg-dark); border-top: 1px solid var(--border); z-index: 10; }
.btn-cta { background: var(--primary); color: white; padding: 12px 24px; border-radius: 12px; font-weight: 700; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.btn-cta:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 20px var(--primary-glow); }
.btn-stage-nav { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-elevated); color: var(--text); display: flex; align-items: center; justify-content: center; }
.btn-stage-nav.next { background: var(--primary); color: white; width: 64px; height: 64px; }
.btn-stage-nav:hover { transform: scale(1.1); }

/* RESPONSIVE EDITOR STYLES */
.editor-title-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 150px; }
.title-input { font-size: 18px !important; font-weight: 800 !important; width: 100% !important; }
.artist-input { opacity: 0.7 !important; font-size: 13px !important; width: 100% !important; padding: 5px 12px !important; }

.editor-header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions-group, .editor-tools-group { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    flex-wrap: wrap;
}

.musical-params-box {
    display: flex; 
    gap: 10px; 
    background: rgba(0,0,0,0.2); 
    padding: 8px; 
    border-radius: 12px; 
    border: 1px solid var(--border);
}

.param-item { display: flex; flex-direction: column; gap: 4px; }
.param-item label { font-size: 9px; font-weight: 800; color: var(--text-dim); padding-left: 5px; }
.param-item input { width: 60px; text-align: center; padding: 5px !important; height: 44px; font-size: 14px; }
#edit-bpm { width: 75px; }

.editor-actions-btns { display: flex; gap: 8px; }
.editor-actions-btns .btn-secondary, .editor-actions-btns .btn-cta { height: 44px; padding: 0 12px; font-size: 14px; }

/* =====================================================
   MEDIA QUERIES — ANDROID BREAKPOINTS
   Baseado nos tamanhos mais comuns no Brasil (2025):
   • 360px — Samsung Galaxy A series
   • 390px — Pixel 7a, Moto G
   • 412px — Pixel 6/7, Samsung S series
   ===================================================== */

/* --- TELAS MÉDIAS (até 768px) --- */
@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .view { padding: 14px 12px; }
    .view-header { gap: 8px; margin-bottom: 10px; }
    .header-left { width: 100%; gap: 8px !important; }
    .header-right { width: 100%; justify-content: flex-start; }

    .editor-workspace { gap: 8px; }
    .editor-pane { min-height: clamp(160px, 32vh, 280px); }

    .musical-params-box { width: 100%; justify-content: space-around; }
    .editor-actions-btns { width: 100%; }
    .editor-actions-btns button { flex: 1; justify-content: center; }
    .header-actions-group { width: 100%; }
    .header-actions-group button { flex: 1; justify-content: center; }

    /* Song cards — espaço para 2 botões de ação (44px + 44px + 8px gap + 30px margem) */
    .song-card { padding-right: 106px; }
    .btn-action { width: 40px; height: 40px; }
}

/* --- ANDROID MÉDIO (até 412px — Pixel 6/7, Galaxy S) --- */
@media (max-width: 412px) {
    .view { padding: 12px 10px; }
    .view-header { gap: 8px; margin-bottom: 8px; }
    .header-left h1 { font-size: 19px; letter-spacing: -0.5px; }

    .sidebar { height: calc(60px + env(safe-area-inset-bottom)); }
    .nav-item { padding: 6px; gap: 3px; font-size: 9px; }
    .nav-item i { width: 22px; height: 22px; }

    .song-card { padding: 12px; padding-right: 100px; border-radius: 16px; gap: 6px; }
    .song-grid { gap: 10px; }
    .card-actions { top: 12px; right: 10px; gap: 6px; }
    .btn-action { width: 40px; height: 40px; border-radius: 8px; }

    .editor-pane { min-height: clamp(150px, 30vh, 260px); }
    #main-editor { font-size: 15px; padding: 16px; }
    .pane-header { padding: 10px 16px; }

    .stage-header { padding: 10px 12px; gap: 10px; }
    .stage-footer { padding: 10px 12px; gap: 10px; }
    .stage-body { padding: 12px; }
    .btn-stage-nav { width: 48px; height: 48px; }
    .btn-stage-nav.next { width: 56px; height: 56px; }

    .btn-cta { padding: 10px 14px; font-size: 13px; }
    .modal { padding: 20px; }
    .modal-title { font-size: 16px; }

    .param-item input { width: 52px; height: 40px; font-size: 13px; }
    #edit-bpm { width: 65px; }
    .editor-actions-btns .btn-secondary,
    .editor-actions-btns .btn-cta { height: 40px; padding: 0 10px; font-size: 13px; }
}

/* --- ANDROID PEQUENO (até 390px — Moto G, Pixel 7a) --- */
@media (max-width: 390px) {
    .view { padding: 10px 8px; }
    .header-left h1 { font-size: 17px; }

    .song-card { padding: 10px; padding-right: 94px; border-radius: 14px; }
    .btn-action { width: 38px; height: 38px; }
    .card-actions { gap: 5px; right: 8px; top: 10px; }

    .import-group { padding: 6px; }
    .import-group input { font-size: 14px; padding: 8px 10px; }

    .search-wrapper { padding: 10px 14px; }
    .search-wrapper input { font-size: 15px; }

    .notification { padding: 12px 14px; font-size: 13px; }
    .player-stat { padding: 10px; }
}

/* --- ANDROID COMPACTO (até 360px — Galaxy A series) --- */
@media (max-width: 360px) {
    .view { padding: 8px 6px; }
    .header-left h1 { font-size: 16px; }
    .view-header { margin-bottom: 6px; }

    .sidebar { height: calc(56px + env(safe-area-inset-bottom)); }
    .nav-item { font-size: 8px; padding: 4px; }
    .nav-item i { width: 20px; height: 20px; }
    .nav-item span { display: none; } /* Oculta labels em telas muito pequenas */

    .song-card { padding: 8px; padding-right: 88px; border-radius: 12px; }
    .btn-action { width: 36px; height: 36px; border-radius: 7px; }
    .card-actions { gap: 4px; right: 6px; top: 8px; }
    .song-grid { gap: 8px; }

    .modal { padding: 16px; width: 95%; }
    .modal-title { font-size: 15px; }
    .modal-footer { gap: 8px; }
    .btn-modal { padding: 10px 16px; font-size: 13px; }

    .stage-header { padding: 8px 10px; gap: 8px; }
    .stage-footer { padding: 8px 10px; gap: 8px; }
    .btn-stage-nav { width: 44px; height: 44px; }
    .btn-stage-nav.next { width: 50px; height: 50px; }

    #main-editor { font-size: 14px; padding: 12px; }
    .editor-pane { min-height: clamp(130px, 28vh, 220px); }

    .title-input { font-size: 14px !important; }
    .artist-input { font-size: 12px !important; }
}

/* FULL SCREEN EDIT MODE (FOCUS) */
body.editor-focus .sidebar { display: none !important; }
body.editor-focus .view-header { display: none !important; }
body.editor-focus .editor-pane { min-height: 50vh !important; }
body.editor-focus .editor-workspace { gap: 0; padding-bottom: 0; }

.invite-code-pill {
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    background: var(--bg-elevated);
    padding: 3px 10px;
    border-radius: 20px;
    color: var(--accent);
    border: 1px solid var(--accent);
    cursor: copy;
}
.invite-code-pill:active {
    background: var(--accent);
    color: var(--bg-dark);
}
/* --- BAND MANAGEMENT --- */
.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
    transition: var(--transition);
}

.member-item.is-admin {
    border-color: rgba(var(--primary-rgb), 0.4);
    background: rgba(var(--primary-rgb), 0.08);
}

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

.member-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-dim);
}

.member-dot.admin { background: var(--primary); }
.member-dot.me { background: var(--accent); }

.member-details {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.member-role {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}

.member-role.admin {
    color: var(--primary);
    font-weight: 900;
}

/* --- IMPORT GROUP --- */
.import-group {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.import-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 10px 15px;
    outline: none;
    font-size: 15px;
}

/* --- NOTIFICATIONS & MODALS --- */
.notification-container {
    position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; width: 100%; max-width: 400px; padding: 0 20px;
}
.notification {
    background: var(--bg-surface); border: 1px solid var(--border);
    padding: 16px 20px; border-radius: var(--radius-md); color: var(--text);
    box-shadow: var(--shadow-xl); display: flex; align-items: center; gap: 12px;
    font-size: 14px; font-weight: 600; pointer-events: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--primary); backdrop-filter: blur(10px);
}
.notification.success { border-left-color: var(--success); }
.notification.error { border-left-color: var(--danger); }
.notification.warning { border-left-color: var(--accent); }
.notification i { width: 18px; height: 18px; flex-shrink: 0; }

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

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--bg-surface); border: 1px solid var(--border);
    width: 90%; max-width: 400px; border-radius: var(--radius-lg);
    padding: 30px; box-shadow: var(--shadow-xl); transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.modal-body { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 24px; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; }

.btn-modal { padding: 12px 24px; border-radius: var(--radius-md); font-size: 14px; font-weight: 700; border: none; }
.btn-modal-cancel { background: rgba(255,255,255,0.05); color: var(--text); }
.btn-modal-confirm { background: var(--primary); color: white; }
.btn-modal-danger { background: var(--danger); color: white; }

/* --- IMPORT MODAL ITEMS --- */
.import-song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.import-song-item:hover { background: rgba(255,255,255,0.06); }
.import-song-item.selected { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.1); }
.import-checkbox { width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.import-song-item.selected .import-checkbox { background: var(--primary); border-color: var(--primary); }
.import-checkbox i { color: white; opacity: 0; transform: scale(0.5); transition: all 0.2s; }
.import-song-item.selected .import-checkbox i { opacity: 1; transform: scale(1); }
