/* Midwest Flooring Company - FAQ Page Styles */

/* CSS Variables matching brand theme */
:root {
    --mw-accent: #ffaf00;
    --mw-accent-hover: #e69e00;
    --mw-accent-dark: #cc8e00;
    --mw-accent-soft: #ffd966;
    --mw-blue: #2F4858;
    --mw-blue-light: #4B6473;
    --mw-blue-dark: #223643;
    --mw-text: #333333;
    --mw-text-light: #666666;
    --mw-bg: #FFFFFF;
    --mw-bg-alt: #F9F9F4;
    --mw-bg-light: #F9F9F4;
    --mw-success: #5A8A5E;
    --mw-border: rgba(47, 72, 88, 0.1);
    --mw-border-warm: #E6E6D1;
    --mw-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --mw-shadow-md: 0 8px 16px rgba(47,72,88,0.1);
    --mw-shadow-lg: 0 16px 32px rgba(47,72,88,0.12);
    --mw-shadow-xl: 0 24px 48px rgba(47,72,88,0.15);
    --mw-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: scroll;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--mw-text);
    line-height: 1.6;
    background: var(--mw-bg);
    overflow-x: hidden;
    overflow-y: scroll;
    max-width: 100vw;
}

/* Prevent layout shift from scrollbar */
html, body {
    scrollbar-gutter: stable;
}

img, picture, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--mw-blue);
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }

.container {
    max-width: min(1200px, 94vw);
    margin: 0 auto;
    padding-inline: clamp(1rem, 3vw, 2rem);
    overflow-x: hidden;
    overflow-y: visible;
}

.container::-webkit-scrollbar {
    display: none !important;
}

.container {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.section-padding {
    padding-block: clamp(3rem, 8vw, 5.5rem);
}

@media (min-width: 768px) {
    .section-padding {
        padding-block: clamp(4rem, 6vw, 6rem);
    }
}

/* Hero Section */
.faq-hero {
    background: linear-gradient(135deg, var(--mw-blue) 0%, var(--mw-blue-light) 100%);
    padding: clamp(4rem, 10vw, 6rem) 0 clamp(3rem, 8vw, 4rem);
    position: relative;
    overflow: hidden;
}

.faq-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 2px,
            transparent 2px,
            transparent 4px
        );
    pointer-events: none;
}

.faq-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.faq-hero h1 {
    color: white;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin-bottom: clamp(2rem, 5vw, 3rem);
    opacity: 0.95;
    max-width: min(100%, 42rem);
    margin-inline: auto;
}

/* Search Container */
.search-container {
    max-width: min(100%, 50rem);
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: clamp(1rem, 3vw, 1.5rem);
    width: 24px;
    height: 24px;
    color: var(--mw-text-light);
    pointer-events: none;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: clamp(1rem, 3vw, 1.25rem) clamp(3rem, 8vw, 4rem) clamp(1rem, 3vw, 1.25rem) clamp(3rem, 8vw, 4rem);
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: var(--mw-transition);
    color: var(--mw-text);
}

.search-input::placeholder {
    color: var(--mw-text-light);
    opacity: 0.8;
}

.search-input:focus {
    outline: none;
    border-color: var(--mw-accent);
    background: white;
    box-shadow: 0 12px 32px rgba(255, 175, 0, 0.25);
}

.search-clear {
    position: absolute;
    right: clamp(1rem, 3vw, 1.5rem);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--mw-transition);
    z-index: 2;
}

.search-clear svg {
    width: 20px;
    height: 20px;
    color: var(--mw-text-light);
}

.search-clear:hover {
    background: rgba(0, 0, 0, 0.05);
}

.search-clear.show {
    display: flex;
}

.search-results-count {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    min-height: 1.5rem;
}

/* Filter Section */
.filter-section {
    background: var(--mw-bg-alt);
    padding: clamp(2rem, 5vw, 3rem) 0;
    border-bottom: 2px solid var(--mw-accent);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-header h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.filter-reset {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 2px solid var(--mw-border);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mw-text-light);
    cursor: pointer;
    transition: var(--mw-transition);
}

.filter-reset:hover {
    background: var(--mw-blue);
    color: white;
    border-color: var(--mw-blue);
}

