/* ============================================
   Allgemeine Styles 
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
    padding-bottom: 60px; /* Platz für festen Footer */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   Header Styles 
   ============================================ */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 10px 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #34495e;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    font-weight: 300;
}

/* ============================================
   Search Box Styles 
   ============================================ */
.search-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 30px;
    margin-bottom: 30px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.search-input:focus {
    outline: none;
    border-color: #6c757d;
    background: white;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.1);
}

.search-button {
    padding: 15px 30px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 54px; /* Feste Höhe hinzugefügt */
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    box-sizing: border-box; /* Wichtig für konsistente Größenberechnung */
}

.search-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.search-button:active {
    transform: translateY(0);
}

.reset-button {
    padding: 14px 15px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 54px; /* Gleiche feste Höhe wie search-button */
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box; /* Wichtig für konsistente Größenberechnung */
    line-height: 1; /* Verhindert zusätzlichen Zeilenabstand bei <a>-Elementen */
}

.reset-button:hover {
    background: #666;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(220, 220, 220, 0.3);
}

.reset-button:active {
    transform: translateY(0);
}

.show-all-button {
	border: none;
	color: white;
	padding: 14px 15px;
	border-radius: 4px;
	font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 54px; /* Gleiche feste Höhe wie search-button */
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box; /* Wichtig für konsistente Größenberechnung */
    line-height: 1; /* Verhindert zusätzlichen Zeilenabstand bei <a>-Elementen */
}

/* ============================================
   Results Info 
   ============================================ */
.results-info {
    margin-bottom: 25px;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.results-info strong {
    color: #2c3e50;
}

/* ============================================
   Result Items 
   ============================================ */
.result-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left-color: #6c757d;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.result-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-title a:hover {
    color: #6c757d;
}

.result-abstract {
    color: #5a6c7d;
    margin-bottom: 12px;
    line-height: 1.6;
}

.result-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #95a5a6;
    border-top: 1px solid #ecf0f1;
    padding-top: 12px;
    flex-wrap: wrap;
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-meta i {
    font-size: 0.85rem;
}

/* Relevanz-Klassen */
.result-item.high-relevance {
    border-left-color: #495057;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.result-item.medium-relevance {
    border-left-color: #6c757d;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.result-item.low-relevance {
    border-left-color: #adb5bd;
}

/* ============================================
   Highlighting 
   ============================================ */
mark {
    background: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    color: #495057;
}

/* ============================================
   Pagination 
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 45px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination a:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

.pagination .current {
    background: #6c757d;
    color: white;
    font-weight: 600;
}

.pagination-dots {
    padding: 10px 5px;
    color: #95a5a6;
}

/* ============================================
   No Results 
   ============================================ */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.no-results i {
    color: #adb5bd;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #7f8c8d;
    font-weight: 400;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.no-results p {
    color: #95a5a6;
}

/* ============================================
   Footer Buttons 
   ============================================ */
.footer-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e9ecef;
    z-index: 100;
}

.footer-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    color: #6c757d;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.footer-button:hover {
    background: #f8f9fa;
    color: #6c757d; /* wird von PHP überschrieben */
    border-color: #dee2e6; /* wird von PHP überschrieben */
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.footer-button i {
    font-size: 0.8rem;
}

/* ============================================
   Modal Styles 
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #495057;
    font-size: 1.4rem;
    font-weight: 500;
}

.close {
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    padding: 5px;
}

.close:hover {
    color: #495057;
}

.modal-body {
    padding: 25px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* ============================================
   Loading & Error States 
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.loading i {
    margin-right: 8px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

.error-message i {
    margin-right: 8px;
}

/* ============================================
   Detail Container Styles (für search_detail.php)
   ============================================ */
.detail-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

.detail-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #6c757d;
}

.detail-header h3 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 1.3rem;
    font-weight: 600;
}

.detail-header .meta-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #6c757d;
}

.detail-header .meta-info span {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-header .meta-info i {
    font-size: 0.85rem;
}

/* INSPIRE Badge */
.inspire-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #c3e6cb;
}

/* XML Link */
.xml-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #6c757d;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.xml-link:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* ============================================
   Section Styles 
   ============================================ */
.section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header i {
    font-size: 1rem;
}

.section-content {
    padding: 20px;
}

/* ============================================
   Field Rows 
   ============================================ */
.field-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    margin-bottom: 15px;
    align-items: start;
}

.field-row:last-child {
    margin-bottom: 0;
}

.field-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
    padding-top: 2px;
}

.field-value {
    color: #2c3e50;
    word-break: break-word;
}

.field-value a {
    color: #6c757d;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.field-value a:hover {
    color: #495057;
}

.field-value a i {
    font-size: 0.85rem;
}

.empty {
    color: #adb5bd;
    font-style: italic;
}

/* ============================================
   Special Grid Layouts 
   ============================================ */
.bbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.bbox-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.bbox-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
}

.bbox-value {
    font-family: 'Monaco', 'Menlo', monospace;
    color: #495057;
    font-size: 0.9rem;
}

.date-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
}

.date-value {
    color: #495057;
    font-size: 0.95rem;
}

.quality-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.quality-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.quality-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
}

.quality-value {
    color: #495057;
    font-size: 0.9rem;
}

/* ============================================
   Specification Table 
   ============================================ */
.spec-table {
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.spec-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    border-bottom: 1px solid #e9ecef;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    background: #e9ecef;
    padding: 12px 15px;
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
    border-right: 1px solid #dee2e6;
}

.spec-value {
    padding: 12px 15px;
    background: white;
    color: #495057;
}

/* ============================================
   License Display 
   ============================================ */
.license-display {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.license-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.license-link:hover {
    color: #495057;
}

.license-link i {
    font-size: 0.85rem;
}

.license-symbols {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* ============================================
   Responsive Design 
   ============================================ */
/* Korrigierte Mobile Styles - zu ersetzen in der @media (max-width: 768px) Sektion */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    body {
        padding-bottom: 50px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 15px; /* Einheitlicher Abstand zwischen allen Elementen */
    }
    
    /* Alle Form-Elemente auf gleiche Breite setzen */
    .search-input,
    .search-button,
    .reset-button,
    .show-all-button {
        width: 100%;
        box-sizing: border-box; /* Wichtig für korrekte Breiten-Berechnung */
    }
    
    /* Spezifische Anpassungen für die Buttons */
    .search-button,
    .reset-button,
    .show-all-button {
        min-width: unset; /* Original min-width überschreiben */
        margin-left: 0; /* Eventuellen Margin zurücksetzen */
    }
    
    .result-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .field-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .bbox-grid,
    .date-range,
    .quality-grid {
        grid-template-columns: 1fr;
    }
    
    .spec-row {
        grid-template-columns: 1fr;
    }
    
    .spec-label {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .detail-header .meta-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination a, .pagination span {
        padding: 8px 12px;
        min-width: 40px;
        font-size: 0.9rem;
    }
    
    .footer-buttons {
        gap: 10px;
        padding: 8px 15px;
    }
    
    .footer-button {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .footer-button i {
        font-size: 0.75rem;
    }
}

/* ============================================
   Utility Classes 
   ============================================ */
.text-muted {
    color: #6c757d;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* ============================================
   Print Styles 
   ============================================ */
@media print {
    body {
        background: white;
        padding-bottom: 0;
    }
    
    .search-box,
    .pagination,
    .modal,
    .xml-link,
    .footer-buttons {
        display: none;
    }
    
    .result-item,
    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .detail-header {
        background: white;
        border: 1px solid #dee2e6;
    }
}