/* ===========================
   EXPLORE PAGE STYLES - V2.0
   Refined & Professional Design
   =========================== */

/* ===========================
   CSS Variables (Explore-specific)
   =========================== */
:root {
    --explore-btn-h: 46px;
    --explore-input-h: 44px;
    --explore-filter-btn-h: 42px;
    --explore-btn-padding: 0 1.5rem;
    --explore-font-size: 0.9375rem;
}

/* ===========================
   Search Container
   =========================== */
.search-container {
    display: flex;
    gap: .625rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: var(--explore-input-h);
    padding: 0 3rem 0 2.5rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all .2s;
    background: var(--bg-secondary);
}

    .search-input:focus {
        outline: none;
        border-color: var(--chefmike-orange);
        box-shadow: 0 0 0 3px rgba(232,93,51,.1);
    }

.search-icon {
    position: absolute;
    left: .875rem;
    color: var(--gray-600);
    pointer-events: none;
    font-size: 1rem;
}

.search-clear {
    position: absolute;
    right: .5rem;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
}

    .search-clear:hover {
        background: var(--gray-100);
        color: var(--chefmike-orange);
    }

/* ===========================
   Buttons - Refined Sizes
   =========================== */
.search-btn {
    height: var(--explore-btn-h);
    padding: var(--explore-btn-padding);
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    font-size: var(--explore-font-size);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    background: var(--chefmike-orange);
    color: #fff;
    box-shadow: 0 4px 12px rgba(232,93,51,.25);
}

    .search-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(232,93,51,.35);
    }

    .search-btn i {
        font-size: 1rem;
    }

.filters-btn {
    height: var(--explore-btn-h);
    padding: var(--explore-btn-padding);
    border-radius: var(--radius-sm);
    border: 2px solid var(--chefmike-orange);
    font-size: var(--explore-font-size);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--chefmike-orange);
    position: relative;
}

    .filters-btn:hover {
        background: var(--chefmike-orange);
        color: #fff;
        transform: translateY(-2px);
    }

        .filters-btn:hover .filter-count {
            background: var(--chefmike-orange-dark);
            color: #fff;
        }

    .filters-btn i {
        font-size: 1rem;
    }

    .filters-btn.active {
        background: var(--chefmike-orange);
        color: #fff;
        border-color: var(--chefmike-orange);
    }

        .filters-btn.active .filter-count {
            background: rgba(255,255,255,.2);
            color: #fff;
        }

.filter-count {
    background: rgba(232,93,51,.12);
    color: var(--chefmike-orange);
    padding: .125rem .5rem;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
    transition: background .2s, color .2s;
    line-height: 1;
}

.clear-filters-btn {
    height: 34px;
    padding: 0 .875rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-300);
    font-size: .8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--gray-700);
}

    .clear-filters-btn:hover {
        background: var(--gray-100);
        border-color: var(--gray-400);
        color: var(--chefmike-charcoal);
        transform: translateY(-1px);
    }

    .clear-filters-btn i {
        font-size: .875rem;
    }

/* ===========================
   Pills (Suggested Searches) - Refined
   =========================== */
.suggested-searches {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
    align-items: center;
}

.suggested-label {
    font-size: .8125rem;
    color: var(--gray-600);
    font-weight: 500;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;  /* 8px - 4px base unit */
    padding: 0.5rem 0.75rem;  /* 8px 12px - 4px base unit */
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 500;
    background: rgba(168,213,213,.12);
    color: var(--chefmike-charcoal);
    border: 1px solid transparent;
    transition: all .2s ease;
    cursor: default;
    line-height: 1.4;
}

    .pill i {
        font-size: .8125rem;
    }

.pill-clickable {
    cursor: pointer;
}

    .pill-clickable:hover {
        background: rgba(232,93,51,.08);
        border-color: var(--chefmike-orange);
        color: var(--chefmike-orange);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(232,93,51,.15);
    }

.pill-time {
    background: rgba(232,93,51,.08);
    color: var(--chefmike-orange);
    border-color: rgba(232,93,51,.15);
}

