/* ========================================
   Diatonische Handharmonika - Stylesheet
   ======================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 80%; /* 100% / 1.25 = 80% - kompensiert body scale(1.25) */
    overflow-x: hidden;
}

body {
    min-height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #40E0D0 0%, #20B2AA 50%, #008B8B 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    /* Standardkonforme Skalierung (ersetzt zoom: 1.25) */
    transform: scale(1.25);
    transform-origin: top left;
    width: 80%; /* 100% / 1.25 = 80% */
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 76vh; /* Viewport-Höhe angepasst für Skalierung */
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header - Homepage
   ======================================== */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.header-decoration {
    flex-shrink: 0;
}

.deco-accordion {
    height: 120px;
    aspect-ratio: 1248 / 864; /* Feste Proportionen für Platzreservierung */
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
}

.site-title {
    font-size: 2.8rem;
    color: #006666;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.5);
    text-align: center;
}

/* Instrumente Section - Homepage */
.instruments {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 30px;
    flex-wrap: wrap;
    background: #FFF8E7;
    border: 2px solid rgba(64, 224, 208, 0.4);
    border-radius: 10px;
}

.instrument {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.instrument img {
    width: auto;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

/* Einreiher - kleinste */
.instrument:nth-child(1) img {
    height: 200px;
    aspect-ratio: 632 / 395;
}

/* Zweireiher - mittel */
.instrument:nth-child(2) img {
    height: 220px;
    aspect-ratio: 765 / 552;
}

/* Clubmodell - größte */
.instrument:nth-child(3) img {
    height: 260px;
    aspect-ratio: 638 / 565;
}

.instrument img:hover {
    transform: scale(1.05);
}

.instrument span {
    display: block;
    margin-top: 10px;
    font-size: 1.1rem;
    color: #004040;
    font-weight: 500;
}

/* Site Subtitle */
.site-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #004040;
    margin-bottom: 20px;
}

/* ========================================
   Header - Category Pages
   ======================================== */
.category-header {
    text-align: center;
    padding: 20px 0;
}

.category-title {
    font-size: 2.5rem;
    color: #006666;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.5);
    margin-bottom: 20px;
}

.header-image {
    width: 100%;
}

.header-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
    filter: drop-shadow(2px 4px 8px rgba(0,0,0,0.3));
}

/* ========================================
   Navigation
   ======================================== */
.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    margin: 20px 0;
}

.nav-tab {
    padding: 10px 15px;
    text-decoration: none;
    color: #004040;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.3);
}

.nav-tab:hover {
    background: rgba(255,255,255,0.6);
}

.nav-tab.active {
    background: #40E0D0;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-tab:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* ========================================
   Content Area
   ======================================== */
.content {
    flex: 0 0 auto; /* Passt sich dem Inhalt an */
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Homepage Content */
.home-content {
    text-align: center;
}

.contact-email {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #333;
}

.contact-email a {
    color: #008B8B;
    text-decoration: none;
}

.contact-email a:hover {
    text-decoration: underline;
}

.home-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    line-height: 1.8;
}

/* Impressum Content */
.impressum-content h2 {
    color: #006666;
    margin-top: 25px;
    margin-bottom: 10px;
}

.impressum-content h2:first-child {
    margin-top: 0;
}

/* ========================================
   Search
   ======================================== */
.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #40E0D0;
    border-radius: 25px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    border-color: #008B8B;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.25);
    outline: none;
}

/* ========================================
   Songs Table
   ======================================== */
.songs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border: 1px solid #555;
}

.songs-table thead {
    background: #40E0D0;
    color: #fff;
}

.songs-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #555;
}

.songs-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.songs-table th.sortable:hover,
.songs-table th.sortable:focus {
    background: #3BCDC0;
}

.songs-table th.sortable:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: -3px;
}

.sort-icon {
    margin-left: 5px;
    font-size: 0.9rem;
}

.songs-table tbody tr {
    background: rgba(64, 224, 208, 0.1);
    border-bottom: 1px solid rgba(64, 224, 208, 0.3);
    transition: background 0.2s ease;
}

.songs-table tbody tr:hover {
    background: rgba(64, 224, 208, 0.25);
}

.songs-table td {
    padding: 12px 10px;
    border: 1px solid #555;
}

.songs-table td:first-child {
    font-weight: 500;
}

/* Titel-Spalte nimmt den meisten Platz ein */
.songs-table th:first-child,
.songs-table td:first-child {
    width: 100%;
}

/* Instrumente-Spalte */
.songs-table th:nth-child(2),
.songs-table td:nth-child(2) {
    width: 180px;
    min-width: 180px;
}

/* Icon-Spalten rechts ausrichten */
.songs-table th:nth-child(3),
.songs-table th:nth-child(4),
.songs-table th:nth-child(5),
.songs-table td:nth-child(3),
.songs-table td:nth-child(4),
.songs-table td:nth-child(5) {
    width: 90px;
    text-align: center;
    white-space: nowrap;
}

/* Aktionen-Spalte breiter mit mehr Abstand */
.songs-table th.edit-column,
.songs-table td.edit-column {
    width: 120px;
    min-width: 120px;
    text-align: center;
    padding-left: 50px;
    white-space: nowrap;
}

.songs-table td.edit-column {
    display: table-cell;
}

.songs-table td.edit-column button {
    display: inline-flex;
    vertical-align: middle;
}

