/* Custom styles for Rekax documentation */

/* Version-specific content */
.version-content {
    display: none;
}

.version-content[data-version='v2'] {
    display: block;
}

/* Search Results Modal */
.search-results-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.search-results-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.search-results-header h3 {
    margin: 0;
    color: #5d6778;
}

.close-search-results {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5d6778;
}

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-results-list li {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.search-results-list li:last-child {
    border-bottom: none;
}

.search-results-list a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.search-results-list h4 {
    margin: 0 0 5px 0;
    color: #5d6778;
}

.search-results-list p {
    margin: 0;
    color: #7b8698;
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    color: #7b8698;
    font-style: italic;
}

/* Version Selector */
.version-selector {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 15px;
}

.version-selector select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #5d6778;
    background-color: #fff;
    color: #5d6778;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.version-selector select:hover, .version-selector select:focus {
    border-color: #15a362;
    outline: none;
    box-shadow: 0 0 0 2px rgba(21, 163, 98, 0.25);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-results-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .version-selector {
        margin-right: 10px;
    }
}

/* Highlight search matches */
.search-highlight {
    background-color: rgba(255, 230, 0, 0.4);
    padding: 0 2px;
    border-radius: 2px;
}

/* Autocomplete suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #e7e9ed;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestions-list li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background-color: #f8f9fa;
    color: #15a362;
}

/* Make search form relative for autocomplete positioning */
.search-form {
    position: relative;
}

/* Version-specific styling */
body.version-1 {
    --version-color: #4a6fdc;
}

body.version-2 {
    --version-color: #15a362;
}

.version-1 .theme-bg-dark {
    background: linear-gradient(to right, #4a6fdc, #6384e4);
}

.version-2 .theme-bg-dark {
    background: linear-gradient(to right, #15a362, #28b678);
}

/* Version-specific content */
.v1-only {
    display: none;
}

.v2-only {
    display: block;
}

body.version-1 .v1-only {
    display: block;
}

body.version-1 .v2-only {
    display: none;
}

body.version-2 .v1-only {
    display: none;
}

body.version-2 .v2-only {
    display: block;
}
