/**
 * Topbar Panels - Accessibility & FAQ
 * Dropdown panels triggered from topbar buttons
 */

/* Topbar button active state */
.topbar-icon-btn.active {
    background: var(--primary-subtle, rgba(184, 107, 76, 0.1));
    color: var(--primary, #B86B4C);
}

/* Shared Panel Styles */
.a11y-panel,
.faq-panel {
    position: fixed;
    top: 64px;
    right: 24px;
    width: 340px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
}

.a11y-panel.open,
.faq-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Panel Header */
.a11y-panel-header,
.faq-panel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #B86B4C 0%, #9A5840 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.a11y-panel-header h3,
.faq-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.a11y-panel-close,
.faq-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.a11y-panel-close:hover,
.faq-panel-close:hover {
    opacity: 1;
}

/* Panel Body */
.a11y-panel-body,
.faq-panel-body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 400px;
}

/* ================================
   ACCESSIBILITY PANEL
   ================================ */

.a11y-control {
    margin-bottom: 16px;
}

.a11y-control:last-child {
    margin-bottom: 0;
}

.a11y-control > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.a11y-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-buttons button {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #f8f7f5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.a11y-buttons button:hover {
    border-color: #B86B4C;
    color: #B86B4C;
}

.a11y-value {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.a11y-select {
    display: flex;
    gap: 8px;
}

.a11y-select button {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #f8f7f5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.a11y-select button:hover {
    border-color: #B86B4C;
}

.a11y-select button.active {
    background: #B86B4C;
    border-color: #B86B4C;
    color: white;
}

.a11y-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.a11y-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #B86B4C;
}

.a11y-reset {
    width: 100%;
    padding: 10px;
    margin-top: 16px;
    background: #f8f7f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.a11y-reset:hover {
    background: #eee;
}

/* ================================
   FAQ PANEL
   ================================ */

.faq-panel-body {
    position: relative;
    padding: 0;
    min-height: 280px;
}

.faq-categories {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-category-btn {
    padding: 12px 16px;
    background: #f8f7f5;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-category-btn:hover {
    background: #FDF8F5;
    border-color: #B86B4C;
}

.faq-category-btn.active {
    background: #B86B4C;
    color: white;
}

.faq-category-btn span {
    font-size: 18px;
}

/* Answers Panel */
.faq-answers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 16px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.faq-answers.active {
    transform: translateX(0);
}

.faq-back {
    background: none;
    border: none;
    color: #B86B4C;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
    font-weight: 500;
}

.faq-back:hover {
    text-decoration: underline;
}

.faq-answers h4 {
    margin: 0 0 16px;
    font-size: 15px;
    color: #1a1a1a;
}

.faq-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-question {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.faq-question:hover {
    border-color: #B86B4C;
}

.faq-q {
    padding: 12px 14px;
    font-weight: 500;
    font-size: 13px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-q::after {
    content: '+';
    font-size: 18px;
    color: #B86B4C;
    transition: transform 0.2s ease;
}

.faq-question.open .faq-q::after {
    transform: rotate(45deg);
}

.faq-a {
    padding: 0 14px;
    max-height: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    transition: all 0.3s ease;
}

.faq-question.open .faq-a {
    padding: 0 14px 12px;
    max-height: 200px;
}

.faq-a a {
    color: #B86B4C;
    font-weight: 500;
}

.faq-a a:hover {
    text-decoration: underline;
}

/* FAQ Footer */
.faq-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.faq-panel-footer a {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #f8f7f5;
    color: #333;
}

.faq-panel-footer a:hover {
    background: #eee;
}

.faq-panel-footer .faq-book-btn {
    background: #B86B4C;
    color: white;
}

.faq-panel-footer .faq-book-btn:hover {
    background: #9A5840;
}

/* ================================
   ACCESSIBILITY EFFECTS
   ================================ */

/* High contrast mode */
.a11y-contrast-high {
    filter: contrast(1.3);
}

/* Dyslexia font */
.a11y-dyslexia-font {
    font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
}

.a11y-dyslexia-font * {
    font-family: inherit !important;
}

/* Reduce motion */
.a11y-reduce-motion,
.a11y-reduce-motion * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */

@media (max-width: 600px) {
    .a11y-panel,
    .faq-panel {
        right: 12px;
        left: 12px;
        width: auto;
        top: 60px;
    }
}
