/*
 Theme Name:   GeneratePress Child
 Description:  Mein Child-Theme für GeneratePress
 Author:       Eike Janssen
 Template:     generatepress
 Version:      1.0
*/

/*
==========================================================================
   Global Styles & CSS Variables
==========================================================================
*/
:root {
    --accent-color: #0056b3;
    --available-color: #28a745;
    --not-available-color: #dc3545;
    --border-color: #e0e0e0;
    --background-light: #f9f9f9;
}

#page {
    overflow: visible;
}

.accent-color { 
    color: var(--accent-color); 
}

/*
==========================================================================
   Front Page: Search Box
==========================================================================
*/
body.home .entry-header,
body.home .entry-content {
    text-align: center;
}
.country-search-container { 
    position: relative; 
    max-width: 500px; 
    margin: 30px auto; 
}
#country-search-input { 
    width: 100%; 
    padding: 15px; 
    font-size: 16px; 
    border: 1px solid #ccc; 
    border-radius: 8px; 
}
#country-search-results { 
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0; 
    background: #fff; 
    border: 1px solid #ccc; 
    border-top: none; 
    border-radius: 0 0 8px 8px; 
    z-index: 1000; 
    max-height: 250px; 
    overflow-y: auto; 
    text-align:left; 
}
#country-search-results ul { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
}
#country-search-results li a { 
    display: block; 
    padding: 12px 15px; 
    text-decoration: none; 
    color: #333; 
    border-bottom: 1px solid var(--border-color); 
}
#country-search-results li a:hover { 
    background-color: #f5f5f5; 
}
#country-search-results li:last-child a { 
    border-bottom: none; 
}
#country-search-results p { 
    padding: 12px 15px; 
    margin: 0; 
    color: #777; 
}

/*
==========================================================================
   Country Page: Summary, Filters & Tabs
==========================================================================
*/
.country-summary-box-v2 { 
    background: var(--background-light); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 30px; 
}
.summary-labels { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 10px; 
    font-size: 0.9em; 
    color: #555; 
    flex-wrap: wrap; 
    gap: 5px; 
}
.summary-progress-bar { 
    display: flex; 
    width: 100%; 
    height: 12px; 
    background-color: var(--border-color); 
    border-radius: 6px; 
    overflow: hidden; 
}
.progress-bar-available { 
    background-color: var(--available-color); 
    transition: width 0.5s ease; 
}
.progress-bar-unavailable { 
    background-color: var(--not-available-color); 
    transition: width 0.5s ease; 
}
.service-filter-container { 
    margin-bottom: 20px; 
}
.filter-label { 
    font-weight: bold; 
    margin-bottom: 10px; 
    display: block; 
}
.filter-chips { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}
.service-chip-filter { 
    padding: 8px 16px; 
    border: 1px solid var(--border-color); 
    background-color: #fff; 
    color: #333; 
    border-radius: 20px; 
    cursor: pointer; 
    font-size: 14px; 
    transition: all 0.2s ease-in-out; 
}
.service-chip-filter:hover { 
    background-color: var(--background-light); 
    border-color: #ccc; 
    color: #333; 
}
.service-chip-filter.active { 
    background-color: var(--accent-color); 
    color: #fff; 
    border-color: var(--accent-color); 
}
.feature-tabs { 
    border-bottom: 1px solid var(--border-color); 
    margin-bottom: 30px; 
    display: flex; 
}
.feature-tab-button { 
    padding: 10px 20px; 
    border: none; 
    background: none; 
    cursor: pointer; 
    font-size: 1em; 
    font-weight: 600; 
    color: #555; 
    border-bottom: 3px solid transparent; 
    margin-bottom: -1px; 
    flex: 1; 
    text-align: center; 
}
.feature-tab-button:hover, 
.feature-tab-button:focus { 
    color: var(--accent-color); 
    background-color: transparent; 
}
.feature-tab-button.active { 
    color: var(--accent-color); 
    border-bottom-color: var(--accent-color); 
}
.tab-pane { 
    display: none; 
}
.tab-pane.active { 
    display: block; 
}

