/**
 * assets/css/tab_editor.css
 * Guitar Pro style interactive tab editor (V77.0 - PRECISE 1PX + HIGH CONTRAST)
 */

/* High Contrast Default (Dark Mode) */
:root {
    --tab-line-color: rgba(255, 255, 255, 0.25);
    --measure-bar-color: rgba(255, 255, 255, 0.35);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --tab-line-color: #cbd5e1;
    --measure-bar-color: #94a3b8;
}

.tab-grid {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    position: relative;
    padding: 60px 40px;
    min-width: max-content;
    min-height: 200px;
}

.editor-toolbar {
    position: sticky;
    top: 100px;
    z-index: 100;
    background: var(--card-bg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    margin-bottom: 2rem;
    box-sizing: border-box;
}

.tab-row {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding: 0 1.5rem 4rem 1.5rem;
    min-width: max-content;
    justify-content: flex-start;
}

.tab-line-labels {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 150px;
    padding-right: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.vertical-tab-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Bitter', serif;
    font-weight: 800;
    font-size: 1.4rem;
    line-height: 1.1;
    letter-spacing: 2px;
}

.tab-columns-container {
    display: flex;
    flex-wrap: nowrap;
    height: 150px;
}

.tab-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 44px;
    min-width: 44px;
    height: 150px;
    position: relative;
    transition: background 0.2s;
    cursor: pointer;
}

.tab-column.active {
    background: rgba(16, 185, 129, 0.15);
}

/* 6 Gitar Teli - Arkaplan Çizgileri */
.tab-column::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--tab-line-color) 100%, transparent 100%),
        linear-gradient(to right, var(--tab-line-color) 100%, transparent 100%),
        linear-gradient(to right, var(--tab-line-color) 100%, transparent 100%),
        linear-gradient(to right, var(--tab-line-color) 100%, transparent 100%),
        linear-gradient(to right, var(--tab-line-color) 100%, transparent 100%),
        linear-gradient(to right, var(--tab-line-color) 100%, transparent 100%);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: 0 12px, 0 37px, 0 62px, 0 87px, 0 112px, 0 137px;
}

.tab-note {
    height: 25px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.2rem;
    position: relative;
    font-family: 'Bitter', serif;
    z-index: 2;
}

.tab-note:not(:empty)::after {
    display: none !important;
}

.tab-note.active {
    color: white !important;
}

.tab-note.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 20px;
    background: #10b981;
    border-radius: 4px;
    z-index: -1;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.note-effect {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -18px;
    font-size: 0.8rem;
    color: #ef4444 !important;
    font-weight: 900;
    pointer-events: none;
    z-index: 1000;
    text-shadow: 1px 1px 0px var(--card-bg), -1px -1px 0px var(--card-bg);
    font-family: 'Arial Black', sans-serif;
    line-height: 1;
}

.measure-container {
    position: relative;
    display: flex;
}

.measure-number {
    position: absolute;
    top: -28px;
    left: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-secondary);
    font-style: italic;
}

.measure-bar {
    width: 2px;
    background: var(--measure-bar-color);
    height: 126px;
    margin: 12px 21px 0 21px;
    flex-shrink: 0;
}

.rhythm-container {
    position: absolute;
    bottom: -45px;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.rhythm-stem {
    width: 2px;
    height: 28px;
    background: var(--text-secondary);
    opacity: 0.8;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.rhythm-beam {
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0px;
    height: 3px;
    background: var(--text-primary);
    z-index: 5;
}

.rhythm-beam.beamed {
    width: 44px;
}

.rhythm-beam.flag {
    width: 10px;
}

.rhythm-beam-upper {
    bottom: 10px;
}

.duration-btn.active,
.effect-btn.active {
    background: var(--page-accent) !important;
}

/* Player Mode Centering */
.tab-grid.player-mode {
    margin: 0 auto !important;
    width: max-content !important;
    padding: 30px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.tab-grid.player-mode .tab-row {
    justify-content: center !important;
}

/* Mobile Responsiveness for Tab Grid */
@media (max-width: 576px) {
    .tab-column {
        width: 38px;
        min-width: unset !important; /* Allow JS adaptive width */
    }
    .rhythm-beam.beamed {
        width: 38px !important;
    }
    .measure-bar {
        margin: 12px 12px 0 12px !important;
    }
    .tab-row {
        padding: 0 0.2rem 3rem 0.2rem !important;
    }
    .tab-grid {
        padding: 20px 5px !important; /* Reduced side padding */
    }
    .vertical-tab-text {
        font-size: 1rem !important;
    }
    .tab-line-labels {
        padding-right: 5px !important;
    }
    .tab-note {
        font-size: 0.95rem !important;
    }
}

@media (max-width: 400px) {
    .tab-column {
        width: 34px;
    }
    .rhythm-beam.beamed {
        width: 34px !important;
    }
    .measure-bar {
        margin: 12px 5px 0 5px !important;
    }
    .tab-note {
        font-size: 0.85rem !important;
    }
}