:root {
    --szin-hatter: #0f172a;
    --szin-kartya: #1e293b;
    --szin-elsodleges: #38bdf8;
    --szin-szoveg: #f8fafc;
    --szin-szoveg-halvany: #94a3b8;
    --szin-hiba: #ef4444;
    --szin-sajat-uzenet: #0369a1;
    --szin-ai-uzenet: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background-color: var(--szin-hatter); color: var(--szin-szoveg); height: 100vh; overflow: hidden; }
.kepernyo { display: flex; flex-direction: column; height: 100vh; }
.elrejtve { display: none !important; }

/* Auth */
#bejelentkezo-kepernyo { justify-content: center; align-items: center; background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%); }
.auth-kartya { background: var(--szin-kartya); padding: 2.5rem; border-radius: 1.5rem; text-align: center; max-width: 400px; width: 90%; }
.auth-kartya input { width: 100%; padding: 1rem; margin: 1.5rem 0; background: #0f172a; border: 1px solid #334155; border-radius: 0.75rem; color: white; text-align: center; font-size: 1.5rem; }
.auth-kartya button { width: 100%; padding: 1rem; background: var(--szin-elsodleges); border: none; border-radius: 0.75rem; color: white; font-weight: 600; cursor: pointer; }

/* Header */
header { padding: 1rem 1.5rem; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid #334155; display: flex; justify-content: space-between; align-items: center; }
.statusz-pont { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--szin-hiba); margin-right: 0.5rem; }
.statusz-pont.online { background: #10b981; }

/* Messages */
#uzenet-lista { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.uzenet { max-width: 85%; padding: 0.8rem 1rem; border-radius: 1rem; line-height: 1.5; }
.sajat-uzenet { align-self: flex-end; background: var(--szin-sajat-uzenet); }
.ai-uzenet { align-self: flex-start; background: var(--szin-ai-uzenet); }

/* Footer */
footer { padding: 1rem; }
.bevitel-kontener { background: var(--szin-kartya); border-radius: 1rem; display: flex; align-items: center; padding: 0.5rem 1rem; }
#uzenet-bevitel {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff !important;
    outline: none;
    padding: 10px;
    font-size: 1rem;
    min-height: 44px;
    max-height: 150px;
    line-height: 1.4;
    resize: none;
    display: block !important;
    visibility: visible !important;
}
#kuldes-gomb { background: transparent; border: none; color: var(--szin-elsodleges); cursor: pointer; }

.statusz-sav { padding: 0.5rem 1.5rem; font-size: 0.8rem; color: var(--szin-szoveg-halvany); display: flex; gap: 0.5rem; }
.betolto-ikon { width: 12px; height: 12px; border: 2px solid var(--szin-elsodleges); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hiba-szoveg { color: var(--szin-hiba); font-size: 0.9rem; margin-top: 0.5rem; }
.ikon-gomb { 
    background: rgba(56, 189, 248, 0.15); /* Finom háttér a láthatósághoz */
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 0.5rem;
    font-size: 1.4rem; 
    cursor: pointer; 
    color: var(--szin-elsodleges); 
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s, background 0.2s, border-color 0.2s;
}

.ikon-gomb:hover {
    transform: scale(1.1);
    opacity: 0.9;
    background: rgba(56, 189, 248, 0.3);
    border-color: var(--szin-elsodleges);
}

/* --- Oldalsav (Sidebar) --- */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Alapbol rejtve */
    width: 280px;
    height: 100%;
    background: #1e293b;
    border-right: 1px solid #334155;
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.nyitva {
    left: 0;
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom: 1px solid #334155;
}

.sidebar-tabs {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.sidebar-tab {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    min-width: 44px;
}

.sidebar-tab:hover {
    background: #334155;
    color: #f8fafc;
}

.sidebar-tab.aktiv {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.sidebar-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.sidebar-panel.aktiv {
    display: block;
}

.session-lista {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

#uj-chat-gomb {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}

.session-lista {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.session-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    background: #0f172a;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.session-item:hover {
    background: #334155;
}

.session-item.aktiv {
    border-color: #3b82f6;
    background: #1e293b;
}

.session-item .cim {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-item .datum {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Inbox elemek */
.inbox-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    background: #0f172a;
    border: 1px solid #334155;
    transition: border 0.2s;
}

.inbox-item:hover {
    border-color: #3b82f6;
}

.inbox-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.inbox-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f8fafc;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-item-meta {
    font-size: 0.7rem;
    color: #94a3b8;
}

.inbox-item-preview {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.inbox-item-actions {
    display: flex;
    gap: 0.5rem;
}

.inbox-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.inbox-btn:hover {
    opacity: 0.85;
}

.inbox-btn-elfogad {
    background: #10b981;
    color: white;
}

.inbox-btn-elvet {
    background: #ef4444;
    color: white;
}

.inbox-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    font-size: 0.85rem;
}

/* Téma elemek */
.tema-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    background: #0f172a;
    border: 1px solid #334155;
    cursor: pointer;
    transition: border 0.2s, background 0.2s;
}

.tema-item:hover {
    border-color: #3b82f6;
    background: #1e293b;
}

.tema-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.2rem;
}

.tema-item-meta {
    font-size: 0.7rem;
    color: #94a3b8;
}

.tema-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    font-size: 0.85rem;
}

/* Árnyék az oldalsávon kívül */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.aktiv {
    display: block;
}

/* Alkalmazkodas az oldalsavhoz */
header, main, footer {
    transition: margin-left 0.3s ease;
}

@media (min-width: 1024px) {
    .sidebar.nyitva ~ header,
    .sidebar.nyitva ~ main,
    .sidebar.nyitva ~ footer {
        margin-left: 280px;
    }
}

/* Modellváltás jelzés */
.model-switch-uzenet {
    align-self: center;
    max-width: 100%;
    background: transparent;
    padding: 0.3rem 0;
}

.model-switch-jelzes {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.model-switch-jelzes svg {
    flex-shrink: 0;
}

.model-switch-jelzes strong {
    color: #f8fafc;
    font-weight: 600;
}