/*
==========================================================================
   Feature Page: Two-Column Layout & Metadata Box
==========================================================================
*/
.section-title { 
    margin-top: 40px; 
    margin-bottom: 20px; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
}
.country-list-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-bottom: 30px; 
}
.country-chip { 
    display: inline-block; 
    padding: 8px 15px; 
    background-color: #f0f0f0; 
    border-radius: 8px; 
    text-decoration: none; 
    color: #333; 
    font-size: 14px; 
    transition: background-color 0.2s ease; 
}
.country-chip:hover { 
    background-color: #e0e0e0; 
    color: #000; 
}
.feature-detail-layout { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 40px; 
}
.feature-main-content { 
    flex: 1; 
    min-width: 65%; 
}
.feature-long-description { 
    font-size: 1.1em; 
    line-height: 1.6; 
    margin-bottom: 40px; 
}
.feature-metadata-sidebar { 
    flex-basis: 300px; 
    flex-grow: 1; 
}
.metadata-box { 
    background-color: var(--background-light); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 20px; 
    position: sticky; 
    top: 40px; 
}
.metadata-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
    gap: 10px;
}
.metadata-header .service-chip { 
    margin-bottom: 0; 
}
.metadata-header .feature-label-updated { 
    position: static; 
    margin-top: 5px; 
}
.metadata-section { 
    border-top: 1px solid var(--border-color); 
    padding-top: 15px; 
    margin-top: 15px; 
}
.metadata-title { 
    margin: 0 0 10px 0; 
    font-size: 1em; 
    color: #333; 
}
.metadata-section .restrictions-wrapper { 
    margin-top: 0; 
}
.feature-side-note { 
    font-size: 0.9em; 
    color: #555; 
    line-height: 1.5; 
    margin-top: 10px; 
}
.metadata-footer { 
    font-size: 0.9em; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.metadata-link { 
    display: block; 
    margin-bottom: 10px; 
    font-weight: bold; 
    color: var(--accent-color); 
    text-decoration: none; 
}
.metadata-link:hover { 
    text-decoration: underline; 
}
.last-edited-info { 
    color: #666; 
    margin: 0; 
}

/*
==========================================================================
   Reusable Feature Card (in Grids)
==========================================================================
*/
.features-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px; 
    margin-bottom: 40px; 
}
.feature-card { 
    padding: 20px; 
    padding-bottom: 60px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    background-color: #fff; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
    transition: all 0.3s ease; 
    position: relative; 
}
.feature-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
}
.feature-card-link { 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    z-index: 1; 
}
.feature-card-link:hover { 
    background-color: rgba(0,0,0,0.02); 
}
.feature-label-updated { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    background-color: #ff7272; 
    color: #fff; 
    padding: 3px 8px; 
    border-radius: 8px; 
    font-size: 0.7em; 
    z-index: 2; 
}
.feature-title { 
    font-size: 1.5em; 
    margin: 10px 0; 
}
.feature-description { 
    margin: 5px 0 15px; 
}
.service-chip { 
    display: inline-block; 
    padding: 8px 12px; 
    background-color: #f5f1ec; 
    color: #000; 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: bold; 
    margin-bottom: 15px; 
    transition: background-color 0.3s ease; 
    z-index: 2; 
    position: relative; 
}
.service-chip:hover { 
    background-color: #c9c1b6; 
}
.service-logo-inline { 
    width: 20px; 
    height: 20px; 
    vertical-align: middle; 
    margin-right: 8px; 
    border-radius: 5px; 
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); 
}
.restrictions-wrapper { 
    margin-top: 15px; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}
.restriction-chip { 
    display: inline-flex; 
    align-items: center; 
    font-size: 13px; 
    background: #efefef; 
    padding: 4px 8px; 
    border-radius: 6px; 
}
.restriction-icon { 
    width: 15px; 
    height: 15px; 
    margin-right: 5px; 
}
.feature-note { 
    font-size: 14px; 
    color: #c34444; 
    margin-bottom: 15px; 
    margin-top: 10px; 
}
.feature-note .info-icon { 
    width: 14px; 
    height: 14px; 
    vertical-align: top; 
    margin-right: 5px; 
    fill: #c34444; 
}
.feature-card-footer { 
    position: absolute; 
    bottom: 20px; 
    left: 20px; 
    right: 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 13px; 
    color: #666; 
    z-index: 2; 
}
.feature-source a { 
    color: var(--accent-color); 
    font-size: 14px; 
    text-decoration: none; 
    z-index: 2; 
    position: relative; 
}
.feature-last-edited { 
    text-align: right; 
}
.feature-meta-right { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.report-button { 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none; 
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer; 
    padding: 4px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #666;
    z-index: 2; 
    position: relative; 
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.report-button:hover { 
    background-color: #f5f5f5;
    border-color: #ccc;
    color:#666;
}
.report-button span {
    font-size: 16px; 
    line-height: 1;
}

/*
==========================================================================
   Single Feature Page - Metadata Sidebar
==========================================================================
*/
.meta-footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Hält die Elemente rechtsbündig innerhalb des Containers */
    gap: 10px; /* Fügt einen Abstand zwischen Datum und Button hinzu */
}

.last-edited-info {
    margin: 0; /* Entfernt den Standard-Abstand des P-Tags */
    color: #666;
}

/*
 * ========================================================================
 * Modal: Report Issue (Kombinierte & optimierte Version)
 * ========================================================================
 */

/* --- A) Modal Container & Rahmen (Dein Code, leicht angepasst) --- */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.6); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; 
    opacity: 1; 
    visibility: visible; 
    transition: opacity 0.3s ease, visibility 0.3s ease; 
}

