/* ========================================
   Chatbot & FAQ Styles
   ======================================== */

/* Chat Widget Toggle Button */
.chat-widget-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 50%, #ffd54f 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-glow 2s ease-in-out infinite;
}

.chat-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(255, 193, 7, 0.5), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.chat-widget-toggle svg {
    width: 30px;
    height: 30px;
    color: #050c1f;
    transition: transform 0.3s ease;
}

.chat-widget-toggle.active svg.chat-icon {
    display: none;
}

.chat-widget-toggle.active svg.close-icon {
    display: block;
}

.chat-widget-toggle svg.close-icon {
    display: none;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(255, 193, 7, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 40px rgba(255, 193, 7, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: linear-gradient(165deg, rgba(10, 25, 61, 0.98) 0%, rgba(5, 12, 31, 0.99) 100%);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 10px 40px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: none; /* Use display:none instead of visibility:hidden to fully remove from layout */
    flex-direction: column;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 193, 7, 0.2);
    overflow: hidden;
    pointer-events: none;
}

.chat-widget.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chat Header */
.chat-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.chat-header-avatar svg {
    width: 26px;
    height: 26px;
    color: #050c1f;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.chat-header-info {
    flex: 1;
}

.chat-header-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: 1px;
    margin: 0;
}

.chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.lang-btn.active {
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
    color: #050c1f;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* Chat Tabs */
.chat-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    margin: 12px 16px 0;
    border-radius: 12px;
}

.chat-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.chat-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.chat-tab.active {
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
    color: #050c1f;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

/* Chat Content Area */
.chat-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chat-panel.active {
    opacity: 1;
    visibility: visible;
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 193, 7, 0.5);
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

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

.message.bot {
    flex-direction: row;
}

.message.user {
    flex-direction: row-reverse;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 75%;
}

.message.user .message-content {
    align-items: flex-end;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
}

.message.bot .message-avatar svg {
    width: 20px;
    height: 20px;
    color: #050c1f;
}

.message.bot .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.message.user .message-avatar svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #fff;
    width: fit-content;
    max-width: 100%;
}

.message.bot .message-bubble {
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(139, 92, 246, 0.6) 100%);
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.message-timestamp {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 4px;
    font-weight: 500;
}

.message.user .message-timestamp {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 193, 7, 0.6);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Rate Limit Shake Animation */
@keyframes rateLimitShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.rate-limit-shake {
    animation: rateLimitShake 0.5s ease-in-out;
}

/* Rate Limit Warning Message */
.rate-limit-warning {
    animation: messageSlide 0.3s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
}

.rate-limit-warning .message-bubble {
    background: rgba(239, 68, 68, 0.15);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
}

.rate-limit-warning .message-avatar svg {
    color: #ef4444;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    padding: 6px 0;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    color: #050c1f;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
}

.quick-action-btn {
    padding: 8px 14px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
    color: #ffc107;
    font-size: 0.8rem;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
    transform: translateY(-2px);
}

/* FAQ Panel */
.faq-container {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.faq-container::-webkit-scrollbar {
    width: 6px;
}

.faq-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.faq-container::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.3);
    border-radius: 3px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(255, 193, 7, 0.3);
}

.faq-question {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: #ffc107;
}

.faq-question svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: rgba(255, 193, 7, 0.6);
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

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

.faq-answer-content {
    padding: 0 20px 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.6;
}

.faq-answer-content strong {
    color: #ffc107;
}

.faq-answer-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.faq-answer-content li {
    margin-bottom: 6px;
}

/* Pricing Info in FAQ */
.pricing-info {
    background: rgba(255, 193, 7, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 10px;
}

.pricing-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.pricing-info-row:last-child {
    border-bottom: none;
}

.pricing-info-row span:first-child {
    color: rgba(255, 255, 255, 0.8);
}

.pricing-info-row span:last-child {
    color: #ffc107;
    font-weight: 600;
}

/* Responsive Styles */
@media (max-width: 480px) {
    .chat-widget-toggle {
        bottom: 20px;
        right: 20px;
        width: 58px;
        height: 58px;
    }

    .chat-widget {
        bottom: 95px;
        right: 15px;
        left: 15px;
        width: auto;
        max-width: none;
        height: calc(100vh - 130px);
        max-height: none;
        border-radius: 20px;
    }

    .chat-header {
        padding: 16px 18px;
    }

    .chat-header-avatar {
        width: 42px;
        height: 42px;
    }

    .chat-header-title {
        font-size: 1.1rem;
    }

    .chat-tabs {
        margin: 10px 12px 0;
    }

    .chat-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .chat-messages {
        padding: 16px 12px;
    }

    .message-bubble {
        max-width: 80%;
    }

    .quick-actions {
        padding: 0 12px 10px;
    }

    .quick-action-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .chat-input-container {
        padding: 12px;
    }

    .faq-container {
        padding: 12px;
    }
}

/* Audio Samples Styling */
.audio-samples-container {
    margin: 12px 0;
    width: 100%;
}

.audio-samples-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    color: #ffc107;
    margin: 0 0 12px 0;
    letter-spacing: 1px;
}

.audio-samples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.audio-sample-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-sample-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 193, 7, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.audio-sample-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #000;
}

.audio-sample-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-sample-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 193, 7, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-sample-card:hover .audio-sample-play-btn {
    opacity: 1;
}

.audio-sample-play-btn svg {
    width: 20px;
    height: 20px;
    color: #050c1f;
    margin-left: 2px;
}

.audio-sample-info {
    padding: 8px;
}

.audio-sample-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.audio-sample-category {
    font-size: 0.7rem;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audio-samples-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-style: italic;
}

/* Tablet responsiveness */
@media (max-width: 768px) and (min-width: 481px) {
    .chat-widget-toggle {
        bottom: 25px;
        right: 25px;
        width: 60px;
        height: 60px;
    }

    .chat-widget {
        bottom: 100px;
        right: 20px;
        width: 380px;
        height: 500px;
    }
}

/* Audio folder adjustment when chat is open (desktop only) */
@media (min-width: 769px) {
    .audio-folder.chat-open {
        right: 450px;
    }
}
