/* ============================================
   STUDIO EDITION - DESIGN SYSTEM
   ============================================ */

:root {
    /* Paleta Studio Dark - Inspirada em DAWs e Equipamentos Premium */
    --studio-black: #0a0a0b;
    --studio-dark: #121214;
    --studio-gray: #1e1e22;
    --studio-border: #2a2a30;
    --studio-text: #e1e1e6;
    --studio-muted: #a8a8b3;
    --studio-accent: #2ecc71; /* O verdinho solicitado */
    --studio-accent-dim: rgba(46, 204, 113, 0.15);
    
    /* Tipografia */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Efeitos */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--studio-black);
    color: var(--studio-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Estilo Rack de Estúdio */
.sidebar {
    width: 260px;
    background-color: var(--studio-dark);
    border-right: 1px solid var(--studio-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 12px;
}

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

.logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.logo-text {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
    border-left: 4px solid var(--studio-accent);
    padding-left: 12px;
    line-height: 1.2;
}

.mobile-program-title {
    display: none;
    width: 100%;
    text-align: center;
    color: var(--studio-accent);
    font-size: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--studio-muted);
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--studio-accent);
    transition: width 0.3s ease;
}

.nav-item:hover::after, .nav-item.active::after {
    width: 100%;
}

.nav-item:hover {
    background-color: var(--studio-gray);
    color: #fff;
}

.nav-item.active {
    background-color: var(--studio-accent-dim);
    color: var(--studio-accent);
}

.sidebar-footer {
    margin-top: auto;
    padding: 24px;
    font-size: 10px;
    color: var(--studio-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

/* Área de Trabalho */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 10px 20px;
    width: calc(100% - 260px);
    display: flex;
    flex-direction: column;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

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

/* ============================================
   EDITOR - STUDIO INTERFACE
   ============================================ */

.editor-header {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--studio-border);
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--studio-muted);
    font-size: 12px;
}

.header-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.save-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--studio-gray);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--studio-border);
    flex-wrap: wrap;
}

.song-name-input {
    min-width: 180px;
    border: none !important;
    background: transparent !important;
    font-weight: 600;
}

.song-author-input {
    min-width: 120px;
    border: none !important;
    background: transparent !important;
    font-size: 12px !important;
    color: var(--studio-muted) !important;
}

.song-key-select {
    background: var(--studio-dark) !important;
    border: 1px solid var(--studio-border) !important;
}

.bpm-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--studio-dark);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--studio-border);
}

.song-bpm-input {
    width: 50px !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    text-align: center;
    font-weight: 700;
    color: var(--studio-accent) !important;
    -moz-appearance: textfield;
}

.song-bpm-input::-webkit-outer-spin-button,
.song-bpm-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bpm-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--studio-muted);
    text-transform: uppercase;
}

.btn-save {
    padding: 6px 18px !important;
    font-size: 11px !important;
    white-space: nowrap;
}

