/* ========================================
   FAQ - Specific styling
   Uses base variables from theme.css
   ======================================== */

/* Base wrapper */
.tty-faq-wrapper {
    position: relative;
    overflow: hidden;
    font-family: inherit;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Decorative pattern background */
.tty-faq-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 9%;
    width: 40%;
    height: 100%;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5v10m0 30v10m-20-25h10m30 0h10' stroke='%23005F5F' stroke-width='1'/%3E%3Ccircle cx='30' cy='30' r='5' fill='%23005F5F'/%3E%3Ccircle cx='30' cy='15' r='2' fill='%23005F5F'/%3E%3Ccircle cx='30' cy='45' r='2' fill='%23005F5F'/%3E%3Ccircle cx='20' cy='30' r='2' fill='%23005F5F'/%3E%3Ccircle cx='40' cy='30' r='2' fill='%23005F5F'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Direct children above pattern */
.tty-faq-wrapper > * {
    position: relative;
    z-index: 1;
}

/* Banner section */
.tty-faq-banner {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
    margin-top: 40px;
}


.tty-faq-subtitle {
    font-size: 18px;
    margin: 0 0 30px;
    opacity: 0.9;
}

.tty-hero-title {
    margin: 0px 0px 10px 0px;
}

/* Search Box */
.tty-faq-search {
    max-width: 600px;
    margin: 0 auto;
}

.tty-faq-content {
  margin: 0 auto;
  text-align: center;
}

.tty-faq-search-box {
    position: relative;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 10px 25px;
}

.tty-faq-search-box i {
    color: var(--tty-primary);
    font-size: 20px;
    margin-right: 15px;
}

#faq-search {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
}

#clear-search {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#clear-search:hover {
    color: var(--tty-primary);
}

.tty-faq-search-results {
    text-align: center;
    margin-top: 15px;
    color: var(--tty-primary);
    font-weight: 600;
}

/* Container layout */
.tty-faq-container {
    display: flex;
    gap: 40px;
}

/* Sidebar navigation */
.tty-faq-sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 150px;
    height: fit-content;
}

.tty-faq-nav-block,
.tty-faq-help-block,
.tty-faq-popular-block {
    background-color: var(--tty-bg-secondary);
    border-radius: 30px;
    padding: 20px;
    margin-bottom: 20px;
}

.tty-faq-nav-block h3,
.tty-faq-help-block h3,
.tty-faq-popular-block h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
}

.tty-faq-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#faq-search:focus {
  box-shadow: none !important;
}

.tty-faq-nav-list li {
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--tty-text-light) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 8px;
}

.tty-faq-nav-list a {
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: var(--tty-transition-normal);
    position: relative;
}

.tty-faq-nav-list a:hover,
.tty-faq-nav-list a.active {
    background: var(--tty-bg-linear-graniet);
    color: var(--tty-text-light);
}

.tty-faq-nav-list a i {
    width: 20px;
    text-align: center;
}

.tty-faq-nav-list a span:first-of-type {
    flex: 1;
}

.tty-faq-count {
    background: rgba(0, 95, 95, 0.1);
    color: var(--tty-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tty-faq-nav-list a:hover .tty-faq-count,
.tty-faq-nav-list a.active .tty-faq-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Help Block */
.tty-faq-help-block p {
    margin-bottom: 20px;
    color: var(--tty-text-secondary);
}

.tty-faq-contact-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tty-faq-contact-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--tty-text-light) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 10px;
    text-decoration: none;
    color: var(--tty-text-primary);
    transition: all 0.3s ease;
}

.tty-faq-contact-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--tty-primary);
}

.tty-faq-contact-btn i {
    width: 20px;
    text-align: center;
    color: var(--tty-primary);
}

/* Popular Block */
.tty-faq-popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tty-faq-popular-list li {
    margin-bottom: 10px;
}

.tty-faq-popular-list a {
    color: var(--tty-primary);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 5px 0;
    transition: all 0.3s ease;
}

.tty-faq-popular-list a:hover {
    transform: translateX(5px);
    color: var(--tty-primary-dark);
}

/* Main content area */
.tty-faq-content-main {
    flex: 1;
}

/* Action Buttons */
.tty-faq-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: flex-end;
}

.tty-faq-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--tty-bg-secondary);
    border: 1px solid rgba(0, 95, 95, 0.1);
    border-radius: 25px;
    color: var(--tty-text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tty-faq-action-btn:hover {
    background: linear-gradient(135deg, var(--tty-primary) 0%, #00a896 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* FAQ Categories */
.tty-faq-category {
    display: none;
    background-color: var(--tty-bg-secondary);
    border-radius: 30px;
    padding: 30px;
    margin-bottom: 30px;
}

.tty-faq-category.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.tty-faq-category-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 95, 95, 0.1);
}

.tty-faq-category-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(0, 95, 95, 0.1) 0%, rgba(0, 168, 150, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tty-primary);
    font-size: 22px;
}

.tty-faq-category-header h2 {
    margin: 0;
    color: var(--tty-primary);
    font-size: 28px;
}

/* FAQ Items */
.tty-faq-questions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tty-faq-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.tty-faq-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tty-faq-item.highlight {
    border: 2px solid var(--tty-primary);
    animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.tty-faq-question {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tty-faq-question:hover {
    background: rgba(0, 95, 95, 0.02);
}

.tty-faq-question h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--tty-text-primary);
    flex: 1;
    padding-right: 20px;
}

