/* Pool Repair Q&A - Questions Pages Styles */

:root {
    --primary-blue: #1e40af;
    --primary-hover: #1e3a8a;
    --accent-orange: #ea580c;
    --accent-green: #16a34a;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-light: #e5e7eb;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.logo img {
    width: 32px;
    height: 32px;
}

.logo i {
    color: var(--accent-orange);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-gray);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--primary-blue);
}

.nav-links a.nav-highlight {
    background: var(--accent-green);
    color: white !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.nav-links a.nav-highlight:hover {
    background: #15803d;
    text-decoration: none;
}

/* Guides Dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-gray);
    font-weight: 500;
}
.nav-dropdown > a::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    transition: transform 0.2s;
}
.nav-dropdown:hover > a {
    color: var(--primary-blue);
}
.nav-dropdown:hover > a::after {
    transform: rotate(180deg);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    min-width: 280px;
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 200;
}
.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-header {
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-dark);
    font-size: 0.9rem;
    transition: background 0.15s;
}
.dropdown-menu a:hover {
    background: var(--bg-light);
    text-decoration: none;
    color: var(--primary-blue);
}
.dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: var(--primary-blue);
    opacity: 0.7;
}
.dropdown-menu a:hover i {
    opacity: 1;
}
.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}
.dropdown-menu .view-all {
    margin: 8px 12px 4px;
    padding: 10px 14px;
    background: var(--primary-blue);
    color: white !important;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    justify-content: center;
}
.dropdown-menu .view-all:hover {
    background: var(--primary-hover);
}
.dropdown-menu .view-all i {
    color: white;
    opacity: 1;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    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: 900px;
    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 */
.answer-content {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.answer-content h2 {
    font-size: 1.4rem;
    margin: 25px 0 15px 0;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 10px;
}

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

.answer-content h3 {
    font-size: 1.15rem;
    margin: 20px 0 10px 0;
    color: var(--text-dark);
}

.answer-content p {
    margin-bottom: 15px;
    color: var(--text-gray);
}

.answer-content ul, .answer-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.answer-content li {
    margin-bottom: 10px;
    color: var(--text-gray);
}

.answer-content strong {
    color: var(--text-dark);
}

/* 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 */
.quick-answer {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-left: 4px solid var(--primary-blue);
    padding: 20px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 25px;
}

.quick-answer h2 {
    margin: 0 0 10px 0 !important;
    border: none !important;
    padding: 0 !important;
    font-size: 1.1rem !important;
    color: var(--primary-blue) !important;
}

.quick-answer p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-dark);
}

/* 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;
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .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: 500px;
    padding: 20px;
    border-top: 1px solid var(--border-light);
}

.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;
    }
}
