/* Style for the Header Logo Image */
.domodz-header-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    margin-right: 10px;
    display: block;
    border-bottom-right-radius: 15px;
    border-top-left-radius: 15px;
}

/* --- MODERN FLOATING LAUNCHER --- */
.domodz-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    height: 60px;
    min-width: 60px;
    padding: 0 10px 0 15px;
    background: linear-gradient(135deg, #555, #c90d3f);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px;
    z-index: 9999; 
    animation: float 3s ease-in-out infinite;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: visible;
    width: auto; /* Default to auto width for text */
}

.domodz-launcher:hover { 
    animation: none; /* Stop floating when hovered for better control */
    transform: scale(1.05); 
    box-shadow: 0 15px 30px rgba(177, 14, 56, 0.4);
}

/* Icon Container */
.launcher-icon-container {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.launcher-icon-container svg { width: 100%; height: 100%; }

/* Text Label */
.launcher-text {
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 5px;
    font-family: sans-serif;
    opacity: 1; 
    transform: translateX(-10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* --- CHAT CONTAINER (DESKTOP DEFAULT) --- */
.domodz-container {
    position: fixed; 
    bottom: 100px; 
    right: 30px;
    width: 380px; 
    height: 600px; 
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
    opacity: 0; 
    transform: translateY(20px) scale(0.95);
    pointer-events: none; 
    transition: all 0.3s ease;
    z-index: 9998; 
    border: 1px solid rgba(0,0,0,0.05);
    font-family: 'Segoe UI', sans-serif;
}
.domodz-container.active { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
    pointer-events: all; 
}

/* --- HEADER --- */
.domodz-header {
    background: #b10e38; 
    color: white;
    padding: 15px 20px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
}
.domodz-header-title { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.domodz-header-title h2 { 
    font-size: 16px; 
    margin: 0; 
    color: white; 
    font-weight: 600;
}
.domodz-header-title span { 
    font-size: 12px; 
    opacity: 0.8; 
    display: block; 
    margin: 0; 
    text-align: center; 
}
.domodz-close-btn { 
    background: none; 
    border: none; 
    color: white; 
    font-size: 24px; 
    cursor: pointer; 
}

/* --- BODY & MESSAGES --- */
.domodz-body {
    flex: 1; 
    padding: 20px; 
    overflow-y: auto; 
    background: #f8fafc;
    display: flex; 
    flex-direction: column; 
    gap: 15px;
}
.domodz-body::-webkit-scrollbar { width: 6px; }
.domodz-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.domodz-msg {
    max-width: 95%; 
    padding: 12px 16px; 
    border-radius: 18px; 
    font-size: 14px; 
    line-height: 1.5;
    animation: fadeIn 0.4s ease forwards; 
    opacity: 0; 
    transform: translateY(10px);
}
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
.domodz-msg.bot { 
    background: #f1f5f9; 
    color: #334155; 
    align-self: flex-start; 
    border-bottom-left-radius: 4px; 
}
.domodz-msg.user { 
    background: #23282f; 
    color: #ffffff; 
    align-self: flex-end; 
    border-bottom-right-radius: 4px; 
    box-shadow: 0 2px 5px rgba(14,165,233,0.2); 
}

/* --- TYPING INDICATOR --- */
.domodz-typing { 
    display: none; 
    align-self: flex-start; 
    background: #f1f5f9; 
    padding: 10px 15px; 
    border-radius: 18px; 
    border-bottom-left-radius: 4px; 
    gap: 5px; 
    margin-bottom: 10px; 
}
.domodz-dot { 
    width: 6px; 
    height: 6px; 
    background: #94a3b8; 
    border-radius: 50%; 
    animation: bounce 1.4s infinite; 
}
.domodz-dot:nth-child(2) { animation-delay: 0.2s; }
.domodz-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 100% { transform: scale(0); } 50% { transform: scale(1); } }

/* --- INPUT AREA --- */
.domodz-input-area { 
    padding: 15px; 
    background: white; 
    border-top: 1px solid #e2e8f0; 
    display: flex; 
    flex-direction: column; 
}
.domodz-options { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}
.domodz-btn {
    background: white; 
    border: 1px solid #4a5464; 
    color: #030505;
    padding: 8px 12px; 
    border-radius: 20px; 
    font-size: 13px; 
    cursor: pointer; 
    transition: 0.2s; 
    font-weight: 600;
}
.domodz-btn:hover { background: #b10e38; color: white; }
.domodz-text-group { display: none; gap: 10px; }
.domodz-text-group.active { display: flex; }
.domodz-text-input { 
    flex: 1; 
    padding: 10px 15px; 
    border: 1px solid #cbd5e1; 
    border-radius: 20px; 
    outline: none; 
}
.domodz-send { 
    width: 40px; 
    height: 40px; 
    background: #b10e38; 
    border: none; 
    border-radius: 50%; 
    color: white; 
    cursor: pointer; 
}

/* --- FORM --- */
.domodz-form { display: none; flex-direction: column; gap: 10px; }
.domodz-form.active { display: flex; }
.domodz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.domodz-full { grid-column: span 2; }
.domodz-file-area {
    border: 2px dashed #cbd5e1; 
    border-radius: 8px; 
    padding: 15px; 
    text-align: center;
    cursor: pointer; 
    position: relative;
}
.domodz-file-area:hover { border-color: #b10e38; background: #f0f9ff; }
.domodz-file-area input { 
    position: absolute; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    opacity: 0; 
    cursor: pointer; 
}

/* --- TOAST NOTIFICATION --- */
.domodz-toast {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(-200px);
    z-index: 99999;
    background-color: #10b981;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 14px;
    font-weight: 600;
    font-family: sans-serif;
    white-space: nowrap;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}
.domodz-toast.show { transform: translateX(-50%) translateY(0); }

/* --- ANIMATIONS --- */

/* 1. Floating Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* 2. Blinking Eyes */
.bot-eye { animation: blink 4s infinite; transform-origin: center; }
@keyframes blink { 0%, 96%, 100% { transform: scaleY(1); } 98% { transform: scaleY(0.1); } }

/* 3. Antenna Glow */
.bot-antenna-light { animation: antenna-glow 2s infinite; opacity: 0.7; }
@keyframes antenna-glow { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

/* 4. Ring Pulse */
.launcher-ring {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100%; height: 100%; border-radius: 50%; border: 2px solid #b10e38;
    z-index: 1; animation: pulsing-ring 3s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes pulsing-ring {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    5% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

/* --- RESPONSIVE MEDIA QUERIES --- */

/* 1. TABLET & SMALL DESKTOP (< 768px) */
/* Adjusts size to fit smaller screens but keeps floating window */
@media (max-width: 768px) {
    .domodz-container {
        width: 90%; /* Use percentage to fit tablet screens */
        height: 70vh; /* Reduce height slightly */
        right: 5%; /* 5% margin from right */
        bottom: 30px;
    }

    /* Show "Chat with us" text on tablet if screen is wide enough */
    @media (min-width: 500px) {
        .domodz-launcher {
            width: auto;
        }
        .launcher-text {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* 2. MOBILE PORTRAIT (< 480px) */
/* Forces Full Screen "App Mode" */
@media (max-width: 480px) {
    .domodz-container {
        width: 100%; 
        height: 90%;
        top: 0; 
        bottom: 0; 
        right: 0; 
        left: 0; /* Force full width */
        border-radius: 0; /* Remove rounded corners */
        max-height: 100%; /* Override max-height */
        position: fixed; /* Ensure it covers screen */
    }
    
    /* Launcher becomes a simple circle */
    .domodz-launcher {
        bottom: 20px; 
        right: 20px;
        width: 60px; 
        height: 60px;
        padding: 0; /* Remove padding */
        border-radius: 50%; /* Make it a perfect circle */
        animation: float-mobile 3s ease-in-out infinite; /* Use smaller float animation */
    }
    
    /* Hide text on mobile to save space */
    .launcher-text {
        display: none; 
    }
}

/* Mobile Animation (Smaller Float) */
@keyframes float-mobile {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0px); }
}