.ecs-search-container {
    position: relative !important;
    max-width: 600px;
    width: 100% !important;
    margin: 0 auto 20px;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    z-index: 999998 !important; /* High z-index for container */
}

.ecs-search-input-wrapper {
    position: relative !important;
    z-index: 999998 !important; /* High z-index for wrapper */
    display: flex !important;
    align-items: center !important;
    gap: 2px !important; /* Small gap to separate input from button */
}

.ecs-search-input {
    flex: 1 !important;
    padding: 12px 15px !important;
    border: 2px solid #ff6b35 !important; /* Orange border */
    border-radius: 6px !important; /* Fully rounded corners */
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    background-color: #fff !important;
    color: #333 !important;
}

.ecs-search-button {
    padding: 12px 15px !important;
    border: 1px solid white !important; /* Thinner white border around button */
    border-radius: 6px !important; /* Fully rounded corners */
    background-color: #ff6b35 !important; /* Orange background */
    color: white !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    min-height: 52px !important; /* Match input height */
    box-shadow: 0 0 0 2px #ff6b35 !important; /* Orange outer border */
}

.ecs-search-icon {
    width: 20px !important;
    height: 20px !important;
    stroke: white !important;
    stroke-width: 2 !important;
}

.ecs-search-input:focus {
    outline: none !important;
    border-color: #e55a2b !important; /* Darker orange on focus */
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2) !important; /* Orange glow */
    background-color: white !important;
}

.ecs-search-button:hover {
    background-color: #e55a2b !important; /* Darker orange on hover */
    border: 1px solid white !important; /* Keep thin white border */
    box-shadow: 0 0 0 2px #e55a2b !important; /* Darker orange outer border */
    transform: translateY(-1px) !important;
}

.ecs-search-button:active {
    background-color: #d14d21 !important; /* Even darker orange when clicked */
    border: 1px solid white !important; /* Keep thin white border */
    box-shadow: 0 0 0 2px #d14d21 !important; /* Even darker orange outer border */
    transform: translateY(0) !important;
}

/* Focus state for the entire wrapper */
.ecs-search-input-wrapper:focus-within .ecs-search-button {
    border: 1px solid white !important; /* Keep thin white border */
    box-shadow: 0 0 0 2px #e55a2b !important; /* Darker orange outer border */
    background-color: #e55a2b !important;
}

/* Preview Results Styling */
.ecs-search-results {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-top: none !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    z-index: 999999 !important; /* EXTREME z-index to force always on top */
    display: none; /* Hidden by default */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important; /* Strong shadow for visibility */
    border-radius: 0 0 6px 6px !important;
}

.ecs-search-results.active {
    display: block !important; /* Show when active */
    z-index: 999999 !important; /* Force z-index even when active */
    position: absolute !important; /* Force position even when active */
    isolation: isolate !important; /* Create isolated stacking context */
}

/* WICHTIG: Verstecken hat höhere Priorität als active */
.ecs-search-results.active[style*="display: none"] {
    display: none !important;
}

.ecs-search-results[style*="display: none"] {
    display: none !important;
}

/* NUKLEAR-OPTION: Überschreibt ALLE anderen z-index Werte */
body .ecs-search-container .ecs-search-input-wrapper .ecs-search-results,
html body .ecs-search-container .ecs-search-input-wrapper .ecs-search-results,
.ecs-search-container .ecs-search-input-wrapper .ecs-search-results {
    z-index: 2147483647 !important; /* Maximum possible z-index value */
    position: absolute !important;
    isolation: isolate !important;
    background: white !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
}

/* Force stacking context on parent containers */
.ecs-search-container,
.ecs-search-input-wrapper {
    isolation: isolate !important;
    transform: translateZ(0) !important; /* Force hardware acceleration and new stacking context */
}

.ecs-search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.ecs-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.ecs-search-results-list {
    padding: 0;
}

.ecs-search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    font-size: 14px;
}

.ecs-search-result-item:last-child {
    border-bottom: none;
}

.ecs-search-result-item:hover {
    background-color: #f8f9fa;
    color: #0073aa;
}

.ecs-search-result-item:active {
    background-color: #e9ecef;
}

/* Results Container Styling */
.ecs-results-container {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1 !important; /* LOW z-index so autocompletion can appear above */
    position: relative !important; /* Ensure z-index works */
}

.ecs-results-content {
    width: 100%;
}

.ecs-full-result-item {
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border-radius: 4px;
}

.ecs-full-result-item:last-child {
    margin-bottom: 0;
}

.ecs-result-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.ecs-result-table th {
    text-align: left;
    padding: 12px 15px;
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.ecs-result-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
    line-height: 1.4;
}

.ecs-result-table tr:last-child td {
    border-bottom: none;
}

.ecs-result-table tr:hover {
    background-color: #f8f9fa;
}

.ecs-search-result-item .result-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.ecs-search-result-item .result-details {
    font-size: 0.9em;
    color: #666;
}

.ecs-search-result-item .result-detail {
    margin-top: 3px;
}

.ecs-search-result-item .result-detail:first-child {
    margin-top: 0;
}

.ecs-error {
    color: #dc3545;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ecs-search-container {
        max-width: 100%;
        margin: 0 auto 15px;
    }
    
    .ecs-search-input-wrapper {
        flex-direction: row !important; /* Keep horizontal layout on mobile */
    }
    
    .ecs-search-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 10px 12px !important;
    }
    
    .ecs-search-button {
        padding: 10px 12px !important;
        min-height: 48px !important; /* Match mobile input height */
        border: 1px solid white !important; /* Thin white border on mobile */
        box-shadow: 0 0 0 2px #ff6b35 !important; /* Keep orange outer border */
    }
    
    .ecs-search-icon {
        width: 18px !important;
        height: 18px !important;
    }
    
    .ecs-result-table {
        font-size: 12px;
    }
    
    .ecs-result-table th,
    .ecs-result-table td {
        padding: 8px 10px;
    }
    
    .ecs-results-container {
        padding: 15px;
        margin-top: 15px;
    }
} 

/* Pagination Styles */
.ecs-pagination {
    margin: 20px 0;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.ecs-pagination-info {
    margin-right: 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.ecs-pagination-btn {
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
    font-weight: 500;
}

.ecs-pagination-btn:hover {
    background: #f5f5f5;
    border-color: #999;
    transform: translateY(-1px);
}

.ecs-pagination-btn.active {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
    font-weight: bold;
}

.ecs-pagination-btn.active:hover {
    background: #005a87;
    border-color: #005a87;
}

.ecs-pagination-dots {
    padding: 8px 4px;
    color: #999;
    font-size: 14px;
    font-weight: bold;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .ecs-pagination {
        flex-direction: column;
        gap: 10px;
        padding: 15px 10px;
    }
    
    .ecs-pagination-info {
        margin-right: 0;
        margin-bottom: 10px;
        font-size: 13px;
    }
    
    .ecs-pagination-btn {
        padding: 10px 14px;
        min-width: 44px;
        font-size: 13px;
    }
} 

