/**
 * Inspiration for Schools - Category Filter Section
 * LoveForm-inspired design following existing theme patterns
 * Replaces "Your Recent Searches" section
 */

/* ========================================
   INSPIRATION SECTION CONTAINER
   ======================================== */

.inspiration-section {
    background: transparent; /* Remove background from main element */
    padding: 16px 0 20px; /* Tight spacing like LoveForm - minimal space above title */
    /* Background extends full viewport width */
    width: 100%;
    margin-top: 24px; /* Clear gap between carousel and this section */
    position: relative;
}

/* Use pseudo-element for gray background - starts AFTER the padding area */
.inspiration-section::before {
    content: '';
    position: absolute;
    top: 16px; /* Start gray background 16px down (after padding, where title begins) */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--loveform-background, #f7f7f7);
    z-index: -1; /* Send behind content */
}

/* Content constrained within max-width, but background is full-width */
.inspiration-section .container-fluid {
    padding-left: 0;
    padding-right: 0;
    max-width: 1760px; /* Match carousel content max-width for alignment */
    margin: 0 auto; /* Center content on ultrawide screens */
}

.inspiration-title {
    font-size: 1.375rem;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--loveform-dark, #222222);
    margin-bottom: 12px;
    letter-spacing: var(--letter-spacing-tight, -0.025em);
    padding-left: 32px;  /* Align with header logo/hamburger spacing */
    padding-right: 32px;
}

/* ========================================
   HORIZONTAL TAB BAR
   ======================================== */

.inspiration-tabs-container {
    position: relative;
    display: flex;
    align-items: flex-end;  /* Align tabs to bottom so underline meets border */
    margin-bottom: 16px;
    border-bottom: none;  /* Remove border - using pseudo-element instead */
    padding: 0 32px;  /* Match title's side padding for alignment */
}

/* Inset border line that aligns with content padding */
.inspiration-tabs-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 32px;   /* Match the container's left padding */
    right: 32px;  /* Match the container's right padding */
    height: 1px;
    background: var(--loveform-border, #DDDDDD);
    z-index: 0;
}

