/* Recipe Search Page Styles */

/* Page Layout */
.recipe-search-page {
    background: var(--background-warm);
    height: 100vh;
    padding-top: calc(60px + 40px);
    padding-bottom: 24px;
    overflow: hidden;
    box-sizing: border-box;
}

.recipe-search-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.recipe-search-header {
    text-align: center;
    margin-bottom: 32px;
}

.recipe-search-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 32px;
    line-height: 1.2;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.recipe-search-subtitle {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-gray);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.site-count-highlight {
    color: var(--primary-orange);
    font-weight: 600;
}

/* Two-Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    flex: 1;
    min-height: 0;
}

/* Column containers */
.column-left,
.column-right {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Sites Panel (Left Column) */
.sites-panel {
    background: linear-gradient(135deg, #FFF8F3 0%, #FEF3E2 100%);
    border-radius: var(--radius-large);
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.sites-panel-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sites-panel-count {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-gray);
}

#sites-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

#sites-list::-webkit-scrollbar {
    width: 4px;
}

#sites-list::-webkit-scrollbar-track {
    background: transparent;
}

#sites-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

/* Site Card */
a.site-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.site-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-small);
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(8px);
}

.site-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.site-card:hover {
    background: rgba(255, 255, 255, 0.6);
}

.site-favicon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.site-favicon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.site-info {
    flex: 1;
    min-width: 0;
}

.site-name {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-description {
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-gray);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    overflow: hidden;
}

/* Suggest Blog Inline CTA */
.suggest-blog-inline {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
}

.suggest-blog-text {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.suggest-blog-btn {
    font-size: 13px;
    padding: 8px 16px;
}

/* Search Panel (Right Column) */
.search-panel {
    background: var(--primary-light);
    border-radius: var(--radius-large);
    padding: 24px;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.search-panel-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-panel-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-orange);
    flex-shrink: 0;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-light-gray);
    pointer-events: none;
}

#recipe-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-medium);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--primary-dark);
    background: var(--primary-light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

#recipe-search-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

#recipe-search-input::placeholder {
    color: var(--text-light-gray);
}

/* Suggestion Chips */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.suggestion-chip {
    padding: 6px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    background: var(--primary-light);
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-chip:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    background: var(--background-light-orange);
}

.suggestion-chip:active {
    transform: scale(0.96);
}

/* Search Results Area */
#search-results {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#search-results::-webkit-scrollbar {
    width: 4px;
}

#search-results::-webkit-scrollbar-track {
    background: transparent;
}

#search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

/* Empty State */
.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light-gray);
}

.search-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-empty-text {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-gray);
}

.search-empty-hint {
    font-size: 13px;
    color: var(--text-light-gray);
}

/* Loading Skeletons */
.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.skeleton-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-small);
    background: #f9fafb;
}

.skeleton-thumbnail {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-small);
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 8px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
    width: 60%;
}

.skeleton-line.wide {
    width: 85%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Result Card */
.result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-small);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.result-card:hover {
    background: #f9fafb;
    border-color: #E5E7EB;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.result-thumbnail {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-small);
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-dark);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.result-source {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-gray);
}

.result-source-favicon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.result-open {
    font-size: 11px;
    color: var(--primary-orange);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.result-card:hover .result-open {
    opacity: 1;
}

/* Results Header Bar */
.results-header-bar {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.results-count {
    font-size: 13px;
    color: var(--text-light-gray);
}

.results-cta {
    font-size: 13px;
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.results-cta:hover {
    text-decoration: underline;
}

/* No Results State */
.no-results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
}

.no-results-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 15px;
    color: var(--text-gray);
    margin-bottom: 6px;
}

.no-results-hint {
    font-size: 13px;
    color: var(--text-light-gray);
}

/* Error State */
.search-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-small);
    padding: 16px;
    color: #DC2626;
    text-align: center;
    font-size: 14px;
    margin: 12px 0;
}

/* Community Banner */
.community-banner {
    background: linear-gradient(135deg, #FFF8F3 0%, #FEF3E2 100%);
    border-radius: var(--radius-large);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.community-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.community-banner-text {
    flex: 1;
    min-width: 200px;
}

.community-banner-text p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-gray);
}

