/* ═══════════════════════════════════════════════════════════════
   kalkulator2.css — Konverzačný kalkulátor architekta
   ═══════════════════════════════════════════════════════════════ */

/* ── Page container ── */
.chat-page-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.25rem 0 3rem;
}

/* Keep chat UI elements (not the result table) at a readable width */
.chat-progress,
.chat-window,
.chat-input-card {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Progress bar ── */
.chat-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.chat-progress-track {
    flex: 1;
    height: 4px;
    background: #d8e2ec;
    border-radius: 2px;
    overflow: hidden;
}

.chat-progress-fill {
    height: 100%;
    background: #708AA7;
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

.chat-progress-label {
    font-size: 0.78rem;
    color: #777;
    white-space: nowrap;
    min-width: 62px;
    text-align: right;
}

/* ── Chat window ── */
.chat-window {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* ── Message bubbles ── */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: chatMsgIn 0.22s ease;
}

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

.chat-msg.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-bubble {
    padding: 0.7rem 1.05rem;
    border-radius: 16px;
    font-size: 0.96rem;
    line-height: 1.55;
}

.chat-msg.assistant .chat-bubble {
    background: #eef2f7;
    color: #0e0e0e;
    border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-bubble {
    background: #708AA7;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Editable user bubbles (click to go back) */
.chat-msg.user[data-step] .chat-bubble {
    cursor: pointer;
    transition: opacity 0.18s;
}

.chat-msg.user[data-step] .chat-bubble:hover {
    opacity: 0.75;
}

/* ── Bubble wrapper (for tooltip icon alignment) ── */
.chat-bubble-wrap {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.chat-info-icon {
    margin-top: 5px;
    flex-shrink: 0;
    /* inherits .info-icon from styles.css */
}

/* In-flow tooltip panel (avoids absolute positioning issues in flex chat layout) */
.chat-tooltip-text {
    display: none;
    background: #333;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 5px;
    max-width: 440px;
    animation: chatMsgIn 0.18s ease;
}

.chat-tooltip-text.show {
    display: block;
}

/* ── Input card ── */
.chat-input-card {
    background: #f7f9fb;
    border: 1.5px solid #d0d9e5;
    border-radius: 14px;
    padding: 1.1rem 1.25rem 1.25rem;
    margin-bottom: 0.5rem;
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Unit label next to number input (e.g. m²) */
.chat-unit-label {
    align-self: center;
    white-space: nowrap;
    font-size: .88rem;
    color: #666;
}

/* Number field wrapper (input + m² label) */
.chat-number-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

/* Text / number inputs */
.chat-text-input,
.chat-number-input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #c0cdd9;
    border-radius: 8px;
    font-size: 0.97rem;
    font-family: inherit;
    color: #0e0e0e;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.chat-text-input:focus,
.chat-number-input:focus {
    border-color: #708AA7;
}

/* ── Buttons ── */
.chat-btn {
    padding: 0.58rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.91rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, opacity 0.15s;
    white-space: nowrap;
}

.chat-btn:active { opacity: 0.82; }

.chat-btn-primary {
    background: #708AA7;
    color: #fff;
}

.chat-btn-primary:hover { background: #5b7898; }

.chat-btn-skip {
    background: transparent;
    color: #708AA7;
    border: 1.5px solid #b0c0d0;
    font-weight: 400;
}

.chat-btn-skip:hover { background: #eef2f7; }

/* Yes / No button pair */
.yesno-group {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.yesno-btn {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 2px solid #c0cdd9;
    border-radius: 10px;
    background: #fff;
    color: #0e0e0e;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    text-align: center;
}

.yesno-btn:hover {
    border-color: #708AA7;
    background: #eef2f7;
}

/* ── Typology chips ── */
.chip-hint {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.65rem;
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.chip {
    padding: 0.42rem 0.9rem;
    border: 1.5px solid #b0bfcc;
    border-radius: 20px;
    background: #fff;
    color: #0e0e0e;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.17s;
    -webkit-user-select: none;
    user-select: none;
    line-height: 1.4;
}

.chip:hover:not(.chip-disabled) { border-color: #708AA7; }

.chip.chip-selected {
    background: #708AA7;
    border-color: #708AA7;
    color: #fff;
}

.chip.chip-disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* ── Complexity slider ── */
.complexity-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.complexity-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.79rem;
    color: #666;
}

.complexity-slider-input {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    background: #d0d9e3;
    outline: none;
    cursor: pointer;
    margin: 6px 0 2px;
}

.complexity-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #708AA7;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0,0,0,0.22);
    transition: background 0.18s;
}

.complexity-slider-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #708AA7;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 5px rgba(0,0,0,0.22);
}

.complexity-slider-input::-webkit-slider-thumb:hover { background: #5b7898; }

.complexity-value-badge {
    text-align: center;
    margin-top: 6px;
}

.complexity-value-badge span {
    display: inline-block;
    background: #eef2f7;
    color: #708AA7;
    border-radius: 20px;
    padding: 0.2rem 0.9rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.complexity-value-desc {
    text-align: center;
    font-size: 0.79rem;
    color: #777;
    min-height: 1.2em;
    margin-top: 2px;
}

.complexity-calibrate-link {
    text-align: left;
    margin-top: 0.9rem;
    font-size: 0.82rem;
}

.complexity-calibrate-link a {
    color: #708AA7;
    text-decoration: none;
    font-weight: 700;
}

.complexity-calibrate-link a::after {
    content: '→';
    margin-left: 0.5rem;
}

.complexity-calibrate-link a:hover {
    color: #000;
}

/* ── Validation error ── */
.chat-error {
    font-size: 0.82rem;
    color: #c0392b;
    margin-top: 0.45rem;
    display: none;
}

.chat-error.chat-error-visible { display: block; }

/* ── Result area ── */
.chat-result {
    animation: chatMsgIn 0.3s ease;
}

.chat-result.hidden { display: none; }

/* Factors strip */
.factors-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    padding: 0.8rem 1.1rem;
    background: #eef2f7;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.87rem;
    color: #444;
}

.factors-strip strong { color: #708AA7; }

/* Restart / print row */
.chat-action-row {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-action-row .print-pdf-button {
    width: 100%;
    border-radius: 0;
}

.chat-btn-restart {
    width: 100%;
    padding: 1rem 2rem;
    border: 2px solid #708AA7;
    border-radius: 0;
    background: #fff;
    color: #708AA7;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.chat-btn-restart:hover { background: #000; border-color: #000; color: #fff; }
.chat-btn-restart:active { opacity: 0.82; }

/* Reuse warning-text from styles.css or define here as fallback */
.warning-text {
    color: #D32F2F;
    font-size: 0.88rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .chat-msg { max-width: 95%; }
    .yesno-group { flex-direction: column; }
    .factors-strip { gap: 0.5rem 1rem; }
    .chat-input-card { padding: 0.9rem 1rem 1rem; }
    .chat-input-row {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .chat-input-row .chat-text-input,
    .chat-input-row .chat-number-field {
        width: 100%;
        flex: 1 1 100%;
    }
    .chat-input-row .chat-btn {
        flex: 0 0 auto;
    }
}

/* ── Utility classes (replaces inline styles) ── */
.chat-hidden-cb {
    display: none;
}

.chat-hourly-rate {
    margin-top: 36px;
    font-size: 14px;
    color: #000;
}

.chat-disclaimer {
    margin-top: 2rem;
}

/* Print view helpers */
.pv-note {
    font-weight: 400;
}

.pv-hourly-print {
    margin-top: 16px;
    font-size: 12px;
}

/* ── Print ── */
@media print {
    .chat-progress,
    .chat-window,
    .chat-input-card,
    .chat-action-row,
    header.logo-header,
    nav,
    footer { display: none !important; }

    .chat-result { display: block !important; }
    .factors-strip { break-inside: avoid; }
}