/* Table Icons */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: none;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 1.4rem;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.icon-btn:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
    background: rgba(64, 224, 208, 0.2);
}

/* Empty Table Message */
.empty-message {
    text-align: center;
    padding: 40px;
    color: #555;
    font-style: italic;
}

/* Add Song Button */
.add-song-btn {
    margin-top: 20px;
    padding: 12px 25px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    min-height: 44px;
}

.add-song-btn:hover {
    background: #219a52;
}

.add-song-btn:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: auto; /* Drückt Footer ans Fenster-Ende */
    color: #004040;
}

.footer a {
    color: #004040;
    text-decoration: none;
    margin-left: 15px;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #006666;
}

.modal-content label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.modal-content input:focus {
    border-color: #40E0D0;
    box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.3);
    outline: none;
}

.modal-content button {
    margin-top: 20px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal-content button:first-of-type {
    background: #40E0D0;
    color: #fff;
    margin-right: 10px;
}

.modal-content button:first-of-type:hover {
    background: #3BCDC0;
}

.modal-content button:last-of-type {
    background: #95a5a6;
    color: #fff;
}

.modal-content button:last-of-type:hover {
    background: #7f8c8d;
}

/* Remove-Link im Dropzone - kein Modal-Button-Styling */
.modal-content .remove-link,
.modal-content .remove-link:first-of-type,
.modal-content .remove-link:last-of-type {
    background: transparent !important;
    color: #e74c3c !important;
    margin: 3px 0 0 0 !important;
    padding: 0 !important;
}

.modal-content .remove-link:hover {
    background: transparent !important;
    color: #a02a1c !important;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-buttons button {
    margin-top: 0;
}

/* Löschen-Button rot */
.delete-confirm-btn {
    background: #e74c3c !important;
    color: #fff !important;
}

.delete-confirm-btn:hover {
    background: #c0392b !important;
}

/* ========================================
   Edit Mode Styles
   ======================================== */
.edit-mode [data-editable] {
    position: relative;
    cursor: pointer;
    outline: 2px dashed transparent;
    transition: outline-color 0.2s ease;
}

.edit-mode [data-editable]:hover {
    outline-color: #f39c12;
}

.edit-mode [data-editable]::after {
    content: '✏️';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 0.8rem;
    background: #f39c12;
    padding: 2px 5px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.edit-mode [data-editable]:hover::after {
    opacity: 1;
}

.edit-mode .edit-column {
    display: table-cell !important;
}

.edit-mode .add-song-btn {
    display: block !important;
}

/* Edit Column Hidden by Default */
.edit-column {
    display: none;
}

/* ========================================
   Audio Player
   ======================================== */
.audio-player {
    width: 150px;
    height: 30px;
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

/* Screen Reader Only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Accessibility: Focus Styles
   ======================================== */
/* Consistent focus ring for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #006666;
    color: #fff;
    padding: 10px 15px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0 0 5px 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Video Modal
   ======================================== */
.video-modal {
    display: none;
    justify-content: center;
    align-items: center;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 10;
    transition: transform 0.2s ease;
}

.video-close-btn:hover {
    transform: scale(1.2);
}

/* ========================================
   Dropzone Styles
   ======================================== */
.dropzone {
    border: 2px dashed #40E0D0;
    border-radius: 10px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fffe;
    margin-bottom: 15px;
}

.dropzone:hover {
    border-color: #008B8B;
    background: #e8f8f8;
}

.dropzone.dragover {
    border-color: #008B8B;
    background: #d0f0f0;
    transform: scale(1.02);
}

.dropzone.uploading {
    opacity: 0.7;
    cursor: wait;
}

.dropzone.has-file {
    border-style: solid;
    border-color: #27ae60;
    background: #e8f8ee;
}

.dropzone-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.dropzone-text {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.dropzone-hint {
    display: block;
    font-size: 0.9rem;
    color: #555;
}

.dropzone-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
}

.dropzone-success .dropzone-icon {
    font-size: 2rem;
}

.dropzone-success .file-name {
    font-size: 0.9rem;
    color: #333;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.3;
}

.dropzone-success .remove-link {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #e74c3c;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    margin: 3px 0 0 0;
    text-decoration: underline;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.dropzone-success .remove-link:hover,
.dropzone-success .remove-link:focus,
.dropzone-success .remove-link:active {
    background: transparent !important;
    background-color: transparent !important;
    color: #a02a1c;
    transform: scale(1.05);
}

.dropzones-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 15px;
}

@media (max-width: 500px) {
    .dropzones-row {
        grid-template-columns: 1fr;
    }
}

/* Hidden file inputs */
.hidden-file-input {
    display: none;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.8rem;
    }

    .category-title {
        font-size: 1.8rem;
    }

    .deco-accordion {
        height: 80px;
    }

    .instrument img {
        height: 100px;
    }

    .instruments {
        gap: 20px;
    }

    .main-nav {
        gap: 3px;
    }

    .nav-tab {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .content {
        padding: 15px;
    }

    .songs-table {
        font-size: 0.9rem;
    }

    .songs-table th,
    .songs-table td {
        padding: 8px 5px;
    }

    .icon-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
    }

    .header-decoration {
        display: none;
    }

    .songs-table-wrapper {
        overflow-x: auto;
    }

    .songs-table {
        min-width: 500px;
    }
}

/* ========================================
   Accessibility: Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