.tty-faq-question-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tty-faq-copy {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.tty-faq-item:hover .tty-faq-copy {
    opacity: 1;
}

.tty-faq-copy:hover {
    color: var(--tty-primary);
}

.tty-faq-copy.copied {
    color: #27ae60;
}

.tty-faq-toggle-icon {
    color: var(--tty-primary);
    transition: all 0.3s ease;
}

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

.tty-faq-answer {
    background: linear-gradient(135deg, rgba(0, 95, 95, 0.02) 0%, rgba(0, 168, 150, 0.02) 100%);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tty-faq-item.active .tty-faq-answer {
    max-height: 1000px;
}

.tty-faq-answer-content {
    padding: 0 25px 20px;
}

.tty-faq-answer-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--tty-text-secondary);
}

.tty-faq-answer-content strong {
    color: var(--tty-text-primary);
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
}

.tty-faq-answer-content strong:first-child {
    margin-top: 0;
}

/* Feedback */
.tty-faq-feedback {
    padding: 15px 25px;
    border-top: 1px solid rgba(0, 95, 95, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.tty-faq-feedback span {
    color: var(--tty-text-secondary);
    font-size: 14px;
}

.tty-faq-helpful {
    background: none;
    border: 1px solid rgba(0, 95, 95, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--tty-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tty-faq-helpful:hover {
    background: rgba(0, 95, 95, 0.05);
    border-color: var(--tty-primary);
    color: var(--tty-primary);
}

.tty-faq-helpful.selected {
    background: var(--tty-primary);
    color: white;
    border-color: var(--tty-primary);
}

/* Contact CTA */
.tty-faq-contact-cta {
    background: linear-gradient(135deg, var(--tty-primary) 0%, #00a896 100%);
    border-radius: 30px;
    margin: 60px 0 150px;
    overflow: hidden;
    position: relative;
}

.tty-faq-contact-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.tty-faq-cta-container {
    padding: 50px 30px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.tty-faq-cta-container h2 {
    color: white;
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 32px;
}

.tty-faq-cta-container p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-size: 18px;
}

.tty-faq-cta-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tty-faq-cta-button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 20px 30px;
    background: white;
    color: var(--tty-primary);
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    min-width: 180px;
}

.tty-faq-cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: var(--tty-primary);
}

.tty-faq-cta-button.tty-faq-primary {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
}

.tty-faq-cta-button.tty-faq-primary:hover {
    color: white;
}

.tty-faq-cta-button i {
    font-size: 28px;
    margin-bottom: 5px;
}

.tty-faq-cta-button span {
    font-weight: 600;
    font-size: 18px;
}

.tty-faq-cta-button small {
    font-size: 14px;
    opacity: 0.8;
}

.tty-faq-contact-cta .heartbeat polyline {
    stroke: rgba(255, 255, 255, 0.4);
}

/* Search Highlighting */
.tty-faq-item.search-match {
    border: 2px solid var(--tty-primary);
}

.tty-faq-item.search-hidden {
    display: none !important;
}

.search-highlight {
    background: rgba(255, 193, 7, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Dark theme adjustments */
[data-theme="dark"] .tty-faq-wrapper::before {
    opacity: 0.03;
}

[data-theme="dark"] .tty-faq-item,
[data-theme="dark"] .tty-faq-contact-btn,
[data-theme="dark"] .tty-faq-action-btn {
    background-color: var(--tty-bg-tertiary);
}

[data-theme="dark"] .tty-faq-search-box {
    background: var(--tty-bg-tertiary);
}

/* Responsive Design */
@media (max-width: 992px) {
    /* Reverse order: content first, sidebar below */
    .tty-faq-container {
        flex-direction: column-reverse;
    }
    
    .tty-faq-sidebar {
        position: relative;
        top: 0;
        flex: 1 1 auto;
        width: 100%;
        margin-bottom: 0;
        margin-top: 30px;
    }
    
    /* Show all categories, no toggle needed */
    .tty-faq-category {
        display: block !important;
    }
    
    /* Hide category navigation block (redundant on mobile) */
    .tty-faq-nav-block,
    .tty-faq-help-block,
    .tty-faq-popular-block {
        display: none;
    }
    
    .tty-faq-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .tty-faq-wrapper::before {
        display: none;
    }
    
    .tty-faq-cta-options {
        flex-direction: column;
        align-items: center;
    }
    
    /* Banner section */
    .tty-faq-banner {
        margin-top: 20px;
    }
    
    .tty-faq-cta-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .tty-faq-category {
        padding: 20px 15px;
    }
    
    .tty-faq-category-header h2 {
        font-size: 22px;
    }
    
    .tty-faq-question h3 {
        font-size: 15px;
    }
    
    .tty-faq-cta-container {
        padding: 30px 20px;
    }
    
    .tty-faq-cta-container h2 {
        font-size: 24px;
    }
}

/* Print styles */
@media print {
    .tty-faq-sidebar,
    .tty-faq-search,
    .tty-faq-actions,
    .tty-faq-feedback,
    .tty-faq-contact-cta,
    .tty-faq-copy {
        display: none !important;
    }
    
    .tty-faq-container {
        flex-direction: column;
    }
    
    .tty-faq-category {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .tty-faq-item {
        page-break-inside: avoid;
    }
    
    .tty-faq-answer {
        max-height: none !important;
    }
}