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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.0;
    color: #333;
    background-color: #f5f5f5;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: #3f51b5;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

header h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 100;
    text-align: center;
}

h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 100;
    text-align: left;
}
.midi-status {
    padding: 0.5rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: aliceblue;
    width: 150px;
    float: left;
    margin-right: 20px;
    
}

.midi-available {
    background-color: rgb(11, 164, 11);
    color: #eeeeee;
}

.midi-unavailable {
    background-color: rgba(255, 0, 0, 0.89);
    color: #e4e4e4;
}

/* Main Content */
main {
    padding: 1rem 0;
    width: 100%;
}

section {
    margin-bottom: 1.5rem;
    width: 100%;
}

hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #ddd;
    width: 100%;
}

/* Collapsible Section */
.collapsible-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    background-color: white;
}

.collapsible-header {
    padding: 1rem;
    background-color: #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: right;
    align-items: center;
}

.collapsible-header h2 {
    margin: 0;
    font-size: 1.25rem;
        font-weight: 200;
}

.collapsible-content {
    padding: 1rem;
    display: block;
}

.collapsible-content.collapsed {
    display: none;
}

.toggle-icon::after {
    content: "▼";
    font-size: 1rem;
    color: blue;
    padding-left: 15px;
}

.collapsed .toggle-icon::after {
    content: "▶";
}

/* Forms */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    width: 800px;
}

.form-group {
    flex: 1;
    min-width: 50px;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

input, select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

input, select name {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}
/* Number inputs for Bank MSB, LSB, Program */
.number-input {
    width: 80px !important;
    text-align: center;
    padding: 0.rem 0.rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
    height: 38px; /* Match input height */
    margin-top: 0px;
}

.btn-primary {
    background-color: #3f51b5;
    color: white;
}

.btn-primary:hover {
    background-color: #303f9f;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #388e3c;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-secondary {
    background-color: #9e9e9e;
    color: white;
}

.btn-secondary:hover {
    background-color: #757575;
}

/* Import/Export Controls */
.import-export-controls {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    width: 100%;
}

.import-label {
    margin: 0;
    display: inline-block;
}

#import-file {
    display: none;
}

/* Synthesizer Columns */
.columns-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 1rem;
    width: 100%;
    /* background-color: #e2e1e1; /* Darker gray background */
}

.no-synths-message {
    width: 100%;
    padding: 2rem;
    text-align: center;
    background-color: #eee;
    border-radius: 4px;
}

.synth-column {
    flex: 0 0 360px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 895px; /* Maximum height as requested */
}

.expanded-view .synth-column {
    max-height: 1050px; /* Increased height when top section is collapsed */
}

.column-header {
    padding: 1rem;
    background-color: #e0e0e0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.column-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #3f51b5;
    padding-right: 4rem;
    padding-left: 1.5rem; /* Space for drag handle */
}


.synth-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #666;
}

.header-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.header-controls .btn {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}

/* Program Change Section */
.program-change-section {
    padding: 1rem;
    border-bottom: 1px solid #567ff2;
    width: 100%;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
    margin-bottom: 1rem;
    width: 100%;
}

.controls-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: auto;
}

.send-row {
    display: flex;
    justify-content: flex-end; /* Right align the send button */
     margin-top: 1.3rem;
    margin-bottom: 1rem;
    width: 100%;
}

.save-row {
    display: flex;
    gap: 0.5rem;
    align-items: left;
    width: 100%;
    flex-wrap: wrap;
}

.category-group, .favorite-name-group {

    min-width: 20px;
    display: flex;
    align-items: center;
    font-size: 8px;
}


/* Favorites Section */
.favorites-section {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    width: 100%;
}

.favorites-header {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #3f51b5;
}

.no-favorites {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 1rem 0;
    display: none;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.favorite-item {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    transition: background-color 0.2s;
    width: 100%;
}

.favorite-item:hover {
    background-color: #e0e0e0;
}

.favorite-item.dragging {
    opacity: 0.5;
    background-color: #d0d0d0;
}

.drag-handle {
    cursor: grab;
    padding: 0 0.5rem;
    color: #999;
    font-size: 1rem;
}

.drag-handle:hover {
    color: #666;
}

.favorite-button {
    flex: 1;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.category-label {
    font-weight: med;
    color: #3f51b5;
        font-size: 0.875rem;
}

.program-info {
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

.favorite-controls {
    display: flex;
    gap: 0.25rem;
    margin-right: 0.25rem;
}

.favorite-controls .btn {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    line-height: 1;
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1rem;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 200;
    color: #3f51b5;
}

.close-modal {
    color: #aaa;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

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

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    background-color: #f5f5f5;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    font-size: 0.875rem;
    color: #666;
    width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Drag and Drop */
.drag-over {
    border: 2px dashed #3f51b5;
    /* background-color: rgba(63, 81, 181, 0.1);*/
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
}
/* Synthesizer drag handle */
.synth-drag-handle {
    position: absolute;
    left: 0.5rem;
    top: 1rem;
    cursor: grab;
    color: #506fa8;
    font-size: 1rem;
}

.synth-drag-handle:hover {
    color: #3f578a;
}

.synth-column.dragging {
    opacity: 1;
    background-color: rgba(208, 208, 208, 0);
}

/* Drag and Drop */
.drag-over {
    border: 2px dashed #3f51b5;
    background-color: rgba(63, 81, 181, 0.1);
}
/* Container für zentrierte Bilder */
.image-container {
    text-align: center; /* Zentriert den Inhalt horizontal */
    margin-bottom: 50px; /* 50 Pixel Abstand nach unten */
    width: 100%; /* Volle Breite nutzen */
    display: block; /* Als Block-Element anzeigen */
}

/* Link-Stil für Bilder */
.image-container .image-link {
    display: inline-block;
    transition: transform 0.3s ease;
    text-decoration: none; /* Entfernt die Link-Unterstreichung */
}

.image-container .image-link:hover {
    transform: scale(1.05);
}

/* Spezifischer Bild-Stil innerhalb des Containers */
.image-container img {
    width: 150px !important; /* Fixe Breite von 150 Pixeln mit !important */
    height: auto !important; /* Höhe wird proportional angepasst */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 150px !important; /* Begrenzt die maximale Breite */
    margin: 0 auto; /* Zusätzliche Zentrierung */
    display: inline-block; /* Inline-Block für bessere Kontrolle */
}
/* Ansichts-Steuerelemente */
.view-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

/* Magazin-Ansicht Stile */
body.magazine-mode .columns-container {
    overflow-x: visible;
}

/* Vertikaler Titel für kollabierte Spalten */
.vertical-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background-color: var(--primary-color, #3f51b5);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    display: none;
    z-index: 10;
    cursor: pointer;
}

/* Im expandierten Modus nie anzeigen */
body:not(.magazine-mode) .vertical-title {
    display: none !important;
}

/* Kollabierte Spalte - nur in Magazin-Ansicht */
body.magazine-mode .synth-column.collapsed {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    flex: 0 0 40px !important;
    margin-right: 5px;
    overflow: hidden !important;
    position: relative;
}

/* Zeige vertikalen Titel nur in kollabierten Spalten */
body.magazine-mode .synth-column.collapsed .vertical-title {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Verstecke reguläre Inhalte in kollabierten Spalten */
body.magazine-mode .synth-column.collapsed > *:not(.vertical-title) {
    display: none !important;
}

/* Aktive Spalte in Magazin-Ansicht */
body.magazine-mode .synth-column.active {
    width: 360px !important;
    min-width: 360px !important;
    flex: 0 0 360px !important;
}