/* Search Page Styles - Matching Homepage Design System */

.top-header {
    display: none !important;
}

/* Account for fixed navigation */
main {
    padding-top: 8rem;
}

@media (min-width: 1024px) {
    main {
        padding-top: 9rem;
    }
}

.first-container {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    text-align: center;
}

.first-container p {
    margin: 0;
    font-size: 0.875rem;
    color: #374151;
}

.first-container a {
    color: #2563eb;
    text-decoration: none;
}

.first-container a:hover {
    color: #1d4ed8;
}

/* Search Container */
.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.shop-note {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #374151;
}

.shop-note a {
    color: #2563eb;
    text-decoration: none;
}

.shop-note a:hover {
    color: #1d4ed8;
}

/* Search Bar - Enhanced, prominent styling */
.search-container .search-box {
    position: relative;
    margin-bottom: 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.search-container .search-box:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.search-container #customSearchInput {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.25rem;
    border: none;
    background: transparent;
    font-size: 1.0625rem;
    color: #111827;
    outline: none;
    line-height: 1.5;
    box-shadow: none;
    max-width: 100%;
    font-weight: 400;
}

.search-container #customSearchInput:focus {
    box-shadow: none;
    border-color: transparent;
}

.search-container #customSearchInput::placeholder {
    color: #9ca3af;
}

.search-container .search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    width: 22px;
    height: 22px;
    pointer-events: none;
    flex-shrink: 0;
    z-index: 1;
}