/* ===========================
   Active Filters - Refined
   =========================== */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .875rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 600;
    background: var(--chefmike-orange);
    color: #fff;
    box-shadow: 0 2px 6px rgba(232,93,51,.2);
    line-height: 1.4;
}

    .filter-chip i {
        font-size: .75rem;
    }

    .filter-chip button {
        background: none;
        border: none;
        color: #fff;
        font-size: 1rem;
        cursor: pointer;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background .2s;
        padding: 0;
        line-height: 1;
    }

        .filter-chip button:hover {
            background: rgba(255,255,255,.25);
            transform: scale(1.1);
        }

/* ===========================
   Filters Panel
   =========================== */
.filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 999;
    animation: fadeIn .2s ease;
}

.filters-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,.1);
    transition: right .25s ease;
}

    .filters-panel.open {
        right: 0;
    }

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 5;
}

    .filters-header h2 {
        font-size: 1.0625rem;
        font-weight: 700;
        color: var(--chefmike-charcoal);
        display: flex;
        align-items: center;
        gap: .5rem;
        margin: 0;
    }

        .filters-header h2 i {
            color: var(--chefmike-orange);
            font-size: 1rem;
        }

.close-filters {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: .375rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: background .2s, color .2s;
    width: 36px;
    height: 36px;
}

    .close-filters:hover {
        background: var(--gray-100);
        color: var(--chefmike-orange);
    }

.filters-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.filter-group {
    margin-bottom: 1.25rem;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    color: var(--chefmike-charcoal);
    margin-bottom: .5rem;
    font-size: .8125rem;
}

    .filter-label i {
        color: var(--chefmike-orange);
        font-size: .9375rem;
    }

.filter-select {
    width: 100%;
    height: 42px;
    padding: 0 .75rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all .2s;
    color: var(--chefmike-charcoal);
    font-family: inherit;
}

    .filter-select:focus {
        outline: none;
        border-color: var(--chefmike-orange);
        box-shadow: 0 0 0 3px rgba(232,93,51,.1);
    }

    .filter-select:hover {
        border-color: var(--gray-400);
    }

.filters-footer {
    position: sticky;
    bottom: 0;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: .625rem;
    z-index: 5;
}

    .filters-footer button {
        flex: 1;
        height: var(--explore-filter-btn-h);
        padding: 0 1.5rem;
        border-radius: var(--radius-sm);
        font-size: .9375rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        cursor: pointer;
        transition: var(--transition);
        font-family: inherit;
        border: 2px solid transparent;
    }

        .filters-footer button:first-child {
            background: var(--chefmike-orange);
            color: #fff;
            box-shadow: 0 4px 12px rgba(232,93,51,.25);
        }

            .filters-footer button:first-child:hover {
                transform: translateY(-2px);
                box-shadow: 0 8px 20px rgba(232,93,51,.35);
            }

        .filters-footer button:last-child {
            background: var(--bg-secondary);
            color: var(--gray-700);
            border-color: var(--gray-300);
        }

            .filters-footer button:last-child:hover {
                background: var(--gray-100);
                border-color: var(--gray-400);
            }

/* ===========================
   Results Section
   =========================== */
.results-section {
    padding: 2rem 0 3rem;
}

.results-header {
    margin-bottom: 1rem;
}

.results-count {
    color: var(--gray-600);
    font-size: .9375rem;
}

    .results-count strong {
        color: var(--chefmike-orange);
        font-weight: 700;
    }

/* ===========================
   Recipes Grid
   =========================== */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .recipes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .recipes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* ===========================
   Load More Section
   =========================== */
