/* ===========================================
   SYNTHIA SUPPORT BOT - daddla-web Version
   =========================================== */

/* Floating Synthia Button (Bottom Left) */
.synthia-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.6);
    background: linear-gradient(135deg, #1a1225 0%, #0F0D15 100%);
    cursor: pointer;
    z-index: 9997;
    overflow: visible;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.synthia-floating-btn:hover {
    transform: scale(1.1);
    border-color: #8B5CF6;
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
}

.synthia-floating-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Notification Badge */
.synthia-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: #10B981;
    border-radius: 50%;
    border: 2px solid var(--dark-bg, #0F172A);
    animation: synthia-pulse 2s infinite;
}

/* Sprechblase / Speech Bubble */
.synthia-speech-bubble {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(99, 102, 241, 0.95) 100%);
    color: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    max-width: 220px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    z-index: 9996;
    animation: bubbleIn 0.4s ease-out, bubbleFloat 3s ease-in-out infinite;
    cursor: pointer;
}

.synthia-speech-bubble .bubble-text {
    display: block;
    transition: opacity 0.2s ease;
}

.synthia-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(99, 102, 241, 0.95);
}

.synthia-speech-bubble .bubble-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #EF4444;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.synthia-speech-bubble:hover .bubble-close {
    opacity: 1;
}

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

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes synthia-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* ===========================================
   CHAT OVERLAY
   =========================================== */
.synthia-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.synthia-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===========================================
   CHAT CONTAINER
   =========================================== */
.synthia-chat {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: linear-gradient(180deg, #1a1225 0%, #0F0D15 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.synthia-chat.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Mobile Fullscreen */
@media (max-width: 480px) {
    .synthia-chat {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: translateY(100%);
    }
    
    .synthia-chat.active {
        transform: translateY(0);
    }
    
    .synthia-floating-btn {
        bottom: 20px;
        left: 20px;
        width: 46px;
        height: 46px;
    }
    
    .synthia-speech-bubble {
        bottom: 75px;
        left: 15px;
        max-width: 200px;
        font-size: 12px;
        padding: 10px 14px;
    }
}

/* ===========================================
   CHAT HEADER
   =========================================== */
.synthia-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px 20px 0 0;
}

@media (max-width: 480px) {
    .synthia-header {
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
        border-radius: 0;
    }
}

.synthia-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #8B5CF6;
    overflow: hidden;
    flex-shrink: 0;
}

.synthia-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.synthia-info {
    flex: 1;
}

.synthia-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.synthia-name .verified-badge {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #8B5CF6, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.synthia-name .verified-badge svg {
    width: 12px;
    height: 12px;
    color: #fff;
}

.synthia-status {
    font-size: 12px;
    color: #10B981;
    display: flex;
    align-items: center;
    gap: 6px;
}

.synthia-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    animation: synthia-pulse 2s infinite;
}

.synthia-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.synthia-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

/* ===========================================
   CHAT MESSAGES
   =========================================== */
.synthia-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.synthia-messages::-webkit-scrollbar-track {
    background: transparent;
}

.synthia-messages::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

/* Message Bubbles */
.synthia-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageSlide 0.3s ease;
}

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

.synthia-message.bot {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(99, 102, 241, 0.2) 100%);
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.synthia-message.user {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366f1 100%);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.synthia-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 18px;
    align-self: flex-start;
    max-width: 80px;
}

.synthia-typing span {
    width: 8px;
    height: 8px;
    background: #8B5CF6;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* ===========================================
   FAQ BUTTONS
   =========================================== */
.synthia-faq-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.synthia-faq-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.synthia-faq-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8B5CF6;
    transform: translateX(4px);
}

.synthia-faq-btn .faq-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Category Buttons */
.synthia-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.synthia-category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.synthia-category-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8B5CF6;
    transform: translateY(-2px);
}

.synthia-category-btn .cat-icon {
    font-size: 24px;
}

/* Back Button */
.synthia-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    color: #a0a0a0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.synthia-back-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #fff;
}

/* ===========================================
   INPUT AREA
   =========================================== */
.synthia-input-area {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0 0 20px 20px;
}

@media (max-width: 480px) {
    .synthia-input-area {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        border-radius: 0;
    }
}

.synthia-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.synthia-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.synthia-input:focus {
    border-color: #8B5CF6;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.synthia-input::placeholder {
    color: #666;
}

.synthia-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6366f1 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.synthia-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.5);
}

/* ===========================================
   CONTACT FORM (instead of ticket)
   =========================================== */
.synthia-contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.synthia-contact-info h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 5px;
}

.synthia-contact-info a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    color: #8B5CF6;
    text-decoration: none;
    transition: all 0.2s;
}

.synthia-contact-info a:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateX(5px);
}

.synthia-contact-info .contact-icon {
    font-size: 20px;
}
