/**
 * TabPad Style Search - CSS
 * Full-screen search overlay with real-time filtering
 * Version: 1.0.0
 */

/* Search Modal Overlay */
.resto-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.resto-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Search Header */
.resto-search-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.resto-search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.resto-search-input-container {
    flex: 1;
    position: relative;
}

.resto-search-input-container i.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #6c757d;
    pointer-events: none;
    z-index: 2;
}

/* Override theme styles with high specificity selector */
.resto-search-overlay .resto-search-header .resto-search-input-wrapper .resto-search-input-container input.resto-search-input,
.resto-search-overlay input.resto-search-input[type="text"],
input.resto-search-input {
    width: 100% !important;
    padding: 18px 20px 18px 60px !important;
    padding-left: 60px !important;
    font-size: 18px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 16px !important;
    outline: none !important;
    transition: all 0.2s ease;
    background: #f8f9fa !important;
    box-sizing: border-box !important;
    text-indent: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 56px !important;
    line-height: normal !important;
}

.resto-search-overlay input.resto-search-input:focus,
input.resto-search-input:focus {
    border-color: #e74c3c !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1) !important;
}

.resto-search-overlay input.resto-search-input::placeholder,
input.resto-search-input::placeholder {
    color: #adb5bd;
    padding-left: 0 !important;
}

.resto-search-close {
    width: 50px;
    height: 50px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6c757d;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.resto-search-close:hover {
    background: #e74c3c;
    color: #fff;
    transform: rotate(90deg);
}

/* Search Stats */
.resto-search-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 15px auto 0;
    padding: 0;
    font-size: 14px;
    color: #6c757d;
}

.resto-search-stats-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resto-search-stats-count i {
    color: #e74c3c;
}

.resto-search-clear {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.resto-search-clear:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Search Results */
.resto-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.resto-search-results-container {
    max-width: 800px;
    margin: 0 auto;
}

/* No Results State */
.resto-search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.resto-search-no-results i {
    font-size: 64px;
    color: #e9ecef;
    margin-bottom: 20px;
    display: block;
}

.resto-search-no-results h3 {
    font-size: 20px;
    color: #495057;
    margin: 0 0 10px;
}

.resto-search-no-results p {
    margin: 0;
    font-size: 15px;
}

/* Empty Search State */
.resto-search-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.resto-search-empty i {
    font-size: 64px;
    color: #e9ecef;
    margin-bottom: 20px;
    display: block;
}

.resto-search-empty h3 {
    font-size: 20px;
    color: #495057;
    margin: 0 0 10px;
}

.resto-search-empty p {
    margin: 0;
    font-size: 15px;
}

/* Search Result Item */
.resto-search-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resto-search-item:hover {
    border-color: #e74c3c;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.1);
    transform: translateY(-2px);
}

.resto-search-item-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f9fa;
}

.resto-search-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resto-search-item-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 24px;
}

.resto-search-item-content {
    flex: 1;
    min-width: 0;
}

.resto-search-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.resto-search-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
}

.resto-search-item-name mark {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 0 2px;
    border-radius: 2px;
}

.resto-search-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #e74c3c;
    white-space: nowrap;
}

.resto-search-item-category {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.resto-search-item-category i {
    font-size: 10px;
}

.resto-search-item-desc {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Keyboard Navigation Highlight */
.resto-search-item.keyboard-focused {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.03);
    outline: none;
}

/* Category Filter Pills */
.resto-search-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 15px auto 0;
    padding: 0;
}

.resto-search-filter-pill {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #6c757d;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.resto-search-filter-pill:hover {
    background: #e9ecef;
}

.resto-search-filter-pill.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .resto-search-header {
        padding: 15px;
    }

    .resto-search-overlay input.resto-search-input,
    input.resto-search-input {
        padding: 15px 15px 15px 50px !important;
        padding-left: 50px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
        min-height: 48px !important;
    }

    .resto-search-input-container i.search-icon {
        left: 15px !important;
        font-size: 18px;
    }

    .resto-search-close {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .resto-search-results {
        padding: 15px;
    }

    .resto-search-item {
        padding: 12px;
        gap: 12px;
    }

    .resto-search-item-image {
        width: 60px;
        height: 60px;
    }

    .resto-search-item-name {
        font-size: 15px;
    }

    .resto-search-item-desc {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }
}

/* Animation for results appearing */
@keyframes searchItemIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resto-search-item {
    animation: searchItemIn 0.2s ease forwards;
}

.resto-search-item:nth-child(2) {
    animation-delay: 0.05s;
}

.resto-search-item:nth-child(3) {
    animation-delay: 0.1s;
}

.resto-search-item:nth-child(4) {
    animation-delay: 0.15s;
}

.resto-search-item:nth-child(5) {
    animation-delay: 0.2s;
}

/* Dark mode support */
.resto-menu.theme-dark .resto-search-overlay {
    background: rgba(30, 30, 30, 0.98);
}

.resto-menu.theme-dark .resto-search-header {
    background: #1e1e1e;
    border-color: #333;
}

.resto-menu.theme-dark .resto-search-input {
    background: #2c2c2c;
    border-color: #444;
    color: #fff;
}

.resto-menu.theme-dark .resto-search-item {
    background: #2c2c2c;
    border-color: #444;
}

.resto-menu.theme-dark .resto-search-item-name {
    color: #fff;
}

.resto-menu.theme-dark .resto-search-item-desc,
.resto-menu.theme-dark .resto-search-item-category {
    color: #adb5bd;
}