/* Preview Container */
.preview-container {
    width: 100%;
    background-color: #ffffff;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: auto;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: none;
    /* Hidden by default */
    position: relative;
    z-index: 100;
}

.preview-container.visible {
    display: block !important;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.preview-title {
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

.preview-meta {
    font-size: 14px;
    color: #666;
}

/* System (Row of measures) */
.preview-system {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 30px;
    width: 100%;
}

/* Measure */
.preview-measure {
    position: relative;
    height: 200px;
    /* Adjust based on content */
    border-right: 1px solid #000;
    box-sizing: border-box;
    flex: 1;
    min-width: 200px;
}

.preview-measure:first-child {
    border-left: 1px solid #000;
}

/* Track Layers within Measure */
.preview-track-chord {
    height: 40px;
    position: relative;
    width: 100%;
}

.preview-track-tab {
    height: 120px;
    position: relative;
    width: 100%;
}

.preview-track-lyrics {
    height: 40px;
    position: relative;
    width: 100%;
    border-top: 1px dashed #ccc;
}

/* Elements */
.preview-chord {
    position: absolute;
    font-weight: bold;
    font-size: 14px;
    color: #000;
    transform: translateX(-50%);
}

.preview-lyric {
    position: absolute;
    font-size: 12px;
    color: #333;
    top: 5px;
}

.preview-string-line {
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: #999;
}

.preview-note {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    background-color: #fff;
    padding: 0 2px;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .preview-container,
    .preview-container * {
        visibility: visible;
    }

    .preview-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        border: none;
    }
}