/**
 * Live Search Pro v3.0 Styles
 * Multiple layout options: Cards, List, Minimal, Masonry, Bento
 */

/* ============================================== */
/* SEARCH ICON TRIGGER */
/* ============================================== */

.live-search-icon-trigger {
    background: none;
    border: none!important;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.live-search-icon-trigger:hover {
    transform: scale(1);
    background: none!important;
    opacity: 0.8;
}

.live-search-icon-trigger:focus {
    outline: 2px solid #F79B57;
    outline-offset: 4px;
    border-radius: 50%;
}

.live-search-icon-trigger svg {
    display: block;
}

/* ============================================== */
/* SEARCH OVERLAY */
/* ============================================== */

.live-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: auto;
    background: #E7ECF0 !important;
    z-index: 999999;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.live-search-overlay.active {
    transform: translateY(0);
}

.live-search-overlay-content {
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1650px;
    margin: 0 auto;
    padding: 0 40px;
    background: none;
    position: relative;
}

body.live-search-overlay-open {
    overflow: hidden;
}

/* ============================================== */
/* OVERLAY HEADER */
/* ============================================== */

.live-search-overlay-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 60px 0 20px;
    flex-shrink: 0;
    width: 100%;
    background: none;
    position: relative;
    z-index: 2;
}

.live-search-form-wrapper {
    position: relative;
    flex: 1;
    display: block;
}

/* ============================================== */
/* SEARCH INPUT */
/* ============================================== */

.live-search-overlay .live-search-input,
.live-search-input,
.live-search-input-split {
    width: 100% !important;
    padding: 18px 60px 18px 24px !important;
    font-size: 20px !important;
    border: none!important;
    border-radius: 30px!important;
    outline: none !important;
    transition: all 0.3s ease !important;
    background-color: #fff !important;
    font-weight: 500 !important;
    display: block !important;
    box-sizing: border-box !important;
    color: #333 !important;
}

.live-search-overlay .live-search-input:focus,
.live-search-input:focus,
.live-search-input-split:focus {
    border-color: #F79B57 !important;
    box-shadow: none!important;
}

.live-search-overlay .live-search-input::placeholder,
.live-search-input::placeholder,
.live-search-input-split::placeholder {
    color: #999 !important;
    font-weight: 400 !important;
}

/* Clear Button */
.live-search-clear {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: #f3f4f6;
    border: none;
    width: 44px!important;
    height: 44px!important;
    border-radius: 50%!important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    display: flex;
}

.live-search-clear:hover {
    background: #e5e7eb;
    color: #333;
}

.live-search-clear svg {
    width: 16px;
    height: 16px;
}

/* Loader */
.live-search-loader {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(247, 155, 87, 0.3);
    border-radius: 50%;
    border-top-color: #F79B57;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================== */
/* OVERLAY CLOSE BUTTON */
/* ============================================== */

.live-search-overlay-close {
    background: #f3f4f6 !important;
    border: none !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #666 !important;
    flex-shrink: 0 !important;
}

.live-search-overlay-close:hover {
    background: #F79B57 !important;
    color: #fff !important;
}

.live-search-overlay-close svg {
    display: block !important;
}

/* ============================================== */
/* OVERLAY RESULTS AREA */
/* ============================================== */

.live-search-overlay-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.live-search-overlay-results::-webkit-scrollbar {
    width: 8px;
}

.live-search-overlay-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.live-search-overlay-results::-webkit-scrollbar-thumb {
    background: #F79B57;
    border-radius: 4px;
}

/* ============================================== */
/* SPLIT MODE WRAPPERS */
/* ============================================== */

.live-search-input-wrapper {
    position: relative;
    width: 100%;
}

.live-search-results-wrapper {
    position: relative;
    width: 100%;
    margin-top: 20px;
}

/* ============================================== */
/* RESULTS CONTAINER */
/* ============================================== */

.live-search-results {
    position: relative;
    background: transparent;
    border: none;
}

.search-results-header {
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.results-count {
    font-size: 15px;
    color: #666;
    font-weight: 600;
}

/* ============================================== */
/* GAP CONTROL */
/* ============================================== */

.gap-small .search-results-grid {
    gap: 12px;
}

.gap-medium .search-results-grid {
    gap: 24px;
}

.gap-large .search-results-grid {
    gap: 36px;
}

/* ============================================== */
/* COLUMN CONTROL */
/* ============================================== */

.columns-1 .search-results-grid {
    grid-template-columns: 1fr;
}

.columns-2 .search-results-grid {
    grid-template-columns: repeat(2, 1fr);
}

.columns-3 .search-results-grid {
    grid-template-columns: repeat(3, 1fr);
}

.columns-4 .search-results-grid {
    grid-template-columns: repeat(4, 1fr);
}

.columns-5 .search-results-grid {
    grid-template-columns: repeat(5, 1fr);
}

.columns-6 .search-results-grid {
    grid-template-columns: repeat(6, 1fr);
}

.columns-auto .search-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ============================================== */
/* LAYOUT: CARDS (Default) */
/* ============================================== */

.layout-cards .search-results-grid {
    display: grid;
    padding: 0;
}

.layout-cards .search-result-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.layout-cards .search-result-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #F79B57;
}

.layout-cards .result-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.layout-cards .result-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.layout-cards .result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.layout-cards .search-result-item:hover .result-thumbnail img {
    transform: scale(1.08);
}

.layout-cards .result-post-type {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(247, 155, 87, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layout-cards .result-content {
    padding: 16px;
}

.layout-cards .result-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.layout-cards .result-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.layout-cards .result-date {
    font-size: 12px;
    color: #999;
}

/* ============================================== */
/* LAYOUT: LIST (Horizontal) */
/* ============================================== */

.layout-list .search-results-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.layout-list .list-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.layout-list .list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #F79B57;
}

.layout-list .result-link {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
}

.layout-list .result-thumbnail-list {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.layout-list .result-thumbnail-list img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-list .result-content-list {
    flex: 1;
    min-width: 0;
}

.layout-list .result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.layout-list .result-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layout-list .result-post-type-inline {
    background: #F79B57;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.layout-list .result-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.layout-list .result-date {
    font-size: 12px;
    color: #999;
}

/* ============================================== */
/* LAYOUT: MINIMAL */
/* ============================================== */

.layout-minimal .search-results-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layout-minimal .minimal-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.layout-minimal .minimal-item:hover {
    background: #f8f9fa;
    border-color: #F79B57;
}

.layout-minimal .result-link {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
}

.layout-minimal .result-content-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.layout-minimal .result-title {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layout-minimal .result-post-type-minimal {
    background: #f3f4f6;
    color: #666;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ============================================== */
/* LAYOUT: MASONRY */
/* ============================================== */

.layout-masonry .search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 10px;
}

.layout-masonry .masonry-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.layout-masonry .masonry-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #F79B57;
}

.layout-masonry .result-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.layout-masonry .result-thumbnail-masonry {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 150px;
    background-color: #f0f0f0;
}

.layout-masonry .result-thumbnail-masonry img {
    width: 100%;
    height: auto;
    display: block;
}

.layout-masonry .result-post-type {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(247, 155, 87, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.layout-masonry .result-content {
    padding: 16px;
}

.layout-masonry .result-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.4;
}

.layout-masonry .result-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.layout-masonry .result-date {
    font-size: 12px;
    color: #999;
}

/* ============================================== */
/* LAYOUT: BENTO GRID */
/* ============================================== */

.layout-bento .search-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 16px;
}

.layout-bento .bento-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.layout-bento .bento-item:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-6px);
    border-color: #F79B57;
}

/* Bento sizes */
.layout-bento .bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.layout-bento .bento-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.layout-bento .bento-normal {
    grid-column: span 1;
    grid-row: span 1;
}

.layout-bento .result-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.layout-bento .result-thumbnail-bento {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.layout-bento .result-thumbnail-bento img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-bento .result-thumbnail-bento::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.8));
}