input[type="text"], select {
    background-color: var(--studio-gray);
    border: 1px solid var(--studio-border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus, select:focus {
    border-color: var(--studio-accent);
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    flex: 1;
    align-items: start;
}

/* Fretboard - Mantendo o design que você gostou */
.fretboard-wrapper {
    background-color: var(--studio-dark);
    padding: 45px 20px 25px 20px;
    border-radius: 12px;
    border: 1px solid var(--studio-border);
    overflow-x: auto;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.6);
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.fretboard {
    display: grid;
    grid-template-rows: repeat(4, 40px);
    background: #3d2b1f;
    border-radius: 4px;
    min-width: 100%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.string-row {
    display: flex;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.string-row::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    background: linear-gradient(to bottom, #999, #555);
    z-index: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Estilo para notas que já foram clicadas mas não são a última */
.fret.has-note .note-marker-circle {
    transform: translate(-50%, -50%) scale(0.8);
    background-color: var(--studio-gray);
    color: var(--studio-muted);
    box-shadow: none;
    border: none;
    opacity: 0.6;
}

.fret.last-clicked .note-marker-circle {
    transform: translate(-50%, -50%) scale(1) !important;
    background-color: var(--note-color, var(--studio-accent)) !important;
    color: var(--note-text-color, var(--studio-black)) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 0 15px var(--note-color, var(--studio-accent)) !important;
    opacity: 1 !important;
    z-index: 11;
}

.color-options-container {
    margin-left: 25px;
    padding: 10px;
    border-left: 2px solid var(--studio-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hide-colored-notes .color-options-container {
    display: none;
}

#fixed-color {
    width: 50px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.fret {
    flex: 1;
    min-width: 45px;
    border-right: 1px solid rgba(255,255,255,0.2);
    position: relative;
    cursor: pointer;
    z-index: 2;
}

.fret[data-fret="0"] {
    flex: 0 0 45px;
    min-width: 45px;
    background: rgba(0,0,0,0.4);
    border-right: 5px solid #ffd700;
}

.fret:hover {
    background: rgba(255,255,255,0.08);
}

.fret-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 8px rgba(0,0,0,0.8), 0 0 5px var(--studio-accent);
    letter-spacing: 1px;
    transition: var(--transition);
    z-index: 20;
    background: rgba(18, 18, 20, 0.8);
    padding: 1px 5px;
    border-radius: 4px;
    border: none;
}

.label-top {
    top: -35px;
}

.label-bottom {
    bottom: -35px;
}

.fret:hover .fret-label {
    color: var(--studio-accent);
}

/* Slide Line Visual */
.slide-line {
    position: fixed;
    height: 6px;
    background: var(--studio-accent);
    box-shadow: 0 0 15px var(--studio-accent);
    pointer-events: none;
    z-index: 100;
    border-radius: 3px;
    transform-origin: left center;
    opacity: 0.8;
    margin-top: -3px;
}

.note-marker-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 28px;
    height: 28px;
    background-color: var(--studio-accent);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5), 0 0 10px var(--studio-accent);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--studio-black);
    font-weight: 900;
    font-size: 10px;
    border: none;
    padding: 2px;
}

.fret.last-clicked .note-marker-circle {
    transform: translate(-50%, -50%) scale(1);
}

.fret-inlay {
    position: absolute;
    width: 22px;
    height: 22px;
    background: #e0e0e0;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.3), 0 0 3px rgba(255,255,255,0.5);
    pointer-events: none;
}

/* Posicionamento centralizado entre as cordas */
.single-inlay {
    top: 100%;
    transform: translate(-50%, -50%);
}

.double-inlay-top {
    top: 100%;
    transform: translate(-50%, -50%);
}

.double-inlay-bottom {
    top: 100%;
    transform: translate(-50%, -50%);
}

/* Painel de Controle Estilo Mixer */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel-section {
    background-color: var(--studio-dark);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--studio-border);
}

.panel-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--studio-accent);
    margin-bottom: 12px;
    font-weight: 800;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-primary { background-color: var(--studio-text); color: var(--studio-black); }
.btn-primary:hover { background-color: #fff; }

.btn-secondary { background-color: var(--studio-gray); color: #fff; border: 1px solid var(--studio-border); }
.btn-secondary:hover { background-color: var(--studio-border); }

.btn-danger { background-color: transparent; color: #ff4757; border: 1px solid #ff4757; }
.btn-danger:hover { background-color: #ff4757; color: #fff; }

.btn-success { background-color: var(--studio-accent); color: var(--studio-black); }
.btn-success:hover { opacity: 0.9; }

.btn-warning { background-color: #ff9800; color: #fff; }
.btn-warning:hover { opacity: 0.9; }

.mobile-only {
    display: none;
}

.tip-mobile {
    display: none;
}

.tip-desktop {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    .tip-desktop {
        display: none !important;
    }
    .tip-mobile {
        display: block !important;
    }
}

.notes-list {
    height: 180px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    border: 1px solid var(--studio-border);
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 6px;
}

.note-item {
    padding: 4px 0;
    border-bottom: 1px solid var(--studio-border);
    color: var(--studio-muted);
}

/* Saída de Tablatura */
.tab-output-section {
    margin-top: 15px;
}

.tab-output-section h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0px;
    color: var(--studio-muted);
}

.tab-container {
    background-color: var(--studio-dark);
    color: #999;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--studio-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    -webkit-font-smoothing: antialiased;
}

.ascii-tab {
    font-size: 18px;
    line-height: 1.2;
    white-space: pre;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: -0.15em;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    word-spacing: 0.15em;
}

.ascii-tab span {
    display: inline;
    font-family: inherit;
}

.tab-header-text {
    font-size: 14px;
    opacity: 0.9;
    display: block;
    margin-bottom: 2px;
}

.tab-note {
    color: #00ff00;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.6), 0 0 25px rgba(0, 255, 0, 0.3);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.tab-colored-note {
    font-weight: 800;
    text-shadow: 0 0 8px currentColor;
    display: inline;
}

.tab-string {
    color: #666666;
    opacity: 1;
    font-weight: 600;
}

/* Biblioteca */
.song-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.song-card {
    background-color: var(--studio-dark);
    border: 1px solid var(--studio-border);
    padding: 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.song-card:hover {
    border-color: var(--studio-accent);
    background-color: var(--studio-gray);
}

.song-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
    color: #fff;
}

.song-author {
    font-size: 13px;
    color: var(--studio-accent);
    margin-bottom: 8px;
    font-weight: 600;
}

.song-card p {
    font-size: 12px;
    color: var(--studio-muted);
    margin-bottom: 4px;
}

.btn-delete-song {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--studio-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.btn-delete-song:hover {
    color: #ff4757;
}

/* Scrollbar Customizada */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--studio-black); }
::-webkit-scrollbar-thumb { background: var(--studio-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--studio-muted); }

/* ============================================
   MODO CLARO E MELHORIAS DE UI
   ============================================ */

body.light-mode {
    --studio-black: #f0f2f5;
    --studio-dark: #ffffff;
    --studio-gray: #e4e6eb;
    --studio-border: #ced0d4;
    --studio-text: #1c1e21;
    --studio-muted: #65676b;
    --studio-accent: #27ae60;
    --studio-accent-dim: rgba(39, 174, 96, 0.1);
}

body.light-mode .logo-text {
    color: #1c1e21;
}

body.light-mode .fretboard {
    background: #5d4037;
}

body.light-mode .ascii-tab {
    background: #f9f9f9;
    color: #333;
}

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

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

.btn-sm {
    padding: 4px 12px !important;
    font-size: 11px !important;
    white-space: nowrap;
}

#btn-undo-export,
#btn-add-bar-export {
    font-weight: 600;
}

#btn-add-bar-export {
    background: linear-gradient(135deg, var(--studio-accent), #27b85f);
    color: var(--studio-black) !important;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

#btn-add-bar-export:hover {
    background: linear-gradient(135deg, #27b85f, var(--studio-accent));
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

#btn-add-bar-export:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--studio-border);
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 10px;
}

.tuning-settings {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tuning-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.tuning-row select {
    padding: 2px 6px;
    font-size: 11px;
}

/* Esconder elementos baseados em configurações */
body.hide-note-names .note-marker-circle {
    color: transparent !important;
}

body.hide-note-names .fret.last-clicked .note-marker-circle {
    color: var(--studio-black) !important;
}

body.hide-scale-highlight .fret.in-scale {
    background: transparent !important;
}

/* Estilos para Marcadores de Seção */
.marker-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.btn-marker {
    text-transform: none !important;
    font-size: 10px !important;
    padding: 6px 4px !important;
}

.note-item.is-section {
    background-color: var(--studio-accent-dim);
    color: var(--studio-accent);
    font-weight: bold;
    border-left: 3px solid var(--studio-accent);
}

.note-item.is-pause {
    background-color: var(--studio-gray);
    color: var(--studio-muted);
    font-style: italic;
}

.tab-section-marker {
    color: var(--studio-accent);
    font-weight: bold;
}

/* ============================================
   ESTILOS DO TUTORIAL (MODAL)
   ============================================ */

.btn-help {
    background-color: var(--studio-gray);
    color: #fff;
    border: 1px solid var(--studio-border);
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-help:hover {
    background-color: var(--studio-accent);
    border-color: var(--studio-accent);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--studio-dark);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--studio-border);
    width: 80%;
    max-width: 600px;
    border-radius: 12px;
    position: relative;
    color: var(--studio-text);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--studio-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

.tutorial-steps {
    margin: 25px 0;
    max-height: 400px;
    overflow-y: auto;
}

.step {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--studio-border);
}

.step:last-child {
    border-bottom: none;
}

.step h3 {
    color: var(--studio-accent);
    margin-bottom: 8px;
    font-size: 16px;
}

.step p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--studio-muted);
}

#btn-close-tutorial {
    width: 100%;
    padding: 12px;
    font-weight: bold;
}

/* ============================================
   MENU HAMBÚRGUER PARA MOBILE
   ============================================ */

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    width: 24px;
    height: 18px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    justify-content: space-between;
    margin-right: 10px;
    flex-shrink: 0;
    z-index: 103;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--studio-border);
    flex-wrap: wrap;
}

