/* --- CSS START --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #044b93 0%, #008bfa 100%);
    min-height: 100vh;
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
}

/* Typing Dots Animation */
.typing-dots {
    display: flex;
    gap: 0.25em;
}
.typing-dot {
    width: 0.5em;
    height: 0.5em;
    background: #008bfa;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-0.6em); }
}

/* Pulse Ring */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 0.2em solid #044b93;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0.6;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.6; }
}

/* Chatbot Popup */
.chatbot-popup {
    position: fixed;
    bottom: 2vw;
    right: 2vw;
    /*width: 90vw;
    max-width: 400px;
    height: 80vh;
    max-height: 90vh;*/
    width: 400px;
    height: 650px;
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 1em;
    box-shadow: 0 4px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    background: #fff;
    z-index: 9999;
    overflow: hidden;
    transition: box-shadow 0.2s, width 0.2s, height 0.2s;
}
.chatbot-popup.chatbot-fullscreen {
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    z-index: 9999;
}

/*.mascot-tooltip {
  visibility: hidden;
  opacity: 0;
  width: 190px;
  background: #044b93;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 8px 12px;
  position: absolute;
  z-index: 9999;
  bottom: 110%; /* Show above the mascot 
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.98em;
  pointer-events: none;
  transition: opacity 0.18s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  white-space: pre-line;
}

.launcher-circle:hover .mascot-tooltip,
.launcher-circle:focus-within .mascot-tooltip {
  visibility: visible;
  opacity: 1;
}*/

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #044b93 0%, #008bfa 100%);
    /* background: linear-gradient(135deg, #008bfa 0%, #044b93 100%); */
    color: white;
    padding: .5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header-info {
    display: flex;
    align-items: center;
    gap: 0.9em;
}
.header-text h3 {
    font-size: 1.25em;
    font-weight: 700;
    margin-bottom: 0.3em;
}
.status-indicator {
    font-size: 0.8em;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.3em;
}
.status-indicator::before {
    content: '●';
    color: #04f60e;
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}
/*.close-btn {
    background: rgba(181, 6, 6, 0.6);
    border: none;
    color: white;
    font-size: 1em;
    cursor: pointer;
    padding: 0.5em 0.75em;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 2.8em;
    height: 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}*/

.close-btn {
            background: rgba(181, 6, 6, 0.6);
            border: none;
            color: white;
            font-size: 40px;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 50%;
            transition: all 0.3s ease;
            width: 25px;
            height: 25px;
            display: flex;
            align-items: center;
            justify-content: center;
}

/*.close-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: rotate(90deg);
}*/

.chatbot-logo img,
.chatbot-logo-img {
    max-height: 48px;   /* or your preferred max height */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Chat Body */
.chat-body {
    flex: 1 1 0;
    padding: .5em;
    min-height: 0;
    overflow-y: auto;        /* Only show vertical scrollbar if needed */
    overflow-x: hidden;      /* Prevent horizontal scroll unless necessary */
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    scrollbar-width: thin;
    scrollbar-color: #044b93 #f1f1f1;
}
.chat-body::-webkit-scrollbar {
    width: 0.4em;
}
.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0.6em;
}
.chat-body::-webkit-scrollbar-thumb {
    background: #044b93;
    border-radius: 0.6em;
}
.chat-body::-webkit-scrollbar-thumb:hover {
    background: #008bfa;
}

.message {
    animation: slideInUp 0.5s ease-out;
}
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(1.2em); }
    to { opacity: 1; transform: translateY(0); }
}
.bot-message {
    background: white;
    padding: 0.5em;
    font-size: .8rem;
    border-radius: 0.7em;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    line-height: 1.4;
    border-left: 0.25em solid #008bfa;
    position: relative;
}

.bot-message p{
    margin:.2rem 0;
}

/* Options */
.options-container {
    margin-top: .5em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}