/* Scroll Buttons */
.inspiration-scroll-btn {
    position: absolute;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--loveform-border, #DDDDDD);
    background: var(--loveform-white, #FFFFFF);
    color: var(--loveform-dark, #222222);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    opacity: 0;
    pointer-events: none;
}

.inspiration-scroll-btn:hover {
    border-color: var(--loveform-dark, #222222);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.inspiration-scroll-btn.prev {
    left: -16px;
}

.inspiration-scroll-btn.next {
    right: -16px;
}

/* Show scroll buttons when needed */
.inspiration-tabs-container.can-scroll-left .inspiration-scroll-btn.prev,
.inspiration-tabs-container.can-scroll-right .inspiration-scroll-btn.next {
    opacity: 1;
    pointer-events: auto;
}

/* Tab Container with Horizontal Scroll */
.inspiration-tabs {
    display: flex;
    justify-content: flex-start;  /* Left-align tabs like LoveForm */
    gap: 0;  /* Remove gap - use padding on tabs instead */
    overflow-x: auto;
    overflow-y: visible;  /* Allow focus rings to show above/below */
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 6px 8px;  /* Extra padding for focus ring (2px ring + 4px buffer) */
    margin: -6px -8px;  /* Negative margin to compensate */
}

.inspiration-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Individual Tab Button - LoveForm Style */
.inspiration-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 10px;  /* Less bottom padding to bring underline closer */
    margin-bottom: -1px;  /* KEY: Overlap with container border */
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--loveform-medium, #717171);
    white-space: nowrap;
    flex-shrink: 0;
}

/* First tab: keep normal padding for visual centering within focus border */
/* No special rules needed - container padding provides space for focus ring */

.inspiration-tab:hover {
    color: var(--loveform-dark, #222222);
}

.inspiration-tab.active {
    color: var(--loveform-dark, #222222);
    border-bottom-color: var(--loveform-dark, #222222);
    z-index: 1;  /* Ensure active tab border sits above the gray line */
}

/* Tab Icon */
.tab-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.inspiration-tab:hover .tab-icon {
    transform: scale(1.05);
}

/* Tab Text */
.tab-text {
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium, 500);
    letter-spacing: 0.02em;
}

/* ========================================
   SCHOOL LINK GRID
   ======================================== */

.inspiration-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 24px;
    position: relative;
    padding: 0 32px;  /* Match title's side padding for alignment */
}

/* Individual School Link */
.inspiration-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--loveform-dark, #222222);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    padding: 4px 0;
}

.inspiration-link:hover {
    color: var(--loveform-rausch, #2AC8C8);
}

.inspiration-link:hover .link-school {
    text-decoration: underline;
}

/* School Name */
.link-school {
    font-weight: var(--font-weight-medium, 500);
    line-height: 1.3;
}

/* Descriptor (e.g., "Top Rated", "STEM Excellence") */
.link-descriptor {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--loveform-medium, #717171);
    font-weight: var(--font-weight-normal, 400);
}

/* TrueScore Badge - Circle with brand color (number only) */
.truescore-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #2ac8c8;
    color: white;
    font-size: 0.625rem;
    font-weight: var(--font-weight-bold, 700);
    border-radius: 50%;
    letter-spacing: 0;
    flex-shrink: 0;
    margin-right: 4px;
}

/* ========================================
   LOADING SKELETON
   ======================================== */

.inspiration-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 24px;
    padding: 0 32px;  /* Match grid's side padding */
}

.skeleton-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(
        90deg,
        var(--loveform-border, #DDDDDD) 25%,
        var(--loveform-background, #f7f7f7) 50%,
        var(--loveform-border, #DDDDDD) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 60%;
    height: 12px;
}

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

/* ========================================
   EMPTY STATE
   ======================================== */

.inspiration-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--loveform-medium, #717171);
}

.inspiration-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

/* ========================================
   SHOW MORE FOOTER
   ======================================== */

.inspiration-footer {
    position: relative;
    margin-top: 16px;
    padding-top: 12px;
    padding-left: 32px;   /* Match other elements' side padding */
    padding-right: 32px;
    border-top: none;  /* Remove border - using pseudo-element instead */
}

/* Inset border line that aligns with content padding */
.inspiration-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;   /* Match the padding */
    right: 32px;
    height: 1px;
    background: var(--loveform-border, #DDDDDD);
}

.show-more-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--loveform-dark, #222222);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium, 500);
    transition: all 0.2s ease;
}

.show-more-link:hover {
    color: var(--loveform-rausch, #2AC8C8);
    text-decoration: underline;
}

.show-more-link i {
    transition: transform 0.2s ease;
}

.show-more-link:hover i {
    transform: translateX(4px);
}

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

/* Tablet: 3 columns */
@media (max-width: 992px) {
    .inspiration-grid,
    .inspiration-skeleton {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 columns */
@media (max-width: 768px) {
    .inspiration-section {
        padding: 20px 0 24px;
    }

    .inspiration-title {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }

    .inspiration-tabs-container {
        margin-bottom: 12px;
    }

    .inspiration-tabs {
        gap: 0;
    }

    .inspiration-tab {
        padding: 10px 12px 8px;
        margin-bottom: -1px;
    }

    .inspiration-tab:first-child {
        padding-left: 0;
    }

    .tab-icon {
        font-size: 1.125rem;
    }

    .tab-text {
        font-size: 0.6875rem;
    }

    .inspiration-grid,
    .inspiration-skeleton {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 16px;
    }

    .inspiration-link {
        font-size: 0.8125rem;
        padding: 6px 0;
    }

    .inspiration-scroll-btn {
        display: none; /* Hide on mobile, rely on touch scroll */
    }
}

/* Small Mobile: 1 column on very small screens */
@media (max-width: 480px) {
    .inspiration-grid,
    .inspiration-skeleton {
        grid-template-columns: 1fr;
    }

    .inspiration-tab {
        padding: 8px 10px 6px;
        margin-bottom: -1px;
    }

    .inspiration-tab:first-child {
        padding-left: 0;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus states for keyboard navigation */
.inspiration-tab:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--loveform-rausch, #2AC8C8);
    border-radius: 4px;
}

.inspiration-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--loveform-rausch, #2AC8C8);
    border-radius: 4px;
}

.inspiration-scroll-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--loveform-rausch, #2AC8C8);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .inspiration-tabs {
        scroll-behavior: auto;
    }

    .skeleton-line {
        animation: none;
        background: var(--loveform-border, #DDDDDD);
    }

    .inspiration-tab,
    .inspiration-link,
    .show-more-link,
    .tab-icon {
        transition: none;
    }
}