.category-filters {
    display: flex;
    gap: clamp(0.5rem, 2vw, 1rem);
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: clamp(0.7rem, 2vw, 0.85rem) clamp(1rem, 3vw, 1.5rem);
    background: white;
    border: 2px solid var(--mw-border);
    border-radius: 999px;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
    font-weight: 600;
    color: var(--mw-text);
    cursor: pointer;
    transition: var(--mw-transition);
    position: relative;
    white-space: nowrap;
}

.filter-icon {
    font-size: 1.2em;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    background: var(--mw-bg-alt);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mw-text-light);
}

.filter-btn:hover {
    background: var(--mw-blue);
    color: white;
    border-color: var(--mw-blue);
    transform: translateY(-2px);
    box-shadow: var(--mw-shadow-md);
}

.filter-btn:hover .filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.filter-btn.active {
    background: var(--mw-accent);
    color: var(--mw-blue);
    border-color: var(--mw-accent);
    box-shadow: 0 8px 20px rgba(255, 175, 0, 0.3);
}

.filter-btn.active .filter-count {
    background: rgba(47, 72, 88, 0.15);
    color: var(--mw-blue);
}

/* Popular Questions Section */
.popular-questions {
    background: var(--mw-bg-light);
    padding: clamp(3rem, 6vw, 4rem) 0;
    border-top: 1px solid var(--mw-border);
}

.popular-questions .section-title {
    text-align: center;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--mw-blue);
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
    max-width: 1000px;
    margin: 0 auto;
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1.25rem, 3vw, 1.5rem);
    background: white;
    border: 2px solid var(--mw-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--mw-blue);
    font-weight: 600;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    transition: var(--mw-transition);
    box-shadow: var(--mw-shadow);
}

.quick-link-card:hover {
    border-color: var(--mw-accent);
    box-shadow: var(--mw-shadow-md);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 175, 0, 0.05), rgba(255, 175, 0, 0.02));
}

.quick-link-card svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--mw-accent);
    stroke-width: 2.5;
}

.quick-link-card span {
    flex: 1;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
}

/* Category Headers */
.category-header {
    margin-top: clamp(2rem, 4vw, 3rem);
    margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
    padding-bottom: clamp(0.75rem, 2vw, 1rem);
    border-bottom: 3px solid var(--mw-accent);
}

.category-header:first-child {
    margin-top: 0;
}

.category-header h3 {
    color: var(--mw-blue);
    font-size: clamp(1.4rem, 3.5vw, 1.75rem);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.category-header p {
    color: var(--mw-text-light);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    margin: 0;
    line-height: 1.5;
}

.category-header.hidden {
    display: none;
}

/* FAQ Content */
.faq-content {
    background: white;
    overflow-x: hidden;
    overflow-y: visible;
}

.faq-grid {
    display: grid;
    gap: clamp(0.75rem, 2vw, 1rem);
    max-width: 900px;
    margin: 0 auto;
    overflow: visible;
    will-change: auto;
}

.faq-item {
    background: white;
    border-radius: 12px;
    border: 2px solid var(--mw-border);
    overflow: hidden;
    overflow-y: hidden;
    transition: var(--mw-transition);
}

.faq-item.hidden {
    display: none;
}

.faq-item:hover {
    border-color: rgba(255, 175, 0, 0.3);
    box-shadow: var(--mw-shadow-md);
}

.faq-item.active {
    border-color: var(--mw-accent);
    box-shadow: var(--mw-shadow-lg);
}

.faq-question {
    width: 100%;
    padding: clamp(1.25rem, 3vw, 1.5rem);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: var(--mw-transition);
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    font-weight: 600;
    color: var(--mw-blue);
}

.faq-question:hover {
    background: var(--mw-bg-light);
}

.faq-item.active .faq-question {
    background: linear-gradient(135deg, rgba(255, 175, 0, 0.1), rgba(255, 175, 0, 0.05));
}

.faq-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--mw-accent);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    overflow-y: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
    max-height: 3000px;
    overflow: hidden;
    overflow-y: hidden;
}

.faq-answer-content {
    padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1.25rem, 3vw, 1.5rem) clamp(1.25rem, 3vw, 1.5rem);
    color: var(--mw-text-light);
    line-height: 1.8;
    font-size: clamp(0.95rem, 2.1vw, 1rem);
    overflow-y: hidden;
}