.option-btn {
    background: #008bfa;
    color: #fff;
    padding: 0.7em 1em;
    border-radius: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border: none !important;
}
.option-btn:hover {
    background: #044b93;
    color: #fff;
    border-color: #5a67d8;
    transform: translateY(-0.2em);
    box-shadow: 0 8px 25px rgba(102,126,234,0.3);
}
.option-btn.primary { border-color: #008bfa; }
.option-btn.primary:hover {
    background: #044b93;
    color: white;
    border-color: #667eea;
}
.option-btn.secondary {
    color: #fff;
    background: #cf0501;
    transition: all 0.2s ease;
}
.option-btn.secondary:hover {
    background: linear-gradient(0deg, #910604, #ce0501 );
    color: white;
}
.option-btn.danger {
    border-color: #dc3545;
    color: #dc3545;
    background: linear-gradient(135deg, #ffffff, #044b93 );
}
.option-btn.danger:hover {
    background: #dc3545;
    color: white;
}
.option-btn.success {
    color: #ffffff;
    background: #00a552;
    transition: all 0.2s ease;
}
.option-btn.success:hover {
    background: linear-gradient(0deg, #00552a, #00a451 );
    color: #fff;
}
.option-btn.success, .option-btn.secondary {
    justify-content: center;
    text-align: center;
    border: none !important;
}
.option-btn.link {
    border-color: #6b47b2;
    color: #fff;
}
.option-btn.link:hover {
    background: #6b47b2;
    color: white;
}

/* Chat Footer */
.chat-footer {
    padding: .5em;
    background: white;
    border-top: 1px solid #e9ecef;
    min-height: 3em;
}

/* Navigation Controls */
.navigation-controls {
    display: flex;
    width: 100%;
    margin-bottom: 0;
    padding: 0;
}
.nav-btn-left, .nav-btn-center, .nav-btn-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    min-width: 0;
}
.nav-btn-left { justify-content: flex-start; }
.nav-btn-center { justify-content: center; }
.nav-btn-right { justify-content: flex-end; }
.nav-btn {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    padding: 0.5em 1em;
    border-radius: 1.2em;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3em;
    min-width: 6em;
    max-width: 7.5em;
    width: 90%;
    justify-content: center;
}
.nav-btn:hover {
    background: #044b93;
    color: white;
    border-color: #044b93;
}
.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.nav-btn.danger {
    border-color: #dc3545;
    color: #dc3545;
}
.nav-btn.danger:hover {
    background: #dc3545;
    color: white;
}

/* Feedback Form */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    animation: fadeIn 0.5s ease;
    padding: 1em;
    background: white;
    border-radius: 1em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.feedback-title {
    color: #667eea;
    text-align: center;
    font-size: 0.9em;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
}
.ratings-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5em;
    margin: 0.3em 0;
}
.rating-btn {
    padding: 0.7em 0.3em;
    border: 1px solid #e9ecef;
    border-radius: 0.6em;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2em;
    font-size: 0.8em;
}
.rating-btn .emoji { font-size: 1.25em; }
.rating-btn .rating-text { font-size: 0.7em; white-space: nowrap; }
.rating-btn .rating-value { font-size: 0.7em; opacity: 0.7; }
.rating-btn:hover {
    transform: translateY(-0.1em);
    box-shadow: 0 3px 10px rgba(102,126,234,0.2);
    border-color: #667eea;
}
.feedback-actions {
    display: flex;
    gap: 0.5em;
    justify-content: flex-end;
}
.skip-feedback {
    padding: 0.5em 1em;
    border: none;
    border-radius: 0.5em;
    background: #008bfa;
    color: #fff;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}
.skip-feedback:hover {
    background: #044b93;
    color: #fff;
}

/* --- Responsive Media Queries --- */

/* Small devices (phones, 0–480px) */
@media (max-width: 480px) {
    .chatbot-popup {
        width: 80vw;
        height: 65vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-width: 80vw;
        max-height: 65vh;
    }
    .chat-header {
        border-radius: 0;
        padding: .5em;
    }
    .chat-footer {
        border-radius: 0;
    }
    .options-container.grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
    .ratings-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.3em;
    }
    .rating-btn {
        padding: 0.5em 0.2em;
    }
    .rating-btn .emoji {
        font-size: 1.1em;
    }
    body {
        font-size: 0.95rem;
    }
}

/* Medium devices (tablets, 481–768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-popup {
        width: 95vw;
        height: 80vh;
        right: 2.5vw;
        max-width: 95vw;
        max-height: 80vh;
    }
    .chat-header, .chat-footer {
        padding: .5em;
    }
    .options-container.grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
    body {
        font-size: 1rem;
    }
}

/* Large devices (small laptops, 769–1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .chatbot-popup {
        width: 70vw;
        height: 70vh;
        max-width: 70vw;
        max-height: 70vh;
    }
    body {
        font-size: 1.05rem;
    }
}

/* Extra large devices (desktops, 1025px and up) */
@media (min-width: 1025px) {
    .chatbot-popup {
        width: 420px;
        height: 700px;
        max-width: 95vw;
        max-height: 90vh;
    }
    body {
        font-size: 1.1rem;
    }
}
/* --- CSS END --- */