.community-banner-text strong {
    color: var(--primary-dark);
}

.community-banner-cta {
    flex-shrink: 0;
}

.community-banner-cta .btn-primary {
    font-size: 14px;
    padding: 10px 20px;
    white-space: nowrap;
}

/* Loading Spinner (reused from bluesky-feed) */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #E5E7EB;
    border-top: 2px solid var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sites Error */
.sites-error {
    text-align: center;
    padding: 24px;
    color: var(--text-gray);
    font-size: 14px;
}

/* Responsive - Tablet+ */
@media (min-width: 768px) {
    .recipe-search-title {
        font-size: 40px;
    }

    .recipe-search-page {
        padding-top: calc(60px + 48px);
    }
}

/* Responsive - Desktop */
@media (min-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 2fr 3fr;
    }

    .recipe-search-title {
        font-size: 44px;
    }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    .recipe-search-page {
        padding-top: calc(60px + 16px);
        padding-bottom: 16px;
        height: auto;
        overflow: auto;
    }

    .recipe-search-container {
        padding: 0 12px;
        height: auto;
        display: block;
    }

    .recipe-search-header {
        margin-bottom: 16px;
    }

    .recipe-search-title {
        font-size: 24px;
    }

    .recipe-search-subtitle {
        font-size: 14px;
    }

    .two-column-layout {
        gap: 16px;
        margin-bottom: 16px;
        flex: none;
    }

    /* Search demo shows first on mobile */
    .column-right {
        order: -1;
    }

    /* Tighter panel padding */
    .search-panel {
        padding: 16px;
        border-radius: var(--radius-medium);
    }

    .sites-panel {
        padding: 16px;
        border-radius: var(--radius-medium);
    }

    .search-panel-title,
    .sites-panel-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    /* Smaller search input */
    #recipe-search-input {
        padding: 10px 14px 10px 38px;
        font-size: 15px;
    }

    .search-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    /* Chips */
    .suggestion-chips {
        gap: 6px;
        margin-bottom: 12px;
    }

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

    /* Smaller thumbnails on mobile */
    .result-thumbnail {
        width: 56px;
        height: 56px;
    }

    .skeleton-thumbnail {
        width: 56px;
        height: 56px;
    }

    .result-title {
        font-size: 13px;
    }

    /* Search results - no fixed height, page scrolls naturally */
    #search-results {
        max-height: none;
        min-height: 0;
        overflow-y: visible;
    }

    .results-header-bar {
        flex-direction: column;
        text-align: center;
    }

    /* Search panel shouldn't flex-grow on mobile */
    .search-panel {
        flex: none;
    }

    /* Sites stay vertical list on mobile, capped height */
    #sites-list {
        max-height: 250px;
        overflow-y: auto;
        padding-right: 4px;
    }

    .site-card {
        padding: 8px 10px;
        gap: 10px;
    }

    .site-name {
        font-size: 13px;
    }

    .site-description {
        display: none;
    }

    .sites-panel {
        flex: none;
    }

    .suggest-blog-inline {
        margin-top: 12px;
        padding-top: 12px;
    }

    /* Truncate nav button text */
    .contact-trigger {
        font-size: 0;
    }

    .contact-trigger::after {
        content: "Suggest";
        font-size: 14px;
    }

    .nav-cta a {
        font-size: 0;
    }

    .nav-cta a::after {
        content: "Back";
        font-size: 14px;
    }

    /* Community banner */
    .community-banner {
        flex-direction: column;
        text-align: center;
        padding: 16px;
        border-radius: var(--radius-medium);
        gap: 12px;
    }

    .community-banner-text {
        min-width: 0;
    }

    .community-banner-text p {
        font-size: 13px;
    }

    .community-banner-cta .btn-primary {
        font-size: 13px;
        padding: 8px 16px;
    }

    /* Empty/no-results states */
    .search-empty-state {
        padding: 24px 12px;
    }

    .search-empty-icon {
        font-size: 32px;
    }

    .search-empty-text {
        font-size: 14px;
    }

    .no-results-state {
        padding: 24px 12px;
    }
}

/* Fade-in animation for components */
.fade-in-up {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}
