/* ═══════════════════════════════════════════
   ENTELA AI — Dizajn si enti-cv.netlify.app
   Blue gradient (#2B3FEA → #8DA0FF) + Green (#00B894) + Light BG
   ═══════════════════════════════════════════ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue: #2B3FEA;
    --blue-light: #8DA0FF;
    --grad: linear-gradient(135deg, #2B3FEA 0%, #8DA0FF 100%);
    --blue-bg: rgba(43, 63, 234, 0.08);
    --blue-glow: rgba(43, 63, 234, 0.2);
    --green: #00B894;
    --bg: #fff;
    --bg-end: #eef0ff;
    --text: #1a1a2e;
    --text-soft: #555;
    --text-muted: #999;
    --text-light: #ccc;
    --white: #ffffff;
    --card: #ffffff;
    --border: rgba(0, 0, 0, 0.04);
    --sans: 'DM Sans', 'Inter', system-ui, sans-serif;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--sans);
    background: linear-gradient(180deg, var(--bg) 0%, #eef0ff 50%, var(--bg-end) 100%);
    color: var(--text);
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ─── HEADER ─── */

.header {
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(43, 63, 234, 0.08);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 15px;
}

.header-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.header-name .accent {
    color: var(--blue);
}

.header-sub {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px rgba(0, 184, 148, 0.4);
}

.header-badge {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: rgba(43, 63, 234, 0.03);
    letter-spacing: 0.02em;
}

.status-text {
    font-size: 11px;
    color: #aaa;
}

.btn-home {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    border: 1.5px solid var(--blue-glow);
    background: var(--blue-bg);
    transition: all 0.2s;
}

.btn-home:hover {
    background: rgba(43, 63, 234, 0.12);
    border-color: rgba(43, 63, 234, 0.35);
}

/* ─── MAIN ─── */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

/* ─── WELCOME ─── */

.welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 16px;
    animation: fadeUp 0.6s ease;
    max-width: 100%;
    overflow: hidden;
}

.welcome-title {
    font-size: clamp(30px, 6vw, 52px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 12px;
    color: var(--text);
    max-width: 100%;
}

.welcome-title .accent {
    color: var(--blue);
}

.welcome-desc {
    font-size: 14px;
    color: #777;
    max-width: 420px;
    line-height: 1.55;
    margin-bottom: 24px;
}

/* ─── SUGGESTIONS ─── */

.suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 440px;
}

.suggestion-btn {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(43, 63, 234, 0.08);
    background: var(--white);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: #444;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.suggestion-btn:hover {
    border-color: rgba(43, 63, 234, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.suggestion-btn[data-color="green"] {
    border-color: rgba(0, 184, 148, 0.08);
}

.suggestion-btn[data-color="green"]:hover {
    border-color: rgba(0, 184, 148, 0.25);
}

.suggestion-icon {
    font-size: 11px;
    flex-shrink: 0;
}

.suggestion-icon.purple { color: var(--blue); }
.suggestion-icon.green { color: var(--green); }

/* ─── CHAT PREVIEW (welcome screen) ─── */

.chat-preview {
    margin-top: 20px;
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.chat-preview-question {
    background: #f4f0ff;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 10px;
    display: inline-block;
}

.chat-preview-answer {
    display: flex;
    gap: 8px;
}

.chat-preview-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
}

.chat-preview-text {
    background: #f9f8ff;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.5;
    text-align: justify;
}

.welcome-footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--blue);
    font-weight: 600;
    letter-spacing: 0.12em;
    opacity: 0.6;
}

/* ─── MESSAGES ─── */

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: msgIn 0.3s ease;
}

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

.msg-row.assistant {
    justify-content: flex-start;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
}

.msg-bubble {
    max-width: 80%;
    padding: 11px 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-bubble.user {
    border-radius: 16px 16px 4px 16px;
    background: var(--grad);
    color: var(--white);
    box-shadow: 0 2px 12px rgba(43, 63, 234, 0.15);
}

.msg-bubble.assistant {
    border-radius: 16px 16px 16px 4px;
    background: var(--white);
    color: #2d2d3a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
}

/* ─── TYPING ─── */

.typing-row {
    display: none;
    gap: 10px;
    align-items: flex-start;
    animation: msgIn 0.3s ease;
}

.typing-row.visible {
    display: flex;
}

.typing-bubble {
    background: var(--white);
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    display: inline-block;
}

.typing-dot:nth-child(1) { animation: dotBounce 1.2s ease-in-out 0s infinite; }
.typing-dot:nth-child(2) { animation: dotBounce 1.2s ease-in-out 0.18s infinite; }
.typing-dot:nth-child(3) { animation: dotBounce 1.2s ease-in-out 0.36s infinite; }

/* ─── INPUT ─── */

.input-area {
    padding: 12px 20px 20px;
    background: linear-gradient(0deg, rgba(246, 244, 255, 1) 0%, transparent 100%);
}

.input-container {
    max-width: 680px;
    margin: 0 auto;
    background: var(--white);
    border: 1.5px solid rgba(43, 63, 234, 0.1);
    border-radius: 18px;
    padding: 8px 8px 8px 18px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    box-shadow: 0 2px 16px rgba(43, 63, 234, 0.04);
    transition: border-color 0.3s;
}

.input-container.focused {
    border-color: rgba(43, 63, 234, 0.3);
}

.input-container textarea {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14.5px;
    font-family: var(--sans);
    resize: none;
    background: transparent;
    color: var(--text);
    line-height: 1.45;
    max-height: 100px;
    padding: 8px 0;
}

.input-container textarea::placeholder {
    color: #bbb;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: #e8e4f2;
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn.active {
    background: var(--grad);
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(43, 63, 234, 0.2);
}

.input-disclaimer {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── SCROLLBAR ─── */

.messages::-webkit-scrollbar { width: 3px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: rgba(43, 63, 234, 0.1); border-radius: 10px; }

/* ─── ANIMATIONS ─── */

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

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

@keyframes dotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
    40% { transform: translateY(-5px); opacity: 1; }
}

/* ─── RESPONSIVE ─── */

@media (max-width: 600px) {
    .header { padding: 12px 16px; }
    .status-text { display: none; }
    .main { padding: 0 12px; }
    .suggestions { grid-template-columns: 1fr; }
    .welcome { padding: 24px 12px; }
    .input-area { padding: 10px 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .welcome, .msg-row, .typing-row { animation: none; }
    .typing-dot { animation: none; opacity: 0.5; }
}

/* Hide badge on mobile */
@media (max-width: 600px) {
    .header-badge { display: none; }
}