/* Search Page Styles */

/* Search Header */
.search-header {
    background-color: var(--primary-light);
    padding: 30px 0;
}

.search-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-container {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-white);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.search-input {
    flex-grow: 1;
}

.search-input input {
    width: 100%;
    padding: 14px 20px;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-btn {
    background-color: var(--success-color);
    color: var(--bg-white);
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: var(--success-hover);
}

/* Main Content */
.search-content {
    padding: 40px 0;
}

.search-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Filter Sidebar */
.filter-sidebar {
    background-color: var(--bg-white);
    border-radius: 5px;
    box-shadow: 0 2px 10px var(--shadow-color);
    overflow: hidden;
    padding-bottom: 20px;
}

.filter-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.back-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--text-medium);
    cursor: pointer;
    padding: 5px;
}

.applied-filters {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
}

.applied-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.applied-header span {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-weight: 500;
}

.clear-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--text-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-medium);
    cursor: pointer;
}

.filter-tag.active {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.filter-tag i {
    font-size: 0.75rem;
}

.filter-group {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
}

.filter-title {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-title:hover {
    background-color: var(--bg-secondary);
}

.filter-title span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

.filter-title i {
    font-size: 0.8rem;
    color: var(--text-light);
    transition: transform 0.3s;
}

.filter-group.active .filter-title i {
    transform: rotate(180deg);
}

.filter-options {
    padding: 0 20px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 6px 12px;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: #e6e6e6;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

/* Search Results */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.results-count {
    font-size: 1rem;
    color: var(--text-medium);
    font-weight: 500;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-options {
    display: flex;
    border: 1px solid var(--border-medium);
    border-radius: 5px;
    overflow: hidden;
}

.view-options button {
    background-color: var(--bg-white);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
}

.view-options button.active {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.sort-options select {
    padding: 8px 15px;
    border: 1px solid var(--border-medium);
    border-radius: 5px;
    font-size: 0.9rem;
    color: var(--text-medium);
    background-color: var(--bg-white);
    outline: none;
    cursor: pointer;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

/* Template Card */
.template-card {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.template-badge {
    position: absolute;
    top: 15px;
    left: 0;
    background-color: var(--tertiary-color);
    color: var(--bg-white);
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 0 3px 3px 0;
    font-weight: 500;
    z-index: 1;
}

.template-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.template-card:hover .template-image img {
    transform: scale(1.05);
}

.template-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.template-header {
    margin-bottom: 15px;
}

.template-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    line-height: 1.4;
}

.template-source {
    font-size: 0.85rem;
    color: var(--text-light);
}

.template-source a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.template-source a:hover {
    text-decoration: underline;
}

.template-features {
    margin-bottom: 20px;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.feature i {
    color: var(--primary-color);
    font-size: 0.8rem;
    margin-right: 8px;
}

.feature span {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.template-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.template-preview {
    flex-grow: 1;
}

.preview-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--bg-secondary);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.preview-btn:hover {
    background-color: #e9e9e9;
}

.template-actions {
    display: flex;
    gap: 8px;
}

.cart-btn, .wishlist-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 5px;
    background-color: var(--bg-secondary);
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.3s;
}

.cart-btn:hover {
    background-color: var(--success-color);
    color: var(--bg-white);
}

.wishlist-btn:hover {
    background-color: var(--danger-color);
    color: var(--bg-white);
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.template-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sales {
    font-size: 0.85rem;
    color: var(--text-light);
}

.rating {
    display: flex;
    align-items: center;
}

.rating i {
    color: #FFD700;
    font-size: 0.9rem;
    margin-right: 2px;
}

.rating span {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-left: 5px;
}

.template-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Responsive Styles */
@media screen and (max-width: 1100px) {
    .search-content .container {
        grid-template-columns: 240px 1fr;
        gap: 20px;
    }
}

@media screen and (max-width: 992px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .search-content .container {
        grid-template-columns: 1fr;
    }
    
    .filter-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        border-radius: 0;
    }
    
    .filter-sidebar.active {
        display: block;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .results-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media screen and (max-width: 576px) {
    .search-header {
        padding: 20px 0;
    }
    
    .template-meta {
        flex-direction: column;
        gap: 15px;
    }
    
    .template-preview {
        width: 100%;
    }
    
    .preview-btn {
        display: block;
        text-align: center;
    }
    
    .template-actions {
        justify-content: flex-end;
    }
    
    .template-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .template-price {
        font-size: 1.4rem;
    }
}
