/**
 * POPBÜRO Neckar-Alb - Musik-Embed Styles
 * Farbschema: #0F6148 (Primary), #0d5139 (Primary Dark)
 */

/* ==================== Embed Wrapper ==================== */

.music-embed-wrapper {
    position: relative;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    transition: border-color 0.3s ease;
}

.music-embed-wrapper:hover {
    border-color: #0F6148;
}

/* ==================== Consent Overlay ==================== */

.embed-consent-overlay {
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
    padding: 3rem 2rem;
    text-align: center;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.consent-box {
    max-width: 500px;
    margin: 0 auto;
}

.platform-icon-wrapper {
    margin-bottom: 1.5rem;
}

.platform-icon {
    width: 64px;
    height: 64px;
    color: #0F6148;
    margin: 0 auto;
    display: block;
}

.consent-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F6148;
    margin-bottom: 1rem;
}

.consent-description {
    color: #065f46;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.btn-load-embed {
    background: #0F6148;
    color: #ffffff;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(15, 97, 72, 0.2);
}

.btn-load-embed:hover {
    background: #0d5139;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(15, 97, 72, 0.3);
}

.btn-load-embed:active {
    transform: translateY(0);
}

.consent-remember {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #065f46;
    cursor: pointer;
}

.consent-remember input[type="checkbox"] {
    cursor: pointer;
}

.consent-remember input[type="checkbox"]:checked {
    accent-color: #0F6148;
}

.privacy-link {
    display: inline-block;
    margin-top: 1rem;
    color: #0F6148;
    text-decoration: underline;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.privacy-link:hover {
    color: #0d5139;
}

/* ==================== Embed Container ==================== */

.embed-container {
    position: relative;
    width: 100%;
    background: #ffffff;
}

.embed-container iframe {
    width: 100%;
    border: none;
    display: block;
}

/* Spotify: 380px */
.music-embed-wrapper[data-platform="spotify"] .embed-container iframe {
    height: 380px;
}

/* Soundcloud: 450px */
.music-embed-wrapper[data-platform="soundcloud"] .embed-container iframe {
    height: 450px;
}

/* YouTube: 380px (Playlist) */
.music-embed-wrapper[data-platform="youtube"] .embed-container iframe {
    height: 380px;
}

/* Bandcamp: Variable (auto-height vom oEmbed) */
.music-embed-wrapper[data-platform="bandcamp"] .embed-container {
    min-height: 400px;
}

.music-embed-wrapper[data-platform="bandcamp"] .embed-container iframe {
    min-height: 400px;
}

/* Loading State */
.embed-container.loading {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0fdf4;
}

.embed-container.loading::after {
    content: "Wird geladen...";
    color: #0F6148;
    font-weight: 600;
}

/* ==================== Platform Links (Bandcamp/YouTube) ==================== */

.music-link-wrapper {
    margin: 2rem 0;
}

.music-platform-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 32px;
    background: #f0fdf4;
    border: 2px solid #0F6148;
    border-radius: 12px;
    color: #0F6148;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(15, 97, 72, 0.1);
}

.music-platform-link:hover {
    background: #d1fae5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(15, 97, 72, 0.2);
}

.music-platform-link:active {
    transform: translateY(0);
}

.music-platform-link .platform-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.music-platform-link .link-text {
    flex: 1;
}

.music-platform-link .external-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* Platform-spezifische Farben für Links */
.music-platform-link.bandcamp {
    border-color: #0F6148;
    color: #0F6148;
}

.music-platform-link.bandcamp:hover {
    background: #d1fae5;
}

.music-platform-link.youtube {
    border-color: #0F6148;
    color: #0F6148;
}

.music-platform-link.youtube:hover {
    background: #d1fae5;
}

/* ==================== Edit-Formular Styles ==================== */

.platform-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.platform-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.platform-option:hover {
    border-color: #0F6148;
    background: #f0fdf4;
}

.platform-option input[type="radio"] {
    cursor: pointer;
    accent-color: #0F6148;
}

.platform-option input[type="radio"]:checked {
    accent-color: #0F6148;
}

.platform-option.selected {
    border-color: #0F6148;
    background: #d1fae5;
}

.platform-option img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.platform-option span {
    font-weight: 500;
    color: #1f2937;
}

/* URL Input Bereich */
#music-url-input {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

#music-url-input .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    margin-bottom: 1rem;
}

#music-url-input .form-input:focus {
    outline: none;
    border-color: #0F6148;
    background: #ffffff;
}

.url-hints {
    margin-bottom: 1rem;
}

.url-hints small {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.btn-secondary {
    background: #ffffff;
    color: #0F6148;
    padding: 10px 20px;
    border: 2px solid #0F6148;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f0fdf4;
}

/* Preview Bereich */
#embed-preview {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border-radius: 8px;
    border: 2px solid #0F6148;
}

#embed-preview h4 {
    color: #0F6148;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ==================== Responsive Design ==================== */

@media (max-width: 768px) {
    .embed-consent-overlay {
        padding: 2rem 1rem;
        min-height: 300px;
    }
    
    .platform-icon {
        width: 48px;
        height: 48px;
    }
    
    .consent-title {
        font-size: 1.25rem;
    }
    
    .consent-description {
        font-size: 0.9rem;
    }
    
    .btn-load-embed {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .platform-select {
        grid-template-columns: 1fr;
    }
    
    .music-platform-link {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .music-embed-wrapper {
        margin: 1.5rem 0;
    }
    
    .embed-consent-overlay {
        padding: 1.5rem 1rem;
    }
    
    .platform-icon {
        width: 40px;
        height: 40px;
    }
    
    .consent-title {
        font-size: 1.1rem;
    }
    
    .btn-load-embed {
        width: 100%;
    }
    
    .music-platform-link .link-text {
        font-size: 0.9rem;
    }
}

/* ==================== Accessibility ==================== */

.btn-load-embed:focus,
.music-platform-link:focus,
.platform-option:focus-within {
    outline: 2px solid #0F6148;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .music-embed-wrapper {
        border-width: 3px;
    }
    
    .btn-load-embed,
    .music-platform-link {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .music-embed-wrapper,
    .btn-load-embed,
    .music-platform-link,
    .platform-option {
        transition: none;
    }
}
