/* Pool Repair Q&A - Questions Pages Styles */
/* Header/nav/dropdown styles are in the shared header include */

/* View page variables */
:root {
    --primary-blue: #b45309;
    --primary-hover: #92400e;
    --accent-orange: #ea580c;
    --accent-green: #15803d;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-light: #f0fdfa;
    --bg-white: #ffffff;
    --border-light: #e5e7eb;
}

/* Main Content */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Page Title */
.page-title {
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-title p {
    color: var(--text-gray);
}

/* Complete Guides Dropdown */
.guides-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.guides-dropdown-wrapper label {
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guides-dropdown-wrapper label i {
    color: var(--primary-blue);
}

.guides-dropdown-wrapper select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--bg-light);
    cursor: pointer;
    max-width: 400px;
}

.guides-dropdown-wrapper select:hover {
    border-color: var(--primary-blue);
}

.guides-dropdown-wrapper select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

@media (max-width: 600px) {
    .guides-dropdown-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .guides-dropdown-wrapper select {
        max-width: 100%;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: var(--text-gray);
}

.breadcrumbs a {
    color: var(--text-gray);
}

.breadcrumbs a:hover {
    color: var(--primary-blue);
}

/* Layout */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: -1;
    }
}

/* Question Cards */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.question-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--primary-blue);
}

.question-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.question-card h3 a {
    color: var(--text-dark);
}

.question-card h3 a:hover {
    color: var(--primary-blue);
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.question-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.question-summary {
    color: var(--text-gray);
    font-size: 0.95rem;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-light);
    color: var(--text-gray);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-badge i.fas {
    color: var(--primary-blue);
    opacity: 0.8;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-easy {
    background: #d1fae5;
    color: #065f46;
}

.difficulty-medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-hard {
    background: #fee2e2;
    color: #991b1b;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
}

.sidebar-card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* Tools Card - Featured */
.sidebar-card.tools-card {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
}

.sidebar-card.tools-card h3 {
    color: var(--accent-green);
}

.tools-list {
    list-style: none;
    margin-bottom: 15px;
}

.tools-list li {
    margin-bottom: 8px;
}

.tools-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    font-size: 0.9rem;
    padding: 6px 0;
}

.tools-list li a:hover {
    color: var(--accent-green);
    text-decoration: none;
}

.tools-list li a i {
    width: 18px;
    color: var(--accent-green);
}

.view-all-tools {
    display: block;
    text-align: center;
    background: var(--accent-green);
    color: white !important;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.view-all-tools:hover {
    background: #15803d;
    text-decoration: none;
}

/* Expert Card - Subtle */
.sidebar-card.expert-card {
    background: var(--bg-light);
    padding: 15px;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-gray);
    transition: background 0.2s;
}

.category-list a:hover {
    background: var(--bg-light);
    text-decoration: none;
    color: var(--primary-blue);
}

.category-list .count {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.category-list a span i.fas,
.category-list a span i.far {
    width: 18px;
    text-align: center;
    margin-right: 6px;
    color: var(--primary-blue);
    opacity: 0.7;
}

.category-list a:hover span i.fas,
.category-list a:hover span i.far {
    opacity: 1;
}

/* Search & Sort Row */
.search-sort-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.sort-dropdown label {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.sort-dropdown select {
    padding: 10px 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-white);
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-dark);
}

.sort-dropdown select:hover {
    border-color: var(--primary-blue);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
}

.search-box button {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.search-box button:hover {
    background: var(--primary-hover);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a, .pagination span {
    padding: 10px 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-gray);
}

.pagination a:hover {
    background: var(--bg-light);
    text-decoration: none;
}

.pagination .active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Individual Question Page */
.question-page {
    max-width: 960px;
    margin: 0 auto;
}

.question-header {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.question-header h1 {
    font-size: 1.75rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.question-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.question-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Answer Content — cohesive editorial type system */
.answer-content {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(15,43,51,0.04);
}
.answer-content > *:first-child { margin-top: 0; }
.answer-content > *:last-child { margin-bottom: 0; }

.answer-content h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 34px 0 14px;
    color: #0f2b33;
    line-height: 1.3;
    letter-spacing: -0.01em;
    border: none;
    padding: 0;
}

.answer-content h2:first-child { margin-top: 0; }

.answer-content h3 {
    font-size: 1.12rem;
    font-weight: 700;
    margin: 26px 0 8px;
    color: #78350f;
    line-height: 1.35;
}

.answer-content p {
    margin: 0 0 16px;
    color: #374151;
    line-height: 1.75;
    font-size: 1.0rem;
}

.answer-content ul, .answer-content ol {
    margin: 14px 0 18px;
    padding-left: 22px;
}

.answer-content li {
    margin-bottom: 9px;
    color: #374151;
    line-height: 1.7;
}
.answer-content li::marker { color: var(--primary-blue); }

.answer-content strong { color: #0f2b33; font-weight: 700; }

.answer-content a { color: var(--primary-blue); text-decoration: underline; text-underline-offset: 2px; }
.answer-content a:hover { color: var(--primary-hover); }

.answer-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 18px 0; display: block; }

/* tables + callouts inside the answer — no left stripes, soft tinted cards */
.answer-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.92rem; }
.answer-content th, .answer-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.answer-content th { background: #f0fdfa; color: #0f2b33; font-weight: 700; }
.answer-content blockquote { margin: 18px 0; padding: 14px 18px; background: #f0fdfa; border: 1px solid #fef3c7; border-radius: 12px; color: #374151; }
.answer-content blockquote p:last-child { margin-bottom: 0; }

/* Original Question Box */
.original-question {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-orange);
    border-radius: 0 12px 12px 0;
    padding: 20px 25px;
    margin-bottom: 20px;
}

.original-question .question-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-orange);
    font-weight: 600;
    margin-bottom: 10px;
}

.original-question h2 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.original-question p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
}