.modal-overlay[hidden] { 
    opacity: 0; 
    visibility: hidden; 
}

.modal-content { 
    background-color: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    max-width: 500px; 
    width: 90%; 
    position: relative; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
}

.modal-header { 
    margin-bottom: 25px; /* Etwas mehr Abstand zum Formular */
    padding-bottom: 15px; 
    border-bottom: 1px solid #e0e0e0; /* Feste Farbe für die Linie */
}

#modal-title { 
    margin: 0; 
    font-size: 1.2em; 
    padding-right: 40px; 
}

.modal-close-button { 
    position: absolute; 
    top: 10px; 
    right: 15px; 
    background: none; 
    border: none; 
    font-size: 2em; 
    cursor: pointer; 
    color: #999; 
    line-height: 1;
    transition: color 0.2s ease;
}

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

/* --- B) NEU: Formular-Styling (Farben & Elemente) --- */

/* Variablen für einfache Farbanpassungen */
:root {
    --modal-primary-color: #0073aa; /* Hauptfarbe für Buttons & Fokus-Ringe */
    --modal-border-color: #ddd;
    --modal-border-focus-color: #0073aa;
    --modal-background-color: #fff;
    --modal-text-color: #333;
    --modal-label-color: #555;
    --modal-button-text-color: #fff;
}

#modal-feature-title {
    color: var(--modal-primary-color);
    font-weight: bold;
}

#report-issue-form .form-group {
    margin-bottom: 1.5em;
}

#report-issue-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5em;
    font-size: 0.9em;
    color: var(--modal-label-color);
}

#report-issue-form select,
#report-issue-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--modal-border-color);
    border-radius: 4px;
    font-size: 1em;
    background-color: #f9f9f9;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-sizing: border-box;
}

#report-issue-form textarea {
    min-height: 100px;
    resize: vertical;
}

#report-issue-form select:focus,
#report-issue-form textarea:focus {
    outline: none;
    border-color: var(--modal-border-focus-color);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/*
 * ========================================
 * Standard Radio-Button Styling (Einfache Version)
 * ========================================
*/

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1em; /* Abstand zwischen den Optionen */
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 10px; /* Abstand zwischen dem Standard-Button und dem Text */
    cursor: pointer;
}
/* Submit Button & Feedback-Nachricht */
#report-issue-form .button {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--modal-button-text-color);
    background-color: var(--modal-primary-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

#report-issue-form .button:hover {
    background-color: #005a87;
}

#report-issue-form .button:active {
    transform: scale(0.99);
}

#report-issue-form .button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

#form-feedback {
    margin-top: 1em;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
}

/*
==========================================================================
   Utility & Plugin Styles
==========================================================================
*/
.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}
.wpcf7-response-output { 
    border-radius: 8px; 
    background-color: #46b450; 
    color: white; 
}
#footer-notice { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 0.4em; 
    padding: 20px 0; 
}
#footer-notice .footer-icon svg { 
    width: 1.2em; 
    height: 1.2em; 
    display: block; 
}

/*
==========================================================================
   Mobile & Tablet Optimizations
==========================================================================
*/
@media screen and (max-width: 1024px) {
    .form-grid { grid-template-columns: 1fr; }
    .service-filter-container { margin-left: -30px; margin-right: -30px; }
    .filter-label { padding-left: 30px; padding-right: 30px; }
    .filter-chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 10px; padding-left: 30px; padding-right: 30px; }
    .service-chip-filter { white-space: nowrap; }
    .filter-chips::-webkit-scrollbar { display: none; }
    .filter-chips { -ms-overflow-style: none; scrollbar-width: none; }
    .feature-tabs { display: flex; }
    .feature-tab-button { white-space: nowrap; }
    .feature-detail-layout { flex-direction: column; }
    .feature-metadata-sidebar { order: -1; }
    .metadata-box { position: static; }
}

/*
 * ========================================================================
 * Modal: Country Search Field
 * ========================================================================
 */
#report-modal-overlay .country-search-container {
    position: relative;
}

#modal-country-search-input{
    width:100%;
}

#modal-country-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
    max-height: 150px;
    overflow-y: auto;
}

.modal-result-item, .modal-result-item-none {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.modal-result-item:last-child {
    border-bottom: none;
}

.modal-result-item:hover {
    background-color: #f5f5f5;
}

.modal-result-item-none {
    cursor: default;
    color: #888;
}