/* Premium Glassmorphism Chatbot Styling - Dark Theme */
:root {
    --chatbot-primary: #1877F2; /* Vibrant Blue from screenshot */
    --chatbot-primary-hover: #166FE5;
    --chatbot-bg: #111111; /* Dark background matching the site */
    --chatbot-text: #ffffff;
    --chatbot-border: #333333;
    --chatbot-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --chatbot-input-bg: #222222;
    --chatbot-input-border: #444444;
}

.dept-chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px; /* Standard placement in bottom right */
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: right;
}

.dept-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: var(--chatbot-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-right: 0;
    margin-left: auto;
}

.dept-chatbot-toggle:hover {
    transform: scale(1.1);
}

.dept-whatsapp-toggle {
    position: fixed;
    bottom: 24px;
    right: 100px; /* Positions it to the left of the main toggle */
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
}

.dept-whatsapp-toggle:hover {
    transform: scale(1.1);
}

.dept-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    background: var(--chatbot-bg);
    border: 1px solid var(--chatbot-border);
    border-radius: 16px;
    box-shadow: var(--chatbot-shadow);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dept-chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dept-chatbot-header {
    background: var(--chatbot-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dept-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.dept-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}

.dept-chatbot-close:hover {
    opacity: 1;
}

.dept-chatbot-body {
    padding: 20px;
    max-height: 450px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444444 #111111;
}

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

.dept-chatbot-body::-webkit-scrollbar-track {
    background: #111111;
    border-radius: 4px;
}

.dept-chatbot-body::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 4px;
}

.dept-chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

.dept-chatbot-greeting {
    font-size: 14px;
    color: var(--chatbot-text);
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.5;
    background: #1a1a1a; /* Darker bg for the greeting bubble */
    padding: 12px;
    border-radius: 8px 0 8px 8px; /* Curve matching RTL bubble */
    display: inline-block;
}

.dept-chatbot-group {
    margin-bottom: 16px;
}

.dept-chatbot-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #cccccc;
    margin-bottom: 6px;
    text-align: right;
}

.dept-chatbot-group input,
.dept-chatbot-group select,
.dept-chatbot-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--chatbot-input-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: var(--chatbot-input-bg);
    color: var(--chatbot-text);
}

.dept-chatbot-group input:focus,
.dept-chatbot-group select:focus,
.dept-chatbot-group textarea:focus {
    outline: none;
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.dept-chatbot-group textarea {
    resize: vertical;
    min-height: 80px;
}

.dept-chatbot-submit {
    width: 100%;
    background: #000000;
    color: white;
    border: 1px solid #333333;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dept-chatbot-submit:hover {
    background: #111111;
    border-color: #555555;
}

.dept-chatbot-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.dept-chatbot-status {
    margin-top: 12px;
    font-size: 13px;
    text-align: center;
    display: none;
    padding: 8px;
    border-radius: 6px;
}

.dept-chatbot-status.success {
    display: block;
    background: #dcfce7;
    color: #166534;
}

.dept-chatbot-status.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

/* Spinner */
.spinner {
    animation: rotate 2s linear infinite;
    z-index: 2;
    width: 20px;
    height: 20px;
    margin-left: 8px;
}
.spinner .path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

@media (max-width: 480px) {
    .dept-chatbot-window {
        width: calc(100vw - 48px);
    }
}
