/* Dana - Gulf City Cleaning rule-based chatbot */
:root {
    --dana-blue: #235596;
    --dana-blue-dark: #1e4b87;
    --dana-green: #0a5c36;
    --dana-green-light: #0d7a48;
    --dana-accent: #00b36b;
    --dana-bg: #f5f7fa;
    --dana-border: #e3e7ed;
    --dana-text: #263238;
    --dana-muted: #6f7a86;
}

#gcc-dana-root,
#gcc-dana-root * {
    box-sizing: border-box;
}

#gcc-dana-root {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147482000;
    font-family: Roboto, Arial, sans-serif;
    direction: ltr;
}

#gcc-dana-root[dir="rtl"] {
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
}

.dana-launcher {
    width: 72px;
    height: 72px;
    padding: 0;
    border: 4px solid #fff;
    border-radius: 50%;
    overflow: hidden;
    background: var(--dana-blue);
    box-shadow: 0 12px 32px rgba(19, 42, 72, .28);
    cursor: pointer;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}

.dana-launcher:hover,
.dana-launcher:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(19, 42, 72, .34);
    outline: none;
}

.dana-photo-crop {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background: #dce8f3;
}

.dana-photo-crop img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 26%;
    transform: scale(2.15);
    transform-origin: 50% 24%;
}

.dana-launcher .dana-photo-crop {
    width: 100%;
    height: 100%;
}

.dana-online-dot {
    position: absolute;
    right: 3px;
    bottom: 5px;
    width: 14px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #34c759;
}

.dana-panel {
    position: absolute;
    right: 0;
    bottom: 88px;
    width: min(390px, calc(100vw - 28px));
    height: min(650px, calc(100vh - 125px));
    min-height: 500px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 65px rgba(18, 40, 68, .26);
}

.dana-panel.is-open {
    display: flex;
    animation: danaOpen .18s ease-out;
}

@keyframes danaOpen {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dana-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--dana-blue-dark), var(--dana-blue));
}

.dana-header .dana-photo-crop {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255,255,255,.9);
}

.dana-header-copy {
    flex: 1;
    min-width: 0;
}

.dana-header-name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

.dana-header-status {
    margin-top: 3px;
    font-size: 12px;
    opacity: .9;
}

.dana-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dana-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.12);
    cursor: pointer;
    font-size: 18px;
}

.dana-icon-button:hover,
.dana-icon-button:focus-visible {
    background: rgba(255,255,255,.22);
    outline: none;
}

.dana-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 14px;
    background: var(--dana-bg);
    scroll-behavior: smooth;
}

.dana-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 12px;
    text-align: center;
}

.dana-welcome .dana-photo-crop {
    width: 94px;
    height: 94px;
    margin-bottom: 10px;
    border: 4px solid #fff;
    box-shadow: 0 6px 20px rgba(21, 62, 103, .16);
}

.dana-welcome strong {
    color: var(--dana-blue-dark);
    font-size: 16px;
}

.dana-row {
    display: flex;
    margin: 8px 0;
}

.dana-row.user {
    justify-content: flex-end;
}

#gcc-dana-root[dir="rtl"] .dana-row.user {
    justify-content: flex-start;
}

.dana-bubble {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 15px 15px 15px 4px;
    color: var(--dana-text);
    background: #fff;
    border: 1px solid var(--dana-border);
    box-shadow: 0 2px 7px rgba(15, 36, 59, .05);
    font-size: 14px;
    line-height: 1.62;
    white-space: pre-line;
}

#gcc-dana-root[dir="rtl"] .dana-bubble {
    border-radius: 15px 15px 4px 15px;
}

.dana-row.user .dana-bubble {
    color: #fff;
    background: var(--dana-blue);
    border-color: var(--dana-blue);
    border-radius: 15px 15px 4px 15px;
}

#gcc-dana-root[dir="rtl"] .dana-row.user .dana-bubble {
    border-radius: 15px 15px 15px 4px;
}

.dana-choice-grid {
    display: grid;
    gap: 8px;
    margin: 10px 0 4px;
}

.dana-choice-grid.two {
    grid-template-columns: 1fr 1fr;
}

.dana-choice {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cad5e2;
    border-radius: 11px;
    color: var(--dana-blue-dark);
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    text-align: inherit;
    transition: border-color .15s, background .15s, transform .15s;
}

