/* === similar-quotes.css === */
/* similar-quotes.css
 * ============================================
 * Styles for the similar quotes search component.
 * Migrated from global_bootstrap.css during 74-6.
 *
 * Last updated: 2025-12-27
 */

/* === BASE STYLES === */
.similar-quotes-input-container {
    position: relative;
    width: 100%;
    margin: 0;
}

.similar-quotes-input {
    width: 100%;
    margin: 0;
    padding: 0.5rem;
}

.similar-quotes-submit {
    width: 100%;
    padding: 0.75rem 1rem;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 3rem;
    font-size: 1.3rem;

    &:disabled {
        cursor: not-allowed;
        opacity: 0.7;
    }

    &.btn-warning {
        color: var(--bs-dark);
    }
}

.similar-quotes-form {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.similar-quotes-search {
    max-width: 800px;
}

/* === MOBILE STYLES === */
@media (max-width: 575.98px) {
    .similar-quotes-detail-card .card-body {
        padding: 0.25rem 0 !important;
    }

    .similar-quotes-form .btn-group .btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.9rem;
    }

    .similar-quotes-input {
        border-width: 2px !important;
        min-height: 60px !important;
    }

    .similar-quotes-submit {
        padding: 0.625rem 1rem !important;
        font-size: 1.1rem !important;
    }
}

/* === DESKTOP STYLES === */
@media (min-width: 768px) {
    .similar-quotes-input {
        min-height: 80px;
        width: 100%;
        line-height: 1.5;
        border: 1px solid var(--bs-border-color);
        border-radius: 8px;
        padding: 12px 40px 12px 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        resize: none;
    }

    .similar-quotes-form {
        display: flex;
        gap: 1rem;
        align-items: center;
    }

    .similar-quotes-input-container {
        flex: 1;
        margin-bottom: 0;
    }

    .similar-quotes-submit {
        white-space: nowrap;
    }
}

/* === splash-quote.css === */
/* components/splash-quote.css
 * ============================================
 * Splash quote component for page headers.
 * Displays an inspirational quote near the top of a page
 * in a subtle, non-dominating style.
 *
 * Usage:
 *   <figure class="splash-quote">
 *     <blockquote>"Quote text here."</blockquote>
 *     <figcaption>— Author Name</figcaption>
 *   </figure>
 *
 * Last updated: 2026-01-11
 */

/* === SPLASH QUOTE BASE === */
.splash-quote {
    text-align: center;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;

    /* Link wrapper - entire quote is clickable */
    & a {
        display: inline;
        text-decoration: none;
        color: inherit;

        &:hover {
            text-decoration: underline;
            text-decoration-color: var(--bs-gray-400);
            text-underline-offset: 2px;
        }

        &:focus-visible {
            outline: 2px solid var(--bs-primary);
            outline-offset: 2px;
        }
    }

    /* Quote text - inline with attribution */
    & blockquote {
        display: inline;
        font-style: italic;
        font-size: 0.9375rem;
        line-height: 1.6;
        color: var(--bs-secondary);
        margin: 0;
        quotes: "\201C" "\201D";

        &::before {
            content: open-quote;
        }

        &::after {
            content: close-quote;
        }
    }

    /* Attribution - inline after quote */
    & figcaption {
        display: inline;
        font-size: 0.9375rem;
        font-style: italic;
        color: var(--bs-gray-600);
    }
}

/* === RESPONSIVE === */
@media (max-width: 576px) {
    .splash-quote {
        margin-bottom: 1rem;

        & blockquote,
        & figcaption {
            font-size: 0.875rem;
        }
    }
}

/* === mini-console.css === */
/**
 * Mini-Console: Mobile bottom navigation
 * Feature: 038-mobile-style-refresh
 *
 * Fixed bottom bar with 5 nav items for mobile (<768px).
 * Hidden on desktop. Safe-area-inset handling for notched devices.
 *
 * Z-index: 1030 (--z-index-fixed) - same level as navbar
 * Touch targets: 44px minimum per WCAG 2.1 AA
 */

/* ==========================================================================
   Mini-Console Container
   ========================================================================== */

