/* =========================================
   FAQ PAGE STYLES
   ========================================= */

/* Hero Section */
.faq-hero {
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

.faq-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.faq-hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.faq-hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(211, 47, 47, 0.08);
    color: var(--primary-color, #D32F2F);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 40px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 20px;
}

.hero-title .highlight {
    color: var(--primary-color, #D32F2F);
    position: relative;
    display: inline-block;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(211, 47, 47, 0.15);
    z-index: -1;
    border-radius: 4px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary, #4a4a68);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Bar */
.faq-search-container {
    max-width: 700px;
    margin: 0 auto;
}

.faq-search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 60px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #e2e8f0);
    transition: all 0.3s ease;
}

.faq-search-wrapper:focus-within {
    box-shadow: 0 15px 40px rgba(211, 47, 47, 0.1);
    border-color: var(--primary-color, #D32F2F);
}

.search-icon {
    color: var(--text-muted, #6b6b8a);
    margin-right: 10px;
}

.faq-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 15px 0;
    background: transparent;
    font-family: inherit;
}

.faq-search-input::placeholder {
    color: #a0aec0;
}

.faq-search-btn {
    background: var(--primary-color, #D32F2F);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.faq-search-btn:hover {
    background: var(--primary-dark, #B71C1C);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.25);
}

.search-suggestions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-suggestions span {
    color: var(--text-muted, #6b6b8a);
    font-size: 0.9rem;
    font-weight: 500;
}

.suggestion-tag {
    background: white;
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-secondary, #4a4a68);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.suggestion-tag:hover {
    background: rgba(211, 47, 47, 0.05);
    border-color: var(--primary-color, #D32F2F);
    color: var(--primary-color, #D32F2F);
}

/* Category Tabs */
.faq-categories {
    padding: 40px 0 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.categories-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 12px;
}

.section-title .highlight {
    color: var(--primary-color, #D32F2F);
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary, #4a4a68);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary, #4a4a68);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.category-tab svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.category-tab:hover {
    border-color: var(--primary-color, #D32F2F);
    color: var(--primary-color, #D32F2F);
    background: rgba(211, 47, 47, 0.02);
    transform: translateY(-2px);
}

.category-tab.active {
    background: var(--primary-color, #D32F2F);
    color: white;
    border-color: var(--primary-color, #D32F2F);
}

/* FAQ Grid Layout */
.faq-accordion-section {
    padding: 20px 0 60px;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

/* FAQ Items Container */
.faq-items-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color, #e2e8f0);
}

.faq-category-group {
    margin-bottom: 40px;
}

.faq-category-group:last-child {
    margin-bottom: 0;
}

.category-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(211, 47, 47, 0.1);
}

.category-group-title svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color, #D32F2F);
}

/* FAQ Item */
.faq-item {
    margin-bottom: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(211, 47, 47, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(211, 47, 47, 0.02);
}

.faq-question[aria-expanded="true"] {
    background: rgba(211, 47, 47, 0.02);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.question-text {
    flex: 1;
    padding-right: 20px;
}

.question-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--primary-color, #D32F2F);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .question-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    background: #fafbfc;
}

.faq-answer.expanded {
    max-height: 2000px;
}

.answer-content {
    padding: 22px;
    line-height: 1.6;
    color: var(--text-secondary, #4a4a68);
}

.answer-content h4 {
    color: var(--text-primary, #1a1a2e);
    font-size: 1rem;
    font-weight: 700;
    margin: 20px 0 12px;
}

.answer-content h4:first-child {
    margin-top: 0;
}

.answer-content ul,
.answer-content ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.answer-content li {
    margin-bottom: 8px;
}

.answer-content strong {
    color: var(--text-primary, #1a1a2e);
}

/* Fix Steps */
.fix-steps {
    margin: 20px 0;
}

.step {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.step-number {
    width: 30px;
    height: 30px;
    background: rgba(211, 47, 47, 0.1);
    color: var(--primary-color, #D32F2F);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    margin-bottom: 4px;
}

.step-content p {
    margin: 0;
    font-size: 0.95rem;
}

/* Tip and Warning Boxes */
.tip-box {
    background: rgba(211, 47, 47, 0.05);
    border-left: 4px solid var(--primary-color, #D32F2F);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.warning-box {
    background: rgba(255, 152, 0, 0.08);
    border-left: 4px solid #ff9800;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Causes Grid */
.causes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.cause {
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.cause h5 {
    color: var(--primary-color, #D32F2F);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.cause p {
    font-size: 0.9rem;
    margin: 0;
}

/* Cooling Solutions */
.cooling-solutions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.solution {
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.solution h5 {
    color: var(--primary-color, #D32F2F);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.solution p {
    font-size: 0.9rem;
    margin: 0;
}

/* Preformatted Text */
pre {
    background: #1e1e2e;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 15px 0;
}

code {
    font-family: 'Courier New', monospace;
}

/* Flowchart */
.flowchart {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px dashed var(--primary-color, #D32F2F);
    margin: 15px 0;
}

.flowchart p {
    margin: 5px 0;
    font-family: monospace;
}

/* Response Times */
.response-times {
    margin: 20px 0;
}

.response-tier {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
}

.tier.critical { color: #dc2626; font-weight: 600; }
.tier.high { color: #f97316; font-weight: 600; }
.tier.medium { color: #3b82f6; font-weight: 600; }
.tier.low { color: #6b7280; font-weight: 600; }

.time {
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
}

/* Security Services */
.security-services {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.service-badge {
    background: white;
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-secondary, #4a4a68);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.service-badge:hover {
    background: rgba(211, 47, 47, 0.05);
    border-color: var(--primary-color, #D32F2F);
    color: var(--primary-color, #D32F2F);
}

/* Compliance Grid */
.compliance-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.compliance-item {
    background: rgba(211, 47, 47, 0.05);
    color: var(--primary-color, #D32F2F);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Cloud Platforms */
.cloud-platforms {
    margin: 20px 0;
}

.platform {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.platform-name {
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
}

.platform-level {
    color: var(--primary-color, #D32F2F);
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(211, 47, 47, 0.05);
    padding: 2px 10px;
    border-radius: 20px;
}

/* Package Features */
.package-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.feature {
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.feature h4 {
    color: var(--primary-color, #D32F2F);
    margin-bottom: 12px;
    font-size: 1rem;
}

.feature ul {
    margin: 0;
    padding-left: 18px;
}

.feature li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* Consultancy Services */
.consultancy-services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.consultancy-item {
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.consultancy-item h4 {
    color: var(--primary-color, #D32F2F);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.consultancy-item p {
    font-size: 0.9rem;
    margin: 0;
}

/* Audit Process */
.audit-process {
    margin: 20px 0;
}

.process-step {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.process-step .step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color, #D32F2F);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step-content h5 {
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 5px;
}

.step-content p {
    font-size: 0.9rem;
    color: var(--text-secondary, #4a4a68);
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 60px 20px;
    background: #fafbfc;
    border-radius: 16px;
    margin: 40px 0;
}

.no-results-message svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-message h3 {
    font-size: 1.3rem;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 10px;
}

.no-results-message p {
    color: var(--text-secondary, #4a4a68);
}

/* Sidebar Styles */
.faq-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.help-card,
.error-codes-card,
.popular-topics-card,
.resources-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color, #e2e8f0);
}

.help-card {
    text-align: center;
    background: linear-gradient(135deg, #f8f9fc 0%, white 100%);
}

.help-card-icon {
    margin-bottom: 16px;
}

.help-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 10px;
}

.help-card p {
    color: var(--text-secondary, #4a4a68);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.help-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color, #D32F2F);
    color: white;
    text-decoration: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.help-cta:hover {
    background: var(--primary-dark, #B71C1C);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.25);
}

.help-cta svg {
    transition: transform 0.3s ease;
}

.help-cta:hover svg {
    transform: translateX(4px);
}

/* Error Codes Card */
.error-codes-card h3,
.popular-topics-card h3,
.resources-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(211, 47, 47, 0.1);
}

.error-list {
    list-style: none;
    padding: 0;
}

.error-list li {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
}

.error-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary-color, #D32F2F);
    background: rgba(211, 47, 47, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    min-width: 90px;
}

.error-desc {
    color: var(--text-secondary, #4a4a68);
    font-size: 0.9rem;
    margin-left: 12px;
}

/* Topic Tags */
.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-tag {
    background: #f1f5f9;
    color: var(--text-secondary, #4a4a68);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.topic-tag:hover {
    background: rgba(211, 47, 47, 0.05);
    color: var(--primary-color, #D32F2F);
    border-color: var(--primary-color, #D32F2F);
}

/* Resource List */
.resource-list {
    list-style: none;
    padding: 0;
}

.resource-list li {
    margin-bottom: 10px;
}

.resource-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.resource-list a:hover {
    background: white;
    border-color: var(--primary-color, #D32F2F);
    transform: translateX(4px);
}

.resource-list svg {
    stroke: var(--primary-color, #D32F2F);
    flex-shrink: 0;
}

.resource-list span {
    flex: 1;
    color: var(--text-primary, #1a1a2e);
    font-size: 0.95rem;
    font-weight: 500;
}

.file-size {
    color: var(--text-muted, #6b6b8a);
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    flex: 0 !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .faq-grid {
        grid-template-columns: 1fr 280px;
        gap: 30px;
    }
}

@media (max-width: 900px) {
    .hero-title {
        font-size: 2.3rem;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-sidebar {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }
    
    .package-features {
        grid-template-columns: 1fr;
    }
    
    .consultancy-services {
        grid-template-columns: 1fr;
    }
    
    .causes-grid {
        grid-template-columns: 1fr;
    }
    
    .cooling-solutions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .faq-hero {
        padding: 40px 0 30px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .faq-search-wrapper {
        flex-direction: column;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }
    
    .faq-search-input {
        width: 100%;
        background: white;
        padding: 15px 20px;
        border-radius: 40px;
        margin-bottom: 10px;
        border: 1px solid var(--border-color, #e2e8f0);
    }
    
    .faq-search-btn {
        width: 100%;
    }
    
    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 15px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-tab {
        flex: 0 0 auto;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .faq-items-container {
        padding: 20px;
    }
    
    .faq-question {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .answer-content {
        padding: 15px;
    }
    
    .step {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-badge {
        font-size: 0.7rem;
    }
    
    .category-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .category-tab svg {
        width: 16px;
        height: 16px;
    }
    
    .faq-items-container {
        padding: 15px;
    }
    
    .category-group-title {
        font-size: 1.1rem;
    }
    
    .faq-question {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .answer-content {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .platform {
        flex-direction: column;
        gap: 5px;
    }
    
    .platform-level {
        align-self: flex-start;
    }
    
    .error-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .resource-list a {
        flex-wrap: wrap;
    }
    
    .file-size {
        margin-left: auto;
    }
}

/* Print Styles */
@media print {
    .faq-hero,
    .faq-categories,
    .faq-sidebar,
    .faq-search-container,
    .category-tabs {
        display: none;
    }
    
    .faq-items-container {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .faq-answer {
        max-height: none !important;
        display: block !important;
    }
    
    .faq-question {
        background: none;
        border: none;
    }
    
    .question-icon {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary-color, #D32F2F);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .faq-item {
        border: 2px solid var(--text-primary, #1a1a2e);
    }
    
    .category-tab.active {
        border: 2px solid black;
    }
}