.dana-choice:hover,
.dana-choice:focus-visible {
    border-color: var(--dana-blue);
    background: #eef5fc;
    transform: translateY(-1px);
    outline: none;
}

.dana-choice .dana-num {
    display: inline-flex;
    width: 23px;
    height: 23px;
    align-items: center;
    justify-content: center;
    margin-inline-end: 7px;
    border-radius: 50%;
    color: #fff;
    background: var(--dana-blue);
    font-size: 12px;
}

.dana-emergency {
    margin: 10px 0 2px;
    padding: 10px 11px;
    border-radius: 11px;
    color: #8b1d1d;
    background: #fff4f4;
    border: 1px solid #f4cece;
    font-size: 13px;
    line-height: 1.5;
}

.dana-emergency a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.dana-form-card {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--dana-border);
    border-radius: 13px;
    background: #fff;
}

.dana-field {
    margin-bottom: 9px;
}

.dana-field:last-of-type {
    margin-bottom: 0;
}

.dana-field label {
    display: block;
    margin-bottom: 5px;
    color: #3c4855;
    font-size: 12px;
    font-weight: 700;
}

.dana-field input,
.dana-field textarea,
.dana-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #cfd8e3;
    border-radius: 9px;
    color: var(--dana-text);
    background: #fff;
    font: inherit;
    font-size: 14px;
}

.dana-field textarea {
    min-height: 84px;
    resize: vertical;
}

.dana-field input:focus,
.dana-field textarea:focus,
.dana-field select:focus {
    border-color: var(--dana-blue);
    box-shadow: 0 0 0 3px rgba(35,85,150,.10);
    outline: none;
}

.dana-submit {
    width: 100%;
    min-height: 43px;
    margin-top: 10px;
    padding: 10px 13px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--dana-green);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.dana-submit:hover,
.dana-submit:focus-visible {
    background: var(--dana-green-light);
    outline: none;
}

.dana-submit:disabled {
    opacity: .62;
    cursor: wait;
}

.dana-file-box {
    position: relative;
    padding: 14px 10px;
    border: 1px dashed #aebdcc;
    border-radius: 10px;
    text-align: center;
    background: #f9fbfd;
}

.dana-file-box input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dana-file-label {
    color: var(--dana-blue-dark);
    font-size: 13px;
    font-weight: 700;
}

.dana-file-name {
    display: block;
    margin-top: 4px;
    color: var(--dana-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.dana-error {
    margin-top: 8px;
    color: #b42318;
    font-size: 12px;
    font-weight: 600;
}

.dana-reference {
    display: inline-block;
    margin-top: 7px;
    padding: 5px 8px;
    border-radius: 7px;
    color: var(--dana-blue-dark);
    background: #eef5fc;
    font-size: 12px;
    font-weight: 700;
}

.dana-footerbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-top: 1px solid var(--dana-border);
    color: var(--dana-muted);
    background: #fff;
    font-size: 11px;
}

.dana-reset {
    padding: 5px 8px;
    border: 0;
    border-radius: 7px;
    color: var(--dana-blue-dark);
    background: #eef5fc;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.dana-reset:hover,
.dana-reset:focus-visible {
    background: #e1edf9;
    outline: none;
}

.dana-typing {
    display: inline-flex;
    gap: 4px;
    padding: 11px 13px;
    border: 1px solid var(--dana-border);
    border-radius: 15px;
    background: #fff;
}

.dana-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9aa7b4;
    animation: danaDot 1.1s infinite ease-in-out;
}
.dana-typing span:nth-child(2) { animation-delay: .12s; }
.dana-typing span:nth-child(3) { animation-delay: .24s; }

@keyframes danaDot {
    0%, 80%, 100% { transform: translateY(0); opacity: .45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 600px) {
    #gcc-dana-root {
        right: 12px;
        bottom: 12px;
    }

    .dana-panel {
        position: fixed;
        inset: 10px;
        width: auto;
        height: auto;
        min-height: 0;
        border-radius: 16px;
    }

    .dana-launcher {
        width: 64px;
        height: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dana-panel.is-open,
    .dana-launcher,
    .dana-choice,
    .dana-messages {
        animation: none;
        transition: none;
        scroll-behavior: auto;
    }
}

/* Dana pre-cropped avatar - preserve natural proportions */
.dana-photo-crop img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: none;
    transform-origin: center;
}