.mini-console {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* Height: 44px content (minimum touch target) + safe area for notched devices */
    height: calc(44px + env(safe-area-inset-bottom, 0));
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: white;
    border-top: 1px solid var(--bs-border-color, #D2B48C);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: var(--z-index-fixed, 1030);
}

/* ==========================================================================
   Navigation Items
   ========================================================================== */

.mini-console-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-width: 44px; /* Touch target */
    min-height: 44px; /* Touch target */
    padding: 2px 0;
    color: var(--bs-secondary, #2F4F4F);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
    /* Reset button styles */
    font-family: inherit;
    font-size: inherit;
    line-height: 1;
}

.mini-console-item:hover,
.mini-console-item:focus {
    color: var(--bs-primary, #8B4513);
}

.mini-console-item:active {
    transform: scale(0.95);
}

/* Active state */
.mini-console-item.active {
    color: var(--bs-primary, #8B4513);
}

/* ==========================================================================
   Icons
   ========================================================================== */

.mini-console-item .bi {
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 2px;
}

/* ==========================================================================
   Labels
   ========================================================================== */

.mini-console-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   Responsive: Hide on desktop (>=768px)
   ========================================================================== */

@media (min-width: 768px) {
    .mini-console {
        display: none;
    }
}

/* ==========================================================================
   Content spacing: Reserve space above mini-console on mobile
   ========================================================================== */

@media (max-width: 767.98px) {
    /* Footer needs padding to not be hidden behind mini-console + sticky search
     * Mini-console: 44px, Sticky search: ~50px (when visible on home), buffer: 10px */
    footer,
    footer.container-fluid {
        padding-bottom: calc(110px + env(safe-area-inset-bottom, 0)) !important;
    }

    /* Main content area needs margin at bottom */
    main.container-fluid {
        margin-bottom: calc(54px + env(safe-area-inset-bottom, 0));
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Focus visible for keyboard navigation */
.mini-console-item:focus-visible {
    outline: 2px solid var(--bs-primary, #8B4513);
    outline-offset: -2px;
    border-radius: 4px;
}

/* ==========================================================================
   Chat Expansion Isolation: Disable non-chat items while chat is expanded
   ========================================================================== */

/* When chat is expanded, mini-console must sit ABOVE the chat sidebar (z-index 1040)
   so clicks on nav items reach the JS handler for close+navigate behavior. */
body:has(.chat-sidebar.chat-expanded) .mini-console {
    z-index: 1041;
}

body:has(.chat-sidebar.chat-expanded) .mini-console-item:not(.mini-console-chat) {
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

/* ==========================================================================
   Loading Overlay: Full-screen spinner for slow mobile navigation
   ========================================================================== */

.mini-console-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--z-index-fixed, 1030) + 10);
}

@media (min-width: 768px) {
    .mini-console-loading {
        display: none !important;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .mini-console-item,
    body:has(.chat-sidebar.chat-expanded) .mini-console-item:not(.mini-console-chat) {
        transition: none;
    }

    .mini-console-item:active {
        transform: none;
    }

    .mini-console-loading .spinner-border {
        animation: none;
    }
}

/* === progress-bar.css === */
/**
 * Navigation Progress Bar
 * Feature: 038-mobile-style-refresh (FR-009)
 *
 * Thin top-of-viewport progress indicator for page transitions.
 * Essential in PWA standalone mode where no browser chrome provides loading feedback.
 *
 * Z-index: 1040 (above navbar at 1030)
 */

/* ==========================================================================
   Progress Bar Container
   ========================================================================== */

.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1040;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-progress.active {
    opacity: 1;
}

/* ==========================================================================
   Progress Bar Track
   ========================================================================== */

.nav-progress-bar {
    height: 100%;
    width: 0;
    background: var(--bs-primary, #8B4513);
    transition: width 0.3s ease;
}

.nav-progress.active .nav-progress-bar {
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Animation: Indeterminate progress
   ========================================================================== */

@keyframes progress-indeterminate {
    0% {
        width: 0;
        margin-left: 0;
    }
    50% {
        width: 70%;
        margin-left: 15%;
    }
    100% {
        width: 0;
        margin-left: 100%;
    }
}

/* ==========================================================================
   Accessibility: Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .nav-progress,
    .nav-progress-bar {
        transition: none;
    }

    .nav-progress.active .nav-progress-bar {
        animation: none;
        width: 100%;
    }
}

/* === toast.css === */
/**
 * Toast Notification Component
 * Feature: 051-optimistic-collect (FR-009)
 *
 * Accessible toast notifications for error/success feedback.
 * Bottom-center position, auto-dismiss, optional action buttons.
 *
 * Z-index: 9999 (above all other elements)
 */

/* ==========================================================================
   Toast Container
   ========================================================================== */

.qs-toast-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    /* Safe area inset for iOS devices */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ==========================================================================
   Toast Base Styles
   ========================================================================== */

.qs-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--qs-toast-bg, #1a1a1a);
    color: var(--qs-toast-text, #fff);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
    max-width: min(90vw, 400px);
    min-width: 280px;
}

.qs-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.qs-toast--hiding {
    opacity: 0;
    transform: translateY(0.5rem);
}

/* ==========================================================================
   Toast Type Variants
   ========================================================================== */

.qs-toast--error {
    border-left: 4px solid var(--bs-danger, #dc3545);
}

.qs-toast--success {
    border-left: 4px solid var(--bs-success, #198754);
}

.qs-toast--info {
    border-left: 4px solid var(--bs-info, #0dcaf0);
}

/* ==========================================================================
   Toast Content
   ========================================================================== */

.qs-toast__message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ==========================================================================
   Toast Action Button
   ========================================================================== */

.qs-toast__action {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 150ms ease;
    white-space: nowrap;
}

.qs-toast__action:hover {
    background: rgba(255, 255, 255, 0.15);
}

.qs-toast__action:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   Toast Close Button
   ========================================================================== */

.qs-toast__close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-left: 0.25rem;
}

.qs-toast__close:hover {
    color: #fff;
}

.qs-toast__close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   Accessibility: Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .qs-toast {
        transition: none;
    }
}

/* ==========================================================================
   Mobile Adjustments
   ========================================================================== */

@media (max-width: 480px) {
    .qs-toast-container {
        left: 0.5rem;
        right: 0.5rem;
        transform: none;
        bottom: 0.5rem;
    }

    .qs-toast {
        max-width: 100%;
        min-width: auto;
    }
}

/* === hero-cards.css === */
/* Hero Cards - Landing page feature showcase
 * Scroll story format with icon + screenshot cards
 */

.hero-cards-section {
    padding-top: 3rem;
    padding-bottom: 1rem;
}

.hero-cards-section .section-title {
    margin-bottom: 2.5rem;
}

/* Feature card base styling */
.hero-cards-section .card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hero-cards-section .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Icon styling */
.hero-cards-section .feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.hero-cards-section .feature-icon i {
    font-size: 2rem;
}

/* Screenshot container */
.hero-cards-section .feature-screenshot {
    max-width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.hero-cards-section .feature-screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

/* Transparent images (no frame/shadow) */
.hero-cards-section .feature-screenshot.no-frame {
    border-radius: 0;
    box-shadow: none;
}

/* Card body adjustments for screenshot cards */
.hero-cards-section .card.has-screenshot .card-body {
    padding-top: 1.5rem;
}

/* Trending anchor link styling */
.hero-cards-section a.trending-anchor {
    text-decoration: none;
    color: inherit;
}

.hero-cards-section a.trending-anchor:hover {
    text-decoration: none;
}

.hero-cards-section a.trending-anchor:hover .card {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Card text refinements */
.hero-cards-section .card-title {
    color: var(--bs-primary);
    font-weight: 600;
}

.hero-cards-section .card-text {
    color: var(--bs-secondary);
    line-height: 1.6;
}

/* Nested card cluster for stacking short cards alongside tall cards */
.hero-cards-section .card-cluster {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Match g-4 gutter */
    height: 100%;
}

.hero-cards-section .card-cluster .card {
    flex: 1; /* Equal height distribution */
}

/* Hover effect for linked cards within cluster */
.hero-cards-section .card-cluster a:hover .card {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .hero-cards-section {
        padding-top: 2rem;
        padding-bottom: 0.5rem;
    }

    .hero-cards-section .feature-icon {
        width: 3.5rem;
        height: 3.5rem;
    }

    .hero-cards-section .feature-icon i {
        font-size: 1.75rem;
    }
}