.custom-loading-indicator {
    display: none;
    text-align: center;
    padding: 1rem;
    color: #374151;
    font-size: 0.875rem;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

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

/* Search Filters */
.search-filters {
    margin: 0.75rem 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.filters-label {
    display: none;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover:not(.active) {
    border-color: #2563eb;
    background: #f3f4f6;
    color: #374151;
    transform: scale(1.02);
}

.filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
}

.filter-btn.active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
    transform: scale(1.01);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Results - Google-like styling */
#customResultsContainer {
    margin-top: 1.25rem;
}

.results-category-section {
    margin-bottom: 1.75rem;
}

.results-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.results-category-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.results-category-count {
    font-size: 0.8125rem;
    color: #6b7280;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Result items - polished with proper spacing */
.custom-result-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.custom-result-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.custom-result-item.result-item-guide {
    border-left: 3px solid #2563eb;
}

.result-header {
    display: block;
}

.result-icon {
    display: none;
}

.result-content {
    width: 100%;
}

.result-meta {
    display: block;
    margin-bottom: 0.375rem;
}

.result-category {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6b7280;
    text-transform: none;
    letter-spacing: 0;
}

.result-url {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.1875rem;
    display: block;
}

.difficulty-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.difficulty-beginner {
    background: #f3f4f6;
    color: #374151;
}

.difficulty-intermediate {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-advanced {
    background: #fee2e2;
    color: #991b1b;
}

.guide-category-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 500;
    background: #eff6ff;
    color: #1e40af;
    text-transform: uppercase;
}

/* Title - matching homepage styles */
.result-content h3 {
    margin: 0 0 0.375rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

.result-content h3 a {
    color: #111827;
    text-decoration: none;
}

.result-content h3 a:hover {
    color: #2563eb;
}

/* Snippet - matching homepage text colors */
.result-content p {
    margin: 0;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 48em;
}

.result-content mark {
    background: #fef3c7;
    color: #111827;
    padding: 0;
    font-weight: 600;
}

.search-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.search-no-results p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.search-no-results a {
    color: #2563eb;
    text-decoration: none;
}

.search-no-results a:hover {
    color: #1d4ed8;
}

/* Placeholder */
.search-placeholder {
    padding: 1rem 0;
}

.placeholder-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.placeholder-header h3 {
    color: #111827;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.placeholder-header p {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* Quick Links - Grouped Sections */
.quick-links-section {
    margin-bottom: 2rem;
}

.quick-links-section:last-child {
    margin-bottom: 1.5rem;
}

.quick-links-section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.quick-links-section-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-links-section-header h4 .section-icon {
    color: #2563eb;
    font-size: 0.875rem;
}

.quick-links-section-header p {
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.4;
    margin: 0;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    margin-bottom: 0;
}

/* Quick Link Card - Enhanced to match homepage service-card pattern */
.quick-link-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.125rem;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.quick-link-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

/* Icon box - matches homepage service-icon pattern */
.quick-link-icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    background: linear-gradient(to bottom right, #dbeafe, #eff6ff);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 1.125rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.quick-link-card:hover .quick-link-icon {
    background: linear-gradient(to bottom right, #bfdbfe, #dbeafe);
}

.quick-link-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
}

.quick-link-content h4 a {
    color: #111827;
    text-decoration: none;
}

.quick-link-card:hover .quick-link-content h4 a {
    color: #2563eb;
}

.quick-link-content p {
    margin: 0;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Badge for highlighting popular items */
.quick-link-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(to bottom right, #2563eb, #1d4ed8);
    color: #ffffff;
    padding: 0.1875rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.placeholder-footer {
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
}

.placeholder-footer p {
    margin: 0;
    color: #374151;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.placeholder-footer a {
    color: #2563eb;
    text-decoration: none;
}

.placeholder-footer a:hover {
    color: #1d4ed8;
}

main + br {
    display: none !important;
}

/* Mobile */
@media (max-width: 768px) {
    main {
        padding-top: 7rem;
    }
    
    .search-container {
        padding: 0 0.75rem;
    }
    
    .first-container {
        padding: 0.5rem 0;
    }
    
    .first-container p {
        font-size: 0.8125rem;
    }
    
    .shop-note {
        margin-top: 2rem;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .search-container .search-box {
        margin-bottom: 1.25rem;
        border-radius: 9999px;
        border-width: 1px;
    }

    .search-container #customSearchInput {
        padding: 0.875rem 2.75rem 0.875rem 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .search-container .search-icon {
        right: 0.875rem;
        width: 18px;
        height: 18px;
    }

    .search-filters {
        margin: 0.625rem 0 0.375rem 0;
        padding-bottom: 0.375rem;
    }

    .filter-btn {
        padding: 0.3125rem 0.625rem;
        font-size: 0.75rem;
    }

    .filter-btn:hover:not(.active) {
        transform: scale(1.01);
    }

    .filter-btn.active:hover {
        transform: scale(1.01);
    }

    .results-category-section {
        margin-bottom: 1.5rem;
    }

    .results-category-header {
        margin-bottom: 0.5rem;
        padding-bottom: 0.375rem;
    }

    .results-category-title {
        font-size: 1rem;
    }

    .custom-result-item {
        padding: 0.75rem 0.875rem;
        margin-bottom: 0.625rem;
    }

    .result-content h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .result-content p {
        font-size: 0.8125rem;
    }

    .quick-links-section {
        margin-bottom: 1.5rem;
    }

    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .quick-link-card {
        padding: 0.875rem;
    }

    .quick-link-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .quick-links-section-header h4 {
        font-size: 0.9375rem;
    }

    .placeholder-header h3 {
        font-size: 1.125rem;
    }

    .placeholder-header p {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    main {
        padding-top: 6.5rem;
    }
    
    .search-container {
        padding: 0 0.5rem;
    }
    
    .shop-note {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .search-container .search-box {
        margin-bottom: 1rem;
        border-radius: 9999px;
    }
    
    .search-container #customSearchInput {
        padding: 0.625rem 2.5rem 0.625rem 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .search-container .search-icon {
        right: 0.75rem;
        width: 16px;
        height: 16px;
    }
    
    .search-filters {
        margin: 0.5rem 0 0.375rem 0;
        padding-bottom: 0.375rem;
    }
    
    .filter-buttons {
        gap: 0.375rem;
    }
    
    .filter-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .filter-btn:hover:not(.active) {
        transform: scale(1.01);
    }
    
    .filter-btn.active:hover {
        transform: scale(1.01);
    }
    
    .results-category-section {
        margin-bottom: 1.25rem;
    }

    .results-category-title {
        font-size: 0.9375rem;
    }

    .custom-result-item {
        padding: 0.625rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .result-content h3 {
        font-size: 0.9375rem;
        margin-bottom: 0.25rem;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .quick-link-card {
        padding: 0.75rem;
    }

    .quick-link-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }

    .quick-link-content h4 {
        font-size: 0.875rem;
    }

    .quick-link-badge {
        font-size: 0.5625rem;
        padding: 0.125rem 0.375rem;
    }
}
