/**
 * Resources Hub Page Styles
 *
 * Search-first UX with browse by category cards
 *
 * @package FFOA_Custom
 * @since 1.1.0
 */

/* ============================================================
   PAGE BACKGROUND
   ============================================================ */

.page-resources-hub {
    background-color: #1a2340 !important;
    background-image: url('../images/Gemini_Generated_Image_m9ub24m9ub24m9ub.png') !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.resources-hero {
    padding: 3rem 0 2rem;
    text-align: center;
    background: rgba(34, 46, 81, 0.75);
    color: #ffffff;
}

.resources-hero .hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.resources-hero .hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.9);
}

.resources-hero .hero-subtitle {
    font-size: 1.25rem;
    color: #C2B97F;
    margin-bottom: 0;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* ============================================================
   SEARCH SECTION
   ============================================================ */

.resources-search-section {
    padding: 3rem 0;
    background: rgba(34, 46, 81, 0.5);
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.search-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    font-size: 1.0625rem;
    color: #222E51;
    outline: none;
}

.search-input::placeholder {
    color: #999;
}

.search-button {
    background: #C2B97F;
    border: none;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: #a89f6a;
    transform: scale(1.05);
}

/* Search Results */
.search-results {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.results-count {
    font-size: 1rem;
    font-weight: 600;
    color: #222E51;
}

.clear-search {
    background: none;
    border: none;
    color: #C2B97F;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.clear-search:hover {
    background: rgba(194, 185, 127, 0.1);
}

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

.result-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: #C2B97F;
    box-shadow: 0 4px 12px rgba(194, 185, 127, 0.2);
    transform: translateY(-2px);
}

.result-type {
    display: inline-block;
    background: #C2B97F;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.result-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.result-title a {
    color: #222E51;
    text-decoration: none;
}

.result-title a:hover {
    color: #C2B97F;
}

.result-title mark {
    background: #fff3cd;
    padding: 0 0.25rem;
}

.result-link {
    display: inline-block;
    color: #C2B97F;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.result-link:hover {
    color: #a89f6a;
    text-decoration: underline;
}

/* Search Loading */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    margin-top: 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(194, 185, 127, 0.2);
    border-top-color: #C2B97F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.search-loading p {
    color: #222E51;
    font-weight: 600;
}

/* No Results / Error */
.no-results,
.search-error {
    text-align: center;
    padding: 2rem;
    color: #555;
}

.no-results ul {
    text-align: left;
    max-width: 400px;
    margin: 1rem auto 0;
    list-style-position: inside;
}

.no-results li {
    margin-bottom: 0.5rem;
}

/* ============================================================
   BROWSE CATEGORIES SECTION
   ============================================================ */

.browse-categories-section {
    padding: 4rem 0;
    background: transparent;
}

.categories-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.categories-header .section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.categories-header .section-description {
    font-size: 1.125rem;
    color: #C2B97F;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   CATEGORY CARDS - Frosted Glass
   ============================================================ */

.category-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(232, 232, 232, 0.6);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(34, 46, 81, 0.25);
    border-color: #C2B97F;
    background: rgba(255, 255, 255, 0.75);
}

.category-card .card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
    color: #C2B97F;
    transition: transform 0.3s ease;
}

.category-card:hover .card-icon {
    transform: scale(1.1);
}

.category-card .card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222E51;
    margin-bottom: 1rem;
}

.category-card .card-description {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.category-card .card-link {
    display: inline-block;
    color: #C2B97F;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.category-card .card-link:hover {
    color: #a89f6a;
    transform: translateX(4px);
}

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

@media (max-width: 768px) {
    .resources-hero .hero-title {
        font-size: 2rem;
    }

    .resources-hero .hero-subtitle {
        font-size: 1.125rem;
    }

    .search-title {
        font-size: 1.5rem;
    }

    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-button {
        width: 100%;
        padding: 1rem;
    }

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

    .category-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .categories-header .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .resources-hero {
        padding: 2rem 0 1.5rem;
    }

    .resources-hero .hero-title {
        font-size: 1.75rem;
    }

    .resources-search-section {
        padding: 2rem 0;
    }

    .search-title {
        font-size: 1.25rem;
    }

    .search-input {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }

    .browse-categories-section {
        padding: 3rem 0;
    }

    .category-card {
        padding: 1.5rem;
    }
}