.load-more-section {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

    .load-more-section button {
        height: var(--explore-btn-h);
        padding: var(--explore-btn-padding);
        border-radius: var(--radius-sm);
        border: 2px solid var(--chefmike-orange);
        font-size: var(--explore-font-size);
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
        transition: var(--transition);
        font-family: inherit;
        background: var(--bg-secondary);
        color: var(--chefmike-orange);
    }

        .load-more-section button:hover {
            background: var(--chefmike-orange);
            color: #fff;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(232,93,51,.25);
        }

        .load-more-section button i {
            font-size: 1rem;
        }

/* ===========================
   States (Loading & Empty)
   =========================== */
.loading-state, .empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.loading-state {
    color: var(--gray-600);
}

    .loading-state i {
        font-size: 2.5rem;
        color: var(--chefmike-orange);
        margin-bottom: 1rem;
        animation: spin 1s linear infinite;
    }

    .loading-state p {
        font-size: .9375rem;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    color: var(--gray-600);
}

    .empty-state i {
        font-size: 2.5rem;
        color: var(--gray-400);
        margin-bottom: 1rem;
    }

    .empty-state h3 {
        color: var(--chefmike-charcoal);
        font-size: 1.375rem;
        font-weight: 700;
        margin-bottom: .5rem;
    }

    .empty-state p {
        color: var(--gray-600);
        margin-top: .5rem;
        font-size: .9375rem;
        line-height: 1.6;
    }

    .empty-state .empty-avatar {
        border-radius: 50%;
        margin-bottom: 1.5rem;
        opacity: 0.9;
    }

    .empty-state .empty-hint {
        font-size: 0.875rem;
        color: var(--text-tertiary);
        margin-bottom: 1.5rem;
    }

    .empty-state strong {
        color: var(--chefmike-orange);
    }

/* ===========================
   Clickable Stat Cards
   =========================== */
.stat-card-clickable {
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

    .stat-card-clickable:hover {
        transform: translateY(-2px) scale(1.01);
        box-shadow: 0 6px 20px rgba(232,93,51,.18);
    }

/* ===========================
   Share Notification
   =========================== */
.share-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--chefmike-charcoal);
    color: #fff;
    padding: .875rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .9375rem;
    font-weight: 600;
    z-index: 9999;
    animation: slideInUp .3s ease;
}

    .share-notification i {
        color: var(--color-success);
        font-size: 1.125rem;
    }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .share-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        font-size: .875rem;
    }
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        gap: .5rem;
    }

    .search-bar {
        min-width: 100%;
    }

    .search-btn,
    .filters-btn {
        width: 100%;
        justify-content: center;
    }

    .filters-panel {
        max-width: 100%;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .suggested-searches {
        justify-content: center;
    }

    .active-filters {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    :root {
        --explore-btn-h: 44px;
        --explore-input-h: 42px;
    }

    .search-input {
        font-size: .875rem;
    }

    .search-btn,
    .filters-btn {
        font-size: .875rem;
        padding: 0 1.25rem;
    }

    .pill {
        font-size: .75rem;
        padding: .3125rem .75rem;
    }

    .filter-chip {
        font-size: .75rem;
        padding: .3125rem .75rem;
    }

    .suggested-label {
        font-size: .75rem;
    }
}

/* ===========================
   Focus States (Accessibility)
   =========================== */
.search-input:focus-visible,
.filter-select:focus-visible {
    outline: 3px solid var(--chefmike-orange);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 3px solid var(--chefmike-orange);
    outline-offset: 2px;
}

/* ===========================
   DARK MODE SUPPORT
   =========================== */

[data-theme="dark"] .search-input {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .search-input:focus {
    border-color: var(--chefmike-orange-light);
    background: var(--bg-secondary);
}

[data-theme="dark"] .search-input::placeholder {
    color: var(--text-tertiary);
}

[data-theme="dark"] .search-clear:hover {
    background: var(--hover-bg);
}

[data-theme="dark"] .filter-select {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .filter-select:hover {
    background: var(--hover-bg);
}

[data-theme="dark"] .sort-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .sort-btn:hover {
    background: var(--hover-bg);
}

[data-theme="dark"] .active-filters {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .filter-tag {
    background: var(--bg-elevated);
    border-color: var(--border-heavy);
    color: var(--text-primary);
}

[data-theme="dark"] .stats-text {
    color: var(--text-secondary);
}
