/* ================================
   GeraChat Dynamic Site Builder
   Base visual conversacional
================================ */

.dsb-chat,
.dsb-chat * {
    box-sizing: border-box;
}

.dsb-chat {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 72px 20px 52px;
    font-family: inherit;
    color: #17151c;
}

.dsb-chat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 42px;
    font-weight: 700;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1;
    letter-spacing: -0.06em;
    color: #111018;
}

.dsb-chat-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #eef7ea;
    font-size: 22px;
    letter-spacing: 0;
}

.dsb-chat-window {
    width: min(100%, 920px);
    min-height: 190px;
    max-height: 460px;
    margin: 0 auto 18px;
    overflow-y: auto;
    padding: 4px 4px 14px;
    scroll-behavior: smooth;
}

.dsb-message {
    display: flex;
    width: 100%;
    margin: 10px 0;
    animation: dsbFadeUp .22s ease both;
}

.dsb-message-user {
    justify-content: flex-end;
}

.dsb-bubble {
    max-width: min(78%, 720px);
    padding: 13px 16px;
    border-radius: 22px;
    background: #f5f3f7;
    color: #211c2a;
    font-size: 15px;
    line-height: 1.55;
    box-shadow: 0 8px 24px rgba(20, 15, 30, 0.04);
}

.dsb-message-user .dsb-bubble {
    border-bottom-right-radius: 8px;
    background: #251d34;
    color: #fff;
}

.dsb-message-bot .dsb-bubble {
    border-bottom-left-radius: 8px;
}

.dsb-typing .dsb-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 62px;
    padding: 15px 18px;
}

.dsb-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    opacity: .32;
    animation: dsbTyping 1s infinite ease-in-out;
}

.dsb-typing span:nth-child(2) { animation-delay: .15s; }
.dsb-typing span:nth-child(3) { animation-delay: .3s; }

.dsb-chat-input {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(100%, 920px);
    min-height: 84px;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid rgba(24, 21, 32, 0.10);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 28px 80px rgba(32, 25, 44, 0.10),
        0 8px 24px rgba(32, 25, 44, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.8);
    backdrop-filter: blur(14px);
    pointer-events: auto;
}

.dsb-chat-input::before {
    content: "✦";
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #edf4ea;
    color: #251d34;
    font-size: 18px;
    font-weight: 700;
    pointer-events: none;
}

.dsb-chat-input input {
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0 8px;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #18151f;
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 400;
    letter-spacing: -0.03em;
    cursor: text;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
    -webkit-appearance: none;
    appearance: none;
}

.dsb-chat-input input::placeholder {
    color: #aaa5b2;
    opacity: 1;
}

.dsb-chat-input input:disabled,
.dsb-chat-input input[readonly] {
    cursor: default;
    opacity: .72;
}

.dsb-chat-input button {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    min-width: 116px;
    height: 58px;
    padding: 0 26px;
    border: 0;
    border-radius: 22px;
    background: #251d34;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    box-shadow: 0 10px 24px rgba(37, 29, 52, 0.22);
}

.dsb-chat-input button:hover {
    transform: translateY(-1px);
    background: #312542;
    box-shadow: 0 14px 34px rgba(37, 29, 52, 0.26);
}

.dsb-chat-actions {
    position: relative;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: min(100%, 920px);
    margin: 20px auto 0;
    pointer-events: auto;
}

.dsb-action-button,
.dsb-result-link {
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid rgba(24, 21, 32, 0.10);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #1e1a26;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.035em;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow:
        0 10px 28px rgba(20, 15, 30, 0.055),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.dsb-action-button:hover,
.dsb-result-link:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 29, 52, 0.18);
    background: #fff;
    box-shadow: 0 16px 40px rgba(20, 15, 30, 0.09);
}

.dsb-action-secondary {
    opacity: .76;
}

.dsb-chat-actions[data-phase="field"],
.dsb-chat-actions[data-phase="upload"] {
    justify-content: flex-start;
    max-width: 920px;
}

.dsb-chat-actions[data-phase="field"] .dsb-action-button,
.dsb-chat-actions[data-phase="upload"] .dsb-action-button {
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
}

.dsb-model-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.dsb-model-card {
    overflow: hidden;
    border: 1px solid rgba(24, 21, 32, 0.09);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(20, 15, 30, 0.08);
    transition: transform .18s ease, box-shadow .18s ease;
}

.dsb-model-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 26px 70px rgba(20, 15, 30, 0.12);
}

.dsb-model-card img,
.dsb-model-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: linear-gradient(135deg, #f4f2f7, #ece8f1);
}

.dsb-model-card-body {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.dsb-model-card strong {
    margin: 0;
    color: #17151c;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.dsb-model-card span {
    color: #716a7b;
    font-size: 13px;
}

.dsb-model-card button {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 16px;
    background: #251d34;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease;
}

.dsb-model-card button:hover {
    transform: translateY(-1px);
    background: #312542;
}

.dsb-result-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    background: #251d34;
    color: #fff !important;
}

.dsb-empty {
    width: 100%;
    margin: 0;
    padding: 18px;
    border-radius: 18px;
    background: #f7f5f9;
    color: #6b6574;
    text-align: center;
    font-size: 14px;
}

.dynamic-site-fallback {
    width: min(1120px, calc(100% - 32px));
    margin: 40px auto;
}

.dynamic-site-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}

.dynamic-site-hero-image {
    width: 100%;
    height: auto;
    border-radius: 24px;
}

.dynamic-site-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.dynamic-site-gallery img {
    width: 100%;
    height: auto;
}

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

@keyframes dsbTyping {
    0%, 100% { transform: translateY(0); opacity: .25; }
    50% { transform: translateY(-4px); opacity: .9; }
}

@media (max-width: 768px) {
    .dsb-chat {
        padding: 54px 16px 42px;
    }

    .dsb-chat-header {
        margin-bottom: 32px;
        font-size: 34px;
    }

    .dsb-chat-window {
        min-height: 160px;
        max-height: 390px;
    }

    .dsb-chat-input {
        min-height: auto;
        padding: 10px;
        border-radius: 28px;
        gap: 10px;
    }

    .dsb-chat-input::before {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .dsb-chat-input input {
        height: 50px;
        font-size: 15px;
    }

    .dsb-chat-input button {
        min-width: 86px;
        height: 50px;
        padding: 0 16px;
        border-radius: 18px;
        font-size: 14px;
    }

    .dsb-chat-actions {
        gap: 10px;
        margin-top: 16px;
    }

    .dsb-action-button {
        min-height: 44px;
        padding: 0 16px;
        font-size: 13px;
    }

    .dsb-bubble {
        max-width: 92%;
        font-size: 14px;
    }

    .dsb-model-grid {
        grid-template-columns: 1fr;
    }

    .dynamic-site-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dsb-chat-input {
        gap: 8px;
    }

    .dsb-chat-input::before {
        display: none;
    }

    .dsb-chat-input button {
        min-width: 74px;
        padding: 0 12px;
    }
}
