@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root { 
    --google-blue: #1a73e8;
    --google-gray: #1f1f1f;
    --google-bg: #ffffff;
    --user-bubble: #f0f4f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--google-bg); color: var(--google-gray); line-height: 1.6; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* Navigacija */
nav { height: 4rem; background: white; border-bottom: 1px solid #e0e0e0; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.nav-logo { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon { color: var(--google-blue); }
.logo-text h1 { font-size: 1.125rem; font-weight: 600; color: var(--google-gray); }

#connection-controls { display: flex; align-items: center; gap: 1rem; }

/* Gumb za promjenu Persone */
.persona-btn {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    color: #5f6368;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.persona-btn:hover { background: #e8eaed; color: #202124; }
.persona-btn i { width: 14px; height: 14px; }

#connection-status { display: flex; align-items: center; gap: 0.5rem; }
.status-icon { display: flex; align-items: center; justify-content: center; }
.status-icon.active svg { fill: #fbbc04; stroke: #fbbc04; }
.status-icon.inactive svg { fill: #dadce0; stroke: #dadce0; }
.status-text { font-size: 13px; color: #5f6368; }

/* Chat Area */
main { flex: 1; overflow-y: auto; padding: 2rem 1rem; }
.container { max-width: 50rem; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem; padding-bottom: 8rem; }

/* Poruke */
.msg-row { display: flex; flex-direction: column; width: 100%; }
.msg-row.user { align-items: flex-end; }
.msg-row.ana { align-items: flex-start; }

.msg-meta {
    font-size: 0.75rem;
    color: #9aa0a6;
    margin-top: 4px;
    padding: 0 10px;
}

.msg-bubble { max-width: 85%; font-size: 1rem; }

.user .msg-bubble { 
    background: var(--user-bubble); 
    color: var(--google-gray); 
    padding: 0.75rem 1.25rem; 
    border-radius: 20px;
}

.ana .msg-bubble { 
    background: transparent; 
    color: var(--google-gray);
    width: 100%;
}

.msg-timestamp {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 8px;
    display: block;
    text-align: right;
}

.msg-bubble h3 { color: var(--google-gray); margin: 1.5rem 0 0.75rem 0; font-size: 1.25rem; font-weight: 600; }
.msg-bubble p { margin-bottom: 1rem; }
.msg-bubble ul, .msg-bubble ol { margin: 1rem 0 1rem 1.5rem; }
.msg-bubble li { margin-bottom: 0.5rem; }
.msg-bubble strong { font-weight: 600; }

/* Input area */
.input-bunker { position: fixed; bottom: 0; left: 0; width: 100%; padding: 1.5rem; background: linear-gradient(to top, white 70%, transparent); }
.input-container { 
    max-width: 48rem; 
    margin: 0 auto; 
    background: #f0f4f9; 
    border-radius: 30px; 
    padding: 0.5rem 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 1rem;
    min-height: 48px;
    height: auto;
}

textarea { 
    flex: 1; 
    background: transparent; 
    border: none; 
    padding: 0.75rem 0; 
    font-size: 1rem; 
    outline: none; 
    resize: none; 
    font-family: inherit;
    max-height: 150px;
}

#send-btn { 
    background: none; 
    border: none; 
    color: var(--google-blue); 
    cursor: pointer; 
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}
#send-btn:hover { background: rgba(26, 115, 232, 0.1); }

/* Gemini-style Shimmer Spider */
#loader { 
    display: none;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
#loader.active { display: flex; }
.spider-dots { display: flex; gap: 4px; }
.spider-dot {
    width: 8px;
    height: 8px;
    background: #ef4444; /* Crvena */
    border-radius: 50%;
    animation: gemini-spider 2.4s infinite ease-in-out;
}
.spider-dot:nth-child(2) { animation-delay: 0.2s; background: #f97316; } /* Narančasta */
.spider-dot:nth-child(3) { animation-delay: 0.4s; background: #f59e0b; } /* Žuta */
.spider-dot:nth-child(4) { animation-delay: 0.6s; background: #84cc16; } /* Limeta zelena */
.spider-dot:nth-child(5) { animation-delay: 0.8s; background: #22c55e; } /* Zelena */
.spider-dot:nth-child(6) { animation-delay: 1.0s; background: #06b6d4; } /* Tirkizna */
.spider-dot:nth-child(7) { animation-delay: 1.2s; background: #3b82f6; } /* Plava */
.spider-dot:nth-child(8) { animation-delay: 1.4s; background: #8b5cf6; } /* Indigo */
.spider-dot:nth-child(9) { animation-delay: 1.6s; background: #d946ef; } /* Ljubičasta/Roza */

@keyframes gemini-spider {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 1; filter: blur(1px); }
}

#initial-state { padding: 4rem 0; text-align: center; }
#initial-state h2 { font-size: 2rem; font-weight: 500; margin-bottom: 1rem; color: #1f1f1f; }
.loading-text { font-size: 13px; color: #5f6368; }