/* Quick Answer Box — cohesive tinted card (no left stripe) */
.quick-answer {
    background: linear-gradient(135deg, #fffbeb 0%, #f0fdfa 100%);
    border: 1px solid #a5f3fc;
    padding: 18px 22px;
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(180,83,9,0.07);
}

.quick-answer h2 {
    margin: 0 0 8px 0 !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary-blue) !important;
    display: flex;
    align-items: center;
    gap: 7px;
}
.quick-answer h2::before {
    content: "\f058"; /* check-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.95rem;
}

.quick-answer p {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.6;
    color: #0f2b33;
    font-weight: 500;
}

/* Article hero image banner */
.qa-hero {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin: 6px 0 18px;
    aspect-ratio: 16 / 4.5;            /* slightly smaller / shorter banner */
    background: #eaf3f5;
    box-shadow: 0 4px 18px rgba(2,12,27,0.08);
}
.qa-hero img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.82; }  /* faded */
.qa-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 40%, rgba(4,30,40,0.28) 100%); }
.qa-hero-badge {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    background: rgba(255,255,255,0.94); color: #92400e;
    font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 5px 12px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(2,12,27,0.16);
}
@media (max-width: 768px) { .qa-hero { aspect-ratio: 16 / 6.5; } }

/* Tools Needed */
.tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.tool-badge {
    background: var(--bg-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #3b82f6 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: white;
    margin-top: 30px;
}

.cta-box h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.cta-box p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: var(--accent-orange);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-decoration: none;
    color: white;
}

/* Related Questions */
.related-questions {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 25px;
}

.related-questions h3 {
    margin-bottom: 15px;
}

.related-questions ul {
    list-style: none;
    padding: 0;
}

.related-questions li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.related-questions li:last-child {
    border-bottom: none;
}

.related-questions a {
    color: var(--text-dark);
}

.related-questions a:hover {
    color: var(--primary-blue);
}

/* Footer */
.site-footer {
    background: var(--text-dark);
    color: var(--text-light);
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-links a {
    color: var(--text-light);
    margin-right: 20px;
}

.footer-links a:hover {
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--border-light);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.loading i {
    animation: spin 1s linear infinite;
}

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

/* Ad Slots */
.ad-slot {
    background: var(--bg-light);
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title h1 {
        font-size: 1.5rem;
    }

    .question-header h1 {
        font-size: 1.4rem;
    }

    .answer-content {
        padding: 20px;
    }

    .cta-box {
        padding: 20px;
    }
}

/* Question Accordion */
.question-accordion {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.question-accordion-header {
    width: 100%;
    padding: 16px 20px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    transition: background 0.2s;
}

.question-accordion-header:hover {
    background: #f1f5f9;
}

.question-author {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.question-author i {
    font-size: 24px;
    color: #64748b;
}

.author-name {
    font-weight: 600;
    color: var(--text-dark);
}

.author-type {
    font-size: 0.85rem;
    color: var(--text-gray);
    padding: 2px 8px;
    background: #e2e8f0;
    border-radius: 4px;
}

.question-preview {
    flex: 1;
    color: var(--text-gray);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.accordion-icon {
    color: var(--text-gray);
    transition: transform 0.3s;
}

.question-accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.question-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 20px;
}

.question-accordion-body.expanded {
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    border-top: 1px solid var(--border-light);
}

/* Subtle scrollbar for question body */
.question-accordion-body::-webkit-scrollbar {
    width: 6px;
}
.question-accordion-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
.question-accordion-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.question-accordion-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.question-accordion-body h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.question-accordion-body p {
    color: var(--text-gray);
    line-height: 1.7;
}

/* Question Image */
.question-image {
    float: right;
    max-width: 200px;
    margin: 0 0 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 600px) {
    .question-accordion-header {
        flex-wrap: wrap;
    }
    .question-preview {
        width: 100%;
        margin-top: 8px;
    }
    .question-image {
        float: none;
        max-width: 100%;
        margin: 0 0 15px 0;
    }
}

/* Voting Section */
.voting-section {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
}

.voting-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.voting-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.vote-btn:hover {
    border-color: var(--primary-blue);
    background: #f0f7ff;
}

.vote-btn.voted {
    border-color: var(--accent-green);
    background: #ecfdf5;
}

.vote-btn.vote-up.voted {
    border-color: #16a34a;
    background: #dcfce7;
}

.vote-btn.vote-down.voted {
    border-color: #dc2626;
    background: #fee2e2;
}

.vote-icon {
    font-size: 1.3rem;
}

.vote-label {
    font-weight: 500;
}

.vote-count {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.voting-thanks {
    margin-top: 12px;
    color: var(--accent-green);
    font-weight: 500;
}

@media (max-width: 480px) {
    .vote-btn {
        padding: 10px 16px;
    }
    .vote-label {
        display: none;
    }
}