.section-header .header-title {
    flex: 1;
}

.section-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-header .subtitle {
    color: var(--studio-muted);
    font-size: 12px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--studio-accent);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

.panel-toggle-btn {
    background-color: var(--studio-accent) !important;
    color: var(--studio-black) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3) !important;
}

.panel-toggle-btn:hover {
    filter: brightness(1.1) !important;
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4) !important;
}

.panel-toggle-btn.active {
    background-color: var(--studio-text) !important;
    color: var(--studio-black) !important;
}

/* ============================================
   RESPONSIVIDADE - TABLET (1024px e abaixo)
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
    }
    
    .logo-text, .nav-label, .version {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
        padding: 15px 20px;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .editor-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .header-title h1 {
        font-size: 18px;
    }
    
    .save-controls {
        gap: 8px;
        padding: 4px 8px;
    }
    
    .song-name-input {
        min-width: 120px;
    }
    
    .song-author-input {
        min-width: 80px;
    }
    
    .fretboard-wrapper {
        padding: 40px 15px;
        margin-bottom: 15px;
    }
    
    .fretboard {
        grid-template-rows: repeat(4, 40px);
    }
    
    .fret {
        min-width: 35px;
    }
    
    .fret[data-fret="0"] {
        flex: 0 0 35px;
        min-width: 35px;
    }
    
    .note-marker-circle {
        width: 26px;
        height: 26px;
        font-size: 9px;
    }
    
    .fret-inlay {
        width: 22px;
        height: 22px;
    }
    
    .label-top {
        top: -35px;
    }
    
    .label-bottom {
        bottom: -35px;
    }
    
    .fret-label {
        font-size: 13px;
    }
    
    .control-panel {
        gap: 15px;
    }
    
    .panel-section {
        padding: 12px;
    }
    
    .panel-title {
        font-size: 9px;
        margin-bottom: 8px;
    }
    
    .button-group {
        gap: 8px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .notes-list {
        height: 120px;
        font-size: 11px;
    }
    
    .ascii-tab {
        font-size: 14px;
    }
    
    .tab-container {
        padding: 15px;
    }
}

/* ============================================
   RESPONSIVIDADE - MOBILE PAISAGEM (até 1024px)
   ============================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 102;
        height: 100vh;
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar .logo {
        display: none;
    }

    .sidebar.open .logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 20px;
    }

    .sidebar.open .mobile-program-title {
        display: block;
    }

    .sidebar.open .nav-label {
        display: inline;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 5px 15px 70px 15px;
    }
    
    .editor-header {
        margin-bottom: 5px;
        padding-bottom: 5px;
        gap: 5px;
    }
    
    .header-title {
        display: none;
    }
    
    .header-controls {
        gap: 8px;
    }
    
    .save-controls {
        gap: 6px;
        padding: 3px 6px;
    }
    
    .song-name-input {
        min-width: 90px;
        font-size: 10px;
    }
    
    .song-author-input {
        min-width: 60px;
        font-size: 10px;
    }
    
    .song-key-select {
        font-size: 11px;
    }
    
    .bpm-control {
        padding: 2px 6px;
        gap: 3px;
    }
    
    .song-bpm-input {
        width: 35px !important;
        font-size: 11px;
    }
    
    .bpm-label {
        font-size: 8px;
    }
    
    .btn-save {
        padding: 5px 10px !important;
        font-size: 10px !important;
    }
    
    .btn-help {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .fretboard-wrapper {
        padding: 30px 10px;
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .fretboard {
        grid-template-rows: repeat(4, 35px);
    }
    
    .fret {
        min-width: 30px;
    }
    
    .fret[data-fret="0"] {
        flex: 0 0 30px;
        min-width: 30px;
    }
    
    .note-marker-circle {
        width: 22px;
        height: 22px;
        font-size: 8px;
    }
    
    .fret-inlay {
        width: 18px;
        height: 18px;
    }
    
    .label-top {
        top: -30px;
    }
    
    .label-bottom {
        bottom: -30px;
    }
    
    .fret-label {
        font-size: 11px;
    }
    
    .control-panel {
        display: none !important;
    }
    
    .sidebar .control-panel {
        display: flex !important;
        position: static !important;
        width: 100% !important;
        max-height: none !important;
        background: transparent !important;
        border: none !important;
        padding: 12px !important;
        overflow-y: visible !important;
    }
    
    .panel-section {
        padding: 10px;
    }
    
    .panel-title {
        font-size: 8px;
        margin-bottom: 6px;
    }
    
    .button-group {
        gap: 6px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .notes-list {
        height: 80px;
        font-size: 10px;
    }
    
    .note-item {
        padding: 2px 0;
    }
    
    .tab-output-section {
        margin-top: 5px;
    }
    
    .tab-output-section h2 {
        font-size: 11px;
        margin-bottom: 5px;
    }
    
    .ascii-tab {
        font-size: 12px;
    }
    
    .section-header-flex {
        margin-bottom: 8px;
    }
    
    .export-actions {
        gap: 4px;
    }
    
    .btn-sm {
        padding: 3px 8px !important;
        font-size: 9px !important;
    }
    
    .panel-toggle-btn {
        display: block !important;
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        z-index: 98 !important;
        padding: 6px 10px !important;
        font-size: 10px !important;
    }
}

/* ============================================
   RESPONSIVIDADE - MOBILE RETRATO (até 768px)
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 102;
        height: 100vh;
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar .logo {
        display: none;
    }

    .sidebar.open .logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 20px;
    }

    .sidebar.open .mobile-program-title {
        display: block;
    }

    .sidebar.open .nav-label {
        display: inline;
    }
    
    .menu-toggle {
        display: flex !important;
    }
    
    .section-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--studio-border);
        flex-wrap: wrap;
    }
    
    .section-header .header-title {
        flex: 1;
    }
    
    .section-header h1 {
        font-size: 18px;
        font-weight: 700;
    }
    
    .section-header .subtitle {
        color: var(--studio-muted);
        font-size: 11px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 10px 15px 70px 15px;
    }
    
    .editor-header {
        margin-bottom: 8px;
        padding-bottom: 5px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-title {
        display: none;
    }
    
    .header-title h1 {
        font-size: 16px;
    }
    
    .header-controls {
        width: 100%;
        gap: 8px;
    }
    
    .save-controls {
        width: 100%;
        gap: 8px;
        padding: 6px 8px;
    }
    
    .song-name-input {
        min-width: 100px;
        flex: 1;
    }
    
    .song-author-input {
        min-width: 70px;
        flex: 1;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .fretboard-wrapper {
        padding: 40px 10px;
        margin-bottom: 12px;
    }
    
    .fretboard {
        grid-template-rows: repeat(4, 40px);
    }
    
    .fret {
        min-width: 35px;
    }
    
    .fret[data-fret="0"] {
        flex: 0 0 35px;
        min-width: 35px;
    }
    
    .note-marker-circle {
        width: 26px;
        height: 26px;
        font-size: 9px;
    }
    
    .fret-inlay {
        width: 22px;
        height: 22px;
    }
    
    .label-top {
        top: -35px;
    }
    
    .label-bottom {
        bottom: -35px;
    }
    
    .fret-label {
        font-size: 13px;
    }
    
    .control-panel {
        display: none !important;
    }
    
    .sidebar .control-panel {
        display: flex !important;
        position: static !important;
        width: 100% !important;
        max-height: none !important;
        background: transparent !important;
        border: none !important;
        padding: 12px !important;
        overflow-y: visible !important;
    }

    .sidebar {
        overflow-y: auto;
    }
    
    .panel-section {
        padding: 10px;
    }
    
    .panel-title {
        font-size: 9px;
        margin-bottom: 8px;
    }
    
    .button-group {
        gap: 8px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .notes-list {
        height: 100px;
        font-size: 11px;
    }
    
    .tab-output-section {
        margin-top: 5px;
    }
    
    .tab-output-section h2 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .tab-container {
        padding: 12px;
    }
    
    .ascii-tab {
        font-size: 14px;
    }
    
    .section-header-flex {
        margin-bottom: 10px;
    }
    
    .export-actions {
        gap: 6px;
        flex-wrap: wrap;
    }

    #btn-undo-export,
    #btn-add-bar-export {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    #btn-add-bar-export {
        order: 2;
        flex: 0 0 auto;
    }
    
    .btn-sm {
        padding: 4px 10px !important;
        font-size: 10px !important;
    }
    
    .panel-toggle-btn {
        display: block !important;
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        z-index: 98 !important;
        padding: 10px 14px !important;
        font-size: 12px !important;
    }
}

/* ============================================
   AVISO DE ORIENTAÇÃO MOBILE
   ============================================ */

.orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--studio-black);
    z-index: 9999;
    color: white;
    text-align: center;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.warning-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 300px;
}

.warning-icon {
    font-size: 50px;
    animation: rotateDevice 2s infinite ease-in-out;
}

.orientation-warning p {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

@keyframes rotateDevice {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

/* Mostrar apenas em telas pequenas na vertical */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .orientation-warning {
        display: flex;
    }
    .app-container {
        display: none;
    }
}


/* ============================================
   FEEDBACK VISUAL MOBILE
   ============================================ */

/* Animação de feedback para double tap */
.double-tap-feedback {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    font-size: 48px;
    font-weight: 900;
    color: var(--studio-accent);
    text-shadow: 0 0 20px var(--studio-accent);
    animation: tapPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform: translate(-50%, -50%);
}

@keyframes tapPulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Feedback visual do botão pressionado */
.btn.btn-pressed {
    transform: scale(0.95);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Melhorar visibilidade do botão de adicionar barra em mobile */
@media (max-width: 768px) {
    #btn-add-bar {
        background: linear-gradient(135deg, var(--studio-accent), #27b85f);
        box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
        font-weight: 700;
        padding: 12px 16px !important;
        font-size: 13px !important;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

    #btn-add-bar:active {
        transform: scale(0.95);
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    #btn-add-bar:hover {
        background: linear-gradient(135deg, #27b85f, var(--studio-accent));
        box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4);
    }
}

/* Dica visual para double tap em mobile */
@media (max-width: 768px) {
    .fretboard-wrapper::after {
        content: 'Toque 2x para adicionar barra (|)';
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        color: var(--studio-accent);
        opacity: 0.6;
        font-weight: 600;
        white-space: nowrap;
        pointer-events: none;
    }
}


/* ============================================
   LAYOUT MOBILE LANDSCAPE (HORIZONTAL)
   ============================================ */

@media (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
    .main-content {
        padding: 4px 8px 40px 8px;
    }
    
    .editor-header {
        margin-bottom: 4px;
        padding-bottom: 4px;
        gap: 4px;
    }
    
    .save-controls {
        gap: 4px;
        padding: 3px 6px;
    }
    
    .song-name-input {
        min-width: 80px;
        font-size: 11px;
    }
    
    .song-author-input {
        min-width: 60px;
        font-size: 10px;
    }
    
    .song-key-select {
        font-size: 10px;
        padding: 3px 4px !important;
    }
    
    .bpm-control {
        padding: 2px 6px;
        gap: 3px;
    }
    
    .song-bpm-input {
        width: 40px !important;
        font-size: 10px;
    }
    
    .bpm-label {
        font-size: 8px;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 9px;
    }
    
    .btn-save {
        padding: 4px 8px !important;
        font-size: 9px !important;
    }
    
    .btn-help {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .fretboard-wrapper {
        padding: 28px 8px 12px 8px;
        margin-bottom: 4px;
    }
    
    .fretboard-wrapper::after {
        display: none;
    }
    
    .fretboard {
        grid-template-rows: repeat(4, 28px);
    }
    
    .fret {
        min-width: 25px;
    }
    
    .fret[data-fret="0"] {
        flex: 0 0 25px;
        min-width: 25px;
    }
    
    .note-marker-circle {
        width: 18px;
        height: 18px;
        font-size: 7px;
    }
    
    .fret-inlay {
        width: 14px;
        height: 14px;
    }
    
    .label-top {
        top: -26px;
    }
    
    .label-bottom {
        bottom: -22px;
    }
    
    .fret-label {
        font-size: 10px;
        padding: 0 3px;
    }
    
    .control-panel {
        display: none !important;
    }
    
    .tab-output-section {
        margin-top: 2px;
    }
    
    .tab-output-section h2 {
        font-size: 10px;
        margin-bottom: 3px;
    }
    
    .section-header-flex {
        margin-bottom: 4px;
        gap: 4px;
    }
    
    .export-actions {
        gap: 3px;
    }
    
    .btn-sm {
        padding: 3px 6px !important;
        font-size: 8px !important;
    }
    
    .tab-container {
        padding: 4px 8px;
    }
    
    .ascii-tab {
        font-size: 12px;
        line-height: 1.15;
        letter-spacing: -0.12em;
        word-spacing: 0.12em;
    }
    
    .notes-list {
        display: none;
    }
    
    .panel-toggle-btn {
        display: none !important;
    }

    /* Ajustes para o Modal de Tutorial no Mobile Landscape */
    .modal {
        display: none;
        align-items: center;
        justify-content: center;
        padding: 10px;
    }

    .modal-content {
        margin: 0 auto;
        width: 95%;
        max-width: 550px;
        max-height: 95vh;
        padding: 15px 20px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-content h2 {
        font-size: 16px;
        margin-bottom: 10px;
        padding-right: 30px;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 22px;
    }

    .tutorial-steps {
        margin: 10px 0;
        max-height: none;
        flex: 1;
        overflow-y: auto;
        padding-right: 5px;
    }

    .step {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .step h3 {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .step p {
        font-size: 11px;
        line-height: 1.4;
    }

    #btn-close-tutorial {
        padding: 8px;
        font-size: 12px;
        margin-top: 5px;
    }
}

/* --- Training Mode Styles --- */
.training-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.training-card {
    background: var(--studio-surface, var(--studio-dark));
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
}

.training-instruction {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--studio-text);
    min-height: 3rem;
}

.training-instruction strong {
    color: var(--studio-accent);
    font-size: 1.6rem;
}

.training-feedback {
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.training-feedback.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.training-feedback.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.training-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.training-settings-mini {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

.training-settings-mini .setting-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.training-settings-mini select {
    background: var(--studio-bg, var(--studio-black));
    color: var(--studio-text);
    border: 1px solid var(--studio-border);
    padding: 5px 10px;
    border-radius: 4px;
}

.instruction-text {
    color: var(--studio-muted);
    font-style: italic;
}

/* Fretboard Overrides for Training */
.fret.training-selected .note-marker-circle {
    transform: translate(-50%, -50%) scale(1.1) !important;
    opacity: 1 !important;
    box-shadow: 0 0 15px var(--studio-accent) !important;
    border: 2px solid white !important;
}

.fret.training-correct .note-marker-circle {
    background-color: #2ecc71 !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
    opacity: 1 !important;
    box-shadow: 0 0 15px #2ecc71 !important;
}

.fret.training-wrong .note-marker-circle {
    background-color: #e74c3c !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
    opacity: 1 !important;
    box-shadow: 0 0 15px #e74c3c !important;
}

.hidden {
    display: none !important;
}