.layout-bento .result-post-type {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(247, 155, 87, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.layout-bento .result-content-bento {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 1;
    color: #fff;
}

.layout-bento .bento-large .result-content-bento {
    padding: 30px;
}

.layout-bento .result-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.layout-bento .bento-large .result-title {
    font-size: 24px;
    -webkit-line-clamp: 3;
}

.layout-bento .result-excerpt {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.layout-bento .result-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================== */
/* STYLE: GLASS (Glassmorphism) */
/* ============================================== */

.style-glass .search-result-item {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.style-glass .search-result-item:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================== */
/* STYLE: BRUTALIST */
/* ============================================== */

.style-brutalist .search-result-item {
    border-radius: 0 !important;
    border: 3px solid #000;
    box-shadow: 8px 8px 0 #F79B57;
}

.style-brutalist .search-result-item:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 #F79B57;
}

.style-brutalist .result-thumbnail {
    border-radius: 0 !important;
}

/* ============================================== */
/* STYLE: OUTLINED */
/* ============================================== */

.style-outlined .search-result-item {
    background: transparent;
    border: 2px solid #e0e0e0;
}

.style-outlined .search-result-item:hover {
    border-color: #F79B57;
    background: rgba(247, 155, 87, 0.05);
}

/* ============================================== */
/* NO RESULTS */
/* ============================================== */

.live-search-no-results {
    margin-top: 40px;
    padding: 40px 20px;
    text-align: center;
}

.live-search-no-results p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* ============================================== */
/* RESPONSIVE DESIGN */
/* ============================================== */

@media (max-width: 1024px) {
    .columns-auto .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .layout-bento .search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .live-search-overlay-content {
        padding: 0 20px;
    }
    
    .live-search-overlay-header {
        padding: 20px 0 15px;
        gap: 12px;
    }
    
    .live-search-input,
    .live-search-input-split {
        font-size: 16px !important;
        padding: 14px 50px 14px 16px !important;
    }
    
    .columns-auto .search-results-grid,
    .columns-3 .search-results-grid,
    .columns-4 .search-results-grid,
    .columns-5 .search-results-grid,
    .columns-6 .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .layout-list .result-link {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .layout-list .result-thumbnail-list {
        width: 100%;
        height: 160px;
    }
    
    .layout-bento .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .layout-bento .bento-large {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .live-search-overlay {
        height: 100%;
    }
    
    .columns-auto .search-results-grid,
    .columns-2 .search-results-grid,
    .columns-3 .search-results-grid,
    .columns-4 .search-results-grid,
    .columns-5 .search-results-grid,
    .columns-6 .search-results-grid {
        grid-template-columns: 1fr;
    }
    
    .layout-bento .search-results-grid {
        grid-template-columns: 1fr;
    }
    
    .layout-bento .bento-large,
    .layout-bento .bento-wide {
        grid-column: span 1;
    }
}

/* ============================================== */
/* ACCESSIBILITY */
/* ============================================== */

.result-link:focus {
    outline: 3px solid #F79B57;
    outline-offset: 2px;
}

mark {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}
