/* faq.css */

.faq-main {
    flex-grow: 1;
    padding: 80px 0;
    background-color: #1a1a2e;
}

.faq-section {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding-bottom: 50px; /* Space above chatbot if it were fixed to bottom */
}

.faq-section h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #e0e0e0, #8a2be2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.faq-section .section-description {
    font-size: 1.1rem;
    color: #c0c0c0;
    margin-bottom: 40px;
}

.faq-item {
    background-color: #20203a;
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.faq-item:hover {
    transform: translateY(-5px);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 25px;
    background-color: #2c2c4a;
    color: #f0f0f0;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: left;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 12px;
}

.faq-question:hover {
    background-color: #3a3a5a;
}

.faq-question::after {
    content: '\25BC'; /* Down arrow */
    font-size: 1rem;
    color: #8a2be2;
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    content: '\25B2'; /* Up arrow */
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 25px;
    background-color: #20203a;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.faq-answer.active {
    max-height: 200px; /* Adjust based on expected content length */
    padding: 15px 25px 20px;
}

.faq-answer p {
    color: #c0c0c0;
    line-height: 1.7;
    margin-bottom: 0;
}

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}

.chatbot-toggle-btn {
    background: linear-gradient(to right, #8a2be2, #4c00a0);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(138, 43, 226, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.7);
}

.chatbot-toggle-btn i {
    font-size: 1.4rem;
}

.chatbot-box {
    position: absolute;
    bottom: calc(100% + 20px); /* Position above the toggle button */
    right: 0;
    width: 350px;
    height: 450px;
    background-color: #20203a;
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 50px rgba(138, 43, 226, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

.chatbot-box.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot-header {
    background-color: #2c2c4a;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}

.chatbot-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.2rem;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.chatbot-close-btn:hover {
    color: #8a2be2;
}

.chatbot-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #20203a;
}

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #2c2c4a;
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #8a2be2;
    border-radius: 10px;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 0.95rem;
    word-wrap: break-word; /* Ensure long words break */
}

.bot-message {
    background-color: #3a3a5a;
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 5px; /* So it looks like it's coming from the bot */
}

.user-message {
    background-color: #8a2be2;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 5px; /* So it looks like it's coming from the user */
}

.chatbot-input {
    display: flex;
    padding: 15px 20px;
    background-color: #2c2c4a;
    border-top: 1px solid rgba(138, 43, 226, 0.2);
}

.chatbot-input input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #4a4a6a;
    border-radius: 20px;
    background-color: #20203a;
    color: #e0e0e0;
    font-size: 1rem;
    margin-right: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-input input:focus {
    border-color: #8a2be2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.3);
}

.chatbot-input input::placeholder {
    color: #80809b;
}

.chatbot-input button {
    background: linear-gradient(to right, #8a2be2, #4c00a0);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(138, 43, 226, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.6);
}

/* Active link in navbar for current page */
.nav-links ul li a.active-link {
    color: #8a2be2;
}

.nav-links ul li a.active-link::after {
    width: 100%;
}


/* Responsive */
@media (max-width: 768px) {
    .faq-section h1 {
        font-size: 2.5rem;
    }
    .faq-question {
        font-size: 1.1rem;
    }
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
    .chatbot-box {
        width: 300px;
        height: 400px;
    }
    .chatbot-toggle-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .faq-section {
        padding: 30px 0;
    }
    .faq-section h1 {
        font-size: 2rem;
    }
    .faq-question {
        font-size: 1rem;
        padding: 15px 20px;
    }
    .faq-answer.active {
        padding: 10px 20px 15px;
    }
    .chatbot-box {
        width: calc(100vw - 40px); /* Full width minus margins */
        right: auto;
        left: 20px;
    }
}
