/* Erweiterte Suche Styles */

/* Verhindere horizontales Scrollen auf der gesamten Seite */
/* WICHTIG: overflow-x auf html/body kann sticky positioning brechen */
/* Verwende nur auf Container-Elementen, nicht auf html/body */
.main-container,
.results-container {
    overflow-x: hidden;
}

body {
    max-width: 100%;
}

.main-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

/* Linke Seite - Filter */
.filter-sidebar {
    flex: 0 0 300px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    height: fit-content;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.umkreis-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.umkreis-row input[type="text"] {
    flex: 1;
}

.umkreis-row select {
    width: 100px;
}

/* Autocomplete Wrapper */
.autocomplete-wrapper {
    position: relative;
    flex: 1;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.autocomplete-item:hover {
    background-color: #fff3ed;
    color: #ff6b35;
    padding-left: 20px;
}

.autocomplete-item.selected {
    background-color: #ff6b35;
    color: white;
}

.autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

/* Scrollbar styling für Autocomplete */
.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 0 8px 0;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Rechte Seite - Ergebnisse */
.results-container {
    flex: 1;
    min-width: 0; /* Wichtig für Flexbox overflow */
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.result-count {
    font-size: 1.1rem;
    color: #666;
    flex: 1;
}

.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Verhindere, dass die Tabelle die Mindestbreite unterschreitet */
.table-container table {
    min-width: 900px;
    width: 100%;
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar {
    height: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.search-button {
    background: #ff6b35;
    border: none;
    color: white;
    padding: 10px 30px;
    border-radius: 5px;
    width: 100%;
    font-weight: 600;
}

.search-button:hover {
    background: #e55a2b;
    color: white;
}

.reset-button {
    padding: 10px 30px;
    border-radius: 5px;
    width: 100%;
    font-weight: 600;
    border-color: #ddd;
}

.reset-button:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-buttons button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    font-size: 0.9rem;
}

.export-buttons button.export-unavailable {
    cursor: not-allowed;
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.export-buttons button.export-unavailable:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: #fff !important;
}

/* Milchglas-Effekt für Tabelle */
.table-blur-overlay {
    position: relative;
}

/* Kleinere Schrift für die Tabelle */
.table-blur-overlay table {
    font-size: 0.85rem;
}

.table-blur-overlay table td {
    padding: 0.5rem;
    line-height: 1.3;
}

.table-blur-overlay table th {
    font-size: 0.9rem;
    padding: 0.6rem 0.5rem;
}

/* Blur-Effekt nur auf tbody anwenden */
.table-blur-overlay tbody {
    position: relative;
    /* Verhindere Textauswahl */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.table-blur-overlay tbody::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1;
    pointer-events: none;
}

/* Zusätzlicher Schutz für alle Zellen im tbody */
.table-blur-overlay tbody td {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}

/* Dynamische Tabellenspalten */
#preview-table {
    table-layout: auto;
}

/* Mindesthöhe für leere Tabelle */
.table-responsive {
    min-height: 450px;
    position: relative;
}

#preview-table th,
#preview-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

#preview-table td:first-child {
    font-weight: bold;
    max-width: 250px;
}

/* Responsive Tabelle */
@media (max-width: 1200px) {
    #preview-table {
        font-size: 0.9rem;
    }
    
    #preview-table th,
    #preview-table td {
        padding: 0.5rem;
        max-width: 150px;
    }
}

/* Thead bleibt sichtbar */
.table-blur-overlay thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

/* Stelle sicher, dass die Unlock-Nachricht über dem scrollbaren Bereich schwebt */
.table-container {
    position: relative;
    min-height: 200px;
}

.unlock-message {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 0.85rem;
}

.unlock-message h5 {
    color: #ff6b35;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.unlock-message p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.data-selection {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.data-selection h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.data-fields {
    margin-bottom: 20px;
}

.data-fields-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 12px;
}

.data-field-option {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 calc(25% - 15px);
    min-width: 140px;
}

.data-field-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.data-field-option label {
    cursor: pointer;
    margin: 0;
}

.purchase-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1.1rem;
}

.purchase-button:hover {
    background: #218838;
    color: white;
}

/* Datenzeilen-Anzeige */
.data-count-info {
    background: #e8f4fd;
    border: 1px solid #bee5ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-count-info strong {
    color: #ff6b35;
    font-size: 1.2rem;
}

/* Warenkorb */
.shopping-cart {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    border: 2px dashed #dee2e6;
}

.shopping-cart h5 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shopping-cart h5 i {
    color: #ff6b35;
}

.cart-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-info {
    font-size: 0.9rem;
    color: #666;
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #28a745;
}

.cart-item-remove {
    color: #dc3545;
    cursor: pointer;
    margin-left: 15px;
}

.cart-empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

.cart-total {
    border-top: 2px solid #dee2e6;
    margin-top: 20px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total-label {
    font-size: 1.2rem;
    font-weight: 600;
}

.cart-total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b35;
}

.cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cart-actions button {
    flex: 1;
}

/* Animationen */
.shopping-cart.highlight {
    animation: pulse 1.5s ease-in-out;
}

@keyframes pulse {
    0% { border-color: #dee2e6; }
    50% { border-color: #ff6b35; box-shadow: 0 0 20px rgba(255, 107, 53, 0.3); }
    100% { border-color: #dee2e6; }
}

/* Preis-Highlight */
.price-highlight {
    color: #28a745;
}

/* Tabellen-Spaltenbreiten */
.table-blur-overlay th:nth-child(1) { width: 18%; } /* Firma */
.table-blur-overlay th:nth-child(2) { width: 18%; } /* Post */
.table-blur-overlay th:nth-child(3) { width: 12%; } /* Telefon */
.table-blur-overlay th:nth-child(4) { width: 12%; } /* E-Mail */
.table-blur-overlay th:nth-child(5) { width: 10%; } /* Webseite */
.table-blur-overlay th:nth-child(6) { width: 12%; } /* Ansprechpartner */
.table-blur-overlay th:nth-child(7) { width: 9%; } /* Mitarbeiter */
.table-blur-overlay th:nth-child(8) { width: 9%; } /* Umsatz */

/* Unlock-Message Footer Info */
.unlock-message-footer {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

/* Warenkorb Empty Icon */
.cart-empty-icon {
    font-size: 3rem;
    color: #ddd;
}

/* Initially hidden elements */
.initially-hidden {
    display: none;
}

/* No Filter Message */
.no-filter-message {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 10px;
    padding: 20px 30px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.no-filter-message strong {
    color: #856404;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.no-filter-message i {
    font-size: 1.5rem;
    color: #f39c12;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .filter-sidebar {
        flex: none;
        width: 100%;
    }
}

/* Export Button Tooltip */
.export-tooltip {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.875rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    text-align: center;
    pointer-events: none;
    animation: tooltipFadeIn 0.3s ease-out;
}

.export-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff;
}

.export-tooltip::before {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #ddd;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Zahlungsmethoden Info */
.payment-methods-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.payment-methods-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.payment-icon {
    height: 24px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.payment-icon:hover {
    opacity: 1;
}

.payment-icon-bi {
    font-size: 24px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.payment-icon-bi:hover {
    opacity: 1;
}

/* iDEAL prominente Darstellung */
.payment-method-group {
    position: relative;
    display: inline-block;
}

.payment-icon-ideal {
    height: 30px !important;
}

.ideal-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b35;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
}
