/**
 * ArtistDB CSS - Styling für den Dialog
 */

/* Dialog-Grundstruktur */
.artistdb-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.artistdb-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.artistdb-dialog-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.artistdb-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.artistdb-dialog-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.artistdb-close-dialog {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.artistdb-close-dialog:hover {
    background: #e9ecef;
    color: #333;
}

/* Dialog Body */
.artistdb-dialog-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Suchbereich - jetzt in linker Spalte */
.artistdb-search-section {
    margin-bottom: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.artistdb-search-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.artistdb-search-section input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 6px;
    transition: border-color 0.2s ease;
}

.artistdb-search-section input[type="text"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.artistdb-search-hint {
    color: #666;
    font-size: 11px;
    font-style: italic;
}

/* Spalten-Layout optimiert für echte 50:50 Aufteilung */
.artistdb-left-column,
.artistdb-right-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0; /* Verhindert Overflow bei langem Text */
    word-wrap: break-word; /* Bricht lange Wörter um */
    box-sizing: border-box;
}

.artistdb-left-column {
    border-right: 1px solid #e9ecef;
    padding-right: 16px;
    background-color: rgba(0, 123, 255, 0.05); /* Temporärer Debug-Hintergrund */
}

.artistdb-right-column {
    padding-left: 16px;
    background-color: rgba(255, 193, 7, 0.05); /* Temporärer Debug-Hintergrund */
}

/* Loading */
.artistdb-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.artistdb-loading p {
    margin: 0;
    font-size: 16px;
}

/* Hauptinhalt - Echtes 50:50 Grid Layout */
.artistdb-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .artistdb-main-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .artistdb-left-column {
        border-right: none;
        padding-right: 0;
        margin-bottom: 16px;
    }
    
    .artistdb-right-column {
        padding-left: 0;
    }
    
    .artistdb-artists-list {
        max-height: 300px;
    }
    
    .artistdb-html-snippet textarea {
        min-height: 150px;
    }
}

/* Künstlerliste - Linke Spalte optimiert */
.artistdb-artists-list {
    max-height: 450px;
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
}

.artistdb-artists-list h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    background: #fff;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
    z-index: 1;
}

.artistdb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.artistdb-artist-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.artistdb-artist-item:last-child {
    border-bottom: none;
}

.artistdb-artist-item:hover {
    background: #f8f9fa;
}

.artistdb-artist-item.artistdb-selected {
    background: #e3f2fd;
    border-left: 4px solid #007cba;
}

.artistdb-artist-item strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.artistdb-artist-item small {
    color: #666;
    font-size: 12px;
}

.artistdb-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.artistdb-search-hint-extended {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    font-size: 14px;
}

/* Künstlerdetails - Rechte Spalte optimiert */
.artistdb-artist-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    position: sticky;
    top: 0;
}

.artistdb-artist-image {
    text-align: center;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.artistdb-artist-image img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.artistdb-no-image {
    color: #666;
    font-style: italic;
    padding: 30px 15px;
    font-size: 14px;
}

/* HTML-Snippet optimiert */
.artistdb-html-snippet {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.artistdb-html-snippet label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.artistdb-html-snippet textarea {
    width: 100%;
    min-height: 180px;
    max-height: 300px;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.3;
    resize: vertical;
    background: #f8f9fa;
    flex: 1;
}

.artistdb-html-snippet textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#artistdb-copy-snippet {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    transition: background-color 0.2s ease;
}

#artistdb-copy-snippet:hover {
    background: #218838;
}

#artistdb-copy-snippet.artistdb-copied {
    background: #17a2b8;
}

/* Body-Klasse für offenen Dialog */
body.artistdb-dialog-open {
    overflow: hidden;
}

/* Responsive Anpassungen */
@media (max-width: 900px) {
    .artistdb-dialog-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .artistdb-dialog-header {
        padding: 16px 20px;
    }
    
    .artistdb-dialog-body {
        padding: 20px;
    }
    
    .artistdb-search-section {
        padding: 16px;
    }
    
    .artistdb-search-section input[type="text"] {
        max-width: 100%;
    }
}

/* Print-Styles ausblenden */
@media print {
    .artistdb-dialog {
        display: none !important;
    }
}

/* WordPress Editor spezifische Styles */
.wp-admin .artistdb-dialog {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wp-admin .artistdb-dialog * {
    box-sizing: border-box;
}

/* Button Styles */
.artistdb-button {
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    margin: 4px;
}

.artistdb-button-primary {
    background: #007cba;
    color: white;
}

.artistdb-button-primary:hover {
    background: #005a87;
}

.artistdb-button-secondary {
    background: #6c757d;
    color: white;
}

.artistdb-button-secondary:hover {
    background: #545b62;
}

.artistdb-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Action Buttons */
.artistdb-action-buttons {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

/* Artist Form Styles */
.artistdb-artist-form {
    padding: 20px;
    background: #fff;
    border-radius: 6px;
}

.artistdb-artist-form h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.artistdb-form-group {
    margin-bottom: 16px;
}

.artistdb-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.artistdb-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.artistdb-form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.artistdb-form-group input:invalid {
    border-color: #dc3545;
}

.artistdb-form-buttons {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

/* Edit Button specific styles */
#artistdb-edit-artist {
    margin-top: 8px;
    margin-left: 8px;
}
