/**
 * FAQ Styles
 * Bruger tema-farver
 */

/* === Container === */
.mifon-faq {
    width: 100%;
}

/* === Category === */
.faq-category {
    margin-bottom: 3rem;
}

.faq-category:last-child {
    margin-bottom: 0;
}

.faq-category-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.faq-category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    margin: 0;
}

.faq-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    background: var(--teal);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.faq-category-desc {
    margin: 0.5rem 0 0;
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* === FAQ Items === */
.faq-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: var(--teal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.faq-item.is-open {
    border-color: var(--teal);
    box-shadow: 0 4px 16px var(--teal-glow);
}

/* === Question Button === */
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: var(--gray-50);
}

.faq-item.is-open .faq-question {
    background: var(--teal-light);
}

.faq-question-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--black);
    line-height: 1.4;
}

.faq-item.is-open .faq-question-text {
    color: var(--teal-dark);
}

/* Skift titel ved åben/lukket */
.faq-title-open {
    display: none;
}

.faq-item.has-open-title.is-open .faq-title-closed {
    display: none;
}

.faq-item.has-open-title.is-open .faq-title-open {
    display: inline;
}

/* === Icon === */
.faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--gray-400);
    transition: all 0.3s ease;
}

.faq-icon svg {
    width: 100%;
    height: 100%;
}

.faq-icon-minus {
    display: none;
}

.faq-item.is-open .faq-icon {
    color: var(--teal);
}

.faq-item.is-open .faq-icon-plus {
    display: none;
}

.faq-item.is-open .faq-icon-minus {
    display: block;
}

/* === Answer === */
.faq-answer {
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

.faq-answer-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--gray-700);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-answer-content p {
    margin: 0 0 1rem;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.faq-answer-content a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}

.faq-answer-content a:hover {
    text-decoration: underline;
}

.faq-answer-content ul,
.faq-answer-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.faq-answer-content li {
    margin-bottom: 0.5rem;
}

.faq-answer-content strong {
    color: var(--black);
}

/* === Search Box === */
.faq-search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Alignment variants */
.faq-search--left {
    justify-content: flex-start;
}

.faq-search--center {
    justify-content: center;
}

.faq-search--center .faq-show-all {
    position: absolute;
    right: 0;
}

.faq-search--center {
    position: relative;
}

.faq-search--right {
    justify-content: flex-end;
}

.faq-search--right .faq-show-all {
    order: -1;
}

.faq-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.faq-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.faq-search-input {
    width: 100%;
    padding: 0.75rem 2.75rem;
    font-size: 0.95rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.faq-search-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
}

.faq-search-input::placeholder {
    color: var(--gray-400);
}

.faq-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--gray-400);
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-search-input:not(:placeholder-shown) + .faq-search-clear {
    opacity: 1;
}

.faq-search-clear:hover {
    color: var(--gray-600);
}

.faq-show-all {
    background: none;
    border: 1px solid var(--gray-200);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}

.faq-show-all.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.faq-show-all:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.faq-no-results {
    text-align: center;
    padding: 2rem;
    color: var(--gray-600);
    background: var(--gray-50);
    border-radius: var(--radius-xl);
}

.faq-no-results[hidden] {
    display: none;
}

/* Search highlight */
.faq-item.is-hidden {
    display: none;
}

.faq-category.is-hidden {
    display: none;
}

/* === Animations === */
@keyframes faq-expand {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-item.is-open .faq-answer-content {
    animation: faq-expand 0.3s ease forwards;
}

/* === Mobile === */
@media (max-width: 768px) {
    .faq-category {
        margin-bottom: 2rem;
    }
    
    .faq-category-title {
        font-size: 1.25rem;
    }
    
    .faq-count {
        min-width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .faq-question {
        padding: 1rem 1.25rem;
    }
    
    .faq-question-text {
        font-size: 0.95rem;
    }
    
    .faq-answer-content {
        padding: 0 1.25rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* === Print === */
@media print {
    .faq-item {
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .faq-answer {
        display: block !important;
    }
    
    .faq-answer[hidden] {
        display: block !important;
    }
    
    .faq-icon {
        display: none;
    }
}
