:root {
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: rgba(255, 255, 255, 0.15);
    --accent-color: #a370f7;
    --accent-glow: rgba(163, 112, 247, 0.4);
    --text-main: #f5f5f7;
    --text-muted: #98989d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: #09090b;
    color: var(--text-main);
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.liquid-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.blob.one {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.blob.two {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.blob.three {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #db2777 0%, transparent 70%);
    top: 40%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(-50px, -40px) scale(0.9) rotate(360deg);
    }
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.orion-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.orion-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.orion-title span {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.spinning-ring {
    transform-origin: center;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.auth-container {
    width: 400px;
    padding: 40px;
    text-align: center;
}

.auth-container h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.auth-container p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.glass-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.glass-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.compact-btn {
    padding: 9px 12px;
    font-size: 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.auth-switch {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent-color);
    text-decoration: none;
}

.error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.app-container {
    display: flex;
    width: 95vw;
    height: 90vh;
    position: relative;
}

.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid var(--glass-border);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.chat-item {
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.chat-item:hover,
.chat-item.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}

.chat-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: #ef4444;
}

.user-info-bottom {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}

.user-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.logout-link:hover {
    color: #ff4c4c;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
}

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

.message {
    max-width: 75%;
    padding: 14px 20px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 15px;
}

.message.user {
    background: var(--accent-color);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.message.assistant {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Bemeneti mező és a figyelmeztető szöveg (disclaimer) */
.input-area {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-wrapper {
    width: 100%;
    max-width: 900px;
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 12px 18px;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    background: none;
    border: none;
    color: white;
    resize: none;
    outline: none;
    font-size: 15px;
    line-height: 22px;
    padding: 8px 0;
    overflow-y: auto;
    max-height: 120px;
}

.circle-send-btn {
    background: white;
    color: black;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 12px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.circle-send-btn:hover {
    transform: scale(1.05);
}

.disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
    opacity: 0.8;
    text-align: center;
    max-width: 900px;
}

.mobile-menu-btn,
.mobile-overlay,
.close-menu-btn {
    display: none;
}

.broadcast-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.broadcast-content {
    width: 420px;
    max-width: 90%;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .app-container {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 20px;
        flex-shrink: 0;
    }

    .sidebar {
        position: absolute;
        z-index: 100;
        height: 100%;
        width: 280px;
        background: #0f0f12;
        transform: translateX(-100%);
        transition: 0.3s;
        padding-top: calc(24px + env(safe-area-inset-top));
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
    }

    .mobile-overlay.active {
        display: block;
    }

    .close-menu-btn {
        display: block;
        position: absolute;
        top: calc(20px + env(safe-area-inset-top));
        right: 20px;
        border: none;
        background: none;
        color: white;
        font-size: 24px;
    }

    .chat-header {
        padding: calc(15px + env(safe-area-inset-top)) 15px 15px 15px;
        gap: 10px;
    }

    .chat-header h2 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80%;
        font-size: 16px !important;
    }

    .input-area {
        padding: 15px 15px calc(15px + env(safe-area-inset-bottom)) 15px;
    }

    .message {
        max-width: 90%;
    }
}

/* --- KÉPGENERÁLÁS TÖLTŐKÉPERNYŐ --- */
.img-wrapper {
    position: relative;
    margin: 15px 0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--glass-border);
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.img-loading {
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: pulse 1.5s infinite;
}

.img-loading i {
    animation: spin 1s linear infinite;
}

.chat-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: none; /* Rejtve marad, amíg le nem generálódik */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}