/**
 * Yoda Smart Search - Core Styles
 *
 * Base container styles shared by all widget renderers
 *
 * @package    YodaSearch
 * @author     Yoda
 * @license    GNU General Public License version 3
 */

/* Container */
.yodasearch-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 450px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

/* Close button (for mobile) */
.yodasearch-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    z-index: 10;
}

.yodasearch-close-btn:hover {
    background: #e5e5e5;
    color: #333;
}

/* Scrollbar */
.yodasearch-container::-webkit-scrollbar {
    width: 6px;
}

.yodasearch-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.yodasearch-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.yodasearch-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .yodasearch-container {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-height: 60vh;
    }
}

/* Animation */
@keyframes yodasearch-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.yodasearch-container {
    animation: yodasearch-fade-in 0.15s ease;
}

/* Dark theme support (optional) */
.dark-theme .yodasearch-container,
[data-theme="dark"] .yodasearch-container {
    background: #2d2d2d;
    border-color: #444;
}

.dark-theme .yodasearch-close-btn,
[data-theme="dark"] .yodasearch-close-btn {
    background: #444;
    border-color: #555;
    color: #ccc;
}

/* ==============================================
   Filter Chips Bar - GitHub Style
   (Used on search results page, not in autocomplete)
   ============================================== */
.yoda-filter-chips {
    display: block;
    padding: 8px 0;
    margin-bottom: 8px;
    overflow: hidden;
}

.yoda-chips-count {
    display: block;
    font-size: 12px;
    color: #1f2328;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 8px;
}

.yoda-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.yoda-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.1s ease;
    cursor: pointer;
    background: #f6f8fa;
    color: #1f2328;
    border: 1px solid #d1d9e0;
}

.yoda-chip:hover {
    text-decoration: none;
    background: #eaeef2;
    border-color: #c7cdd3;
}

/* Clear all button */
.yoda-chip-clear {
    background: #f6f8fa;
    color: #656d76;
    border: 1px solid #d1d9e0;
}

.yoda-chip-clear:hover {
    background: #eaeef2;
    color: #1f2328;
    border-color: #c7cdd3;
}

/* Active filter chips - GitHub style */
.yoda-chip-active {
    background: #f6f8fa;
    color: #1f2328;
    border: 1px solid #d1d9e0;
}

.yoda-chip-active:hover {
    background: #eaeef2;
    border-color: #c7cdd3;
}

.yoda-chip-remove {
    margin-left: 6px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #656d76;
}

.yoda-chip-active:hover .yoda-chip-remove {
    color: #1f2328;
}

/* Responsive */
@media (max-width: 768px) {
    .yoda-filter-chips {
        padding: 10px 0;
    }

    .yoda-chips-row {
        gap: 6px;
    }

    .yoda-chip {
        padding: 5px 10px;
        font-size: 12px;
    }

    .yoda-chips-count {
        font-size: 13px;
        white-space: normal;
        margin-bottom: 8px;
    }
}