/* Ensure no scrollbars appear in FAQ items - comprehensive approach */
.faq-item::-webkit-scrollbar,
.faq-answer::-webkit-scrollbar,
.faq-answer-content::-webkit-scrollbar,
.faq-grid::-webkit-scrollbar,
.faq-content::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.faq-item,
.faq-answer,
.faq-answer-content,
.faq-grid,
.faq-content {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* Force no scrollbar on any FAQ-related element */
.faq-content *::-webkit-scrollbar {
    display: none !important;
}

.faq-content * {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.faq-answer-content strong {
    color: var(--mw-blue);
    font-weight: 600;
}

/* Search Highlighting */
.faq-item mark {
    background: rgba(255, 175, 0, 0.3);
    color: var(--mw-blue);
    padding: 0.1em 0.2em;
    border-radius: 2px;
    font-weight: 600;
}

/* No Results */
.no-results {
    text-align: center;
    padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 3vw, 2rem);
    background: white;
    border-radius: 16px;
    border: 2px dashed var(--mw-border);
}

.no-results-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--mw-text-light);
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 0.75rem;
    color: var(--mw-text);
}

.no-results p {
    color: var(--mw-text-light);
    margin-bottom: 1.5rem;
}

.btn-reset-all {
    padding: 0.875rem 2rem;
    background: var(--mw-accent);
    color: var(--mw-blue);
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--mw-transition);
    box-shadow: 0 8px 20px rgba(255, 175, 0, 0.3);
}

.btn-reset-all:hover {
    background: var(--mw-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 175, 0, 0.4);
}

/* CTA Section */
.faq-cta {
    background: linear-gradient(135deg, var(--mw-blue) 0%, var(--mw-blue-light) 100%);
    padding: clamp(3.5rem, 8vw, 5rem) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.faq-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 175, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(230, 158, 0, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.faq-cta .container {
    position: relative;
    z-index: 2;
}

.faq-cta h2 {
    color: white;
    margin-bottom: 1rem;
}

.cta-subtitle {
    font-size: clamp(1rem, 2.3vw, 1.2rem);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: clamp(2rem, 5vw, 2.5rem);
    max-width: min(100%, 40rem);
    margin-inline: auto;
}

.cta-buttons {
    display: flex;
    gap: clamp(0.85rem, 2.5vw, 1.25rem);
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: clamp(0.875rem, 2.5vw, 1rem) clamp(1.75rem, 4vw, 2.25rem);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 700;
    text-decoration: none;
    border-radius: 999px;
    transition: var(--mw-transition);
    cursor: pointer;
    border: none;
    white-space: nowrap;
    min-height: 48px;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--mw-accent);
    color: var(--mw-blue);
    box-shadow: 0 12px 24px rgba(255, 175, 0, 0.3);
}

.btn-primary:hover {
    background: var(--mw-accent-hover);
    box-shadow: 0 16px 32px rgba(255, 175, 0, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Focus States */
*:focus-visible {
    outline: 2px solid var(--mw-accent);
    outline-offset: 2px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .faq-hero {
        padding: clamp(3rem, 8vw, 4rem) 0 clamp(2rem, 6vw, 3rem);
    }

    .faq-hero h1 {
        padding-top: 1rem;
    }

    .filter-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-reset {
        width: 100%;
        text-align: center;
    }

    .category-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding-left: 2.75rem;
        padding-right: 2.75rem;
        font-size: 0.9rem;
    }

    .search-input::placeholder {
        font-size: 0.85rem;
    }

    .search-icon {
        left: 1rem;
        width: 20px;
        height: 20px;
    }

    .search-clear {
        right: 1rem;
        width: 28px;
        height: 28px;
    }

    .filter-icon {
        font-size: 1.1em;
    }

    .faq-question {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .faq-answer-content {
        padding: 0 1rem 1rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .faq-hero,
    .filter-section,
    .faq-cta,
    .search-container,
    .filter-reset {
        display: none;
    }

    .faq-item {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
    }

    .faq-answer {
        max-height: none !important;
    }

    .faq-icon {
        display: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .filter-btn,
    .faq-item {
        border-width: 3px;
    }

    .faq-item.active {
        border-width: 4px;
    }
}
