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

html, body {
    height: 100%;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-image: url('background-home.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
}

/* NAVBAR */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 64px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: white !important;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: rgba(255,255,255,0.75) !important;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: white !important; }

.nav-cta {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 8px 18px !important;
    color: white !important;
    transition: background 0.2s !important;
}

.nav-cta:hover { background: rgba(255,255,255,0.22) !important; }

/* LAYOUT */
.ai-layout {
    display: grid;
    grid-template-columns: 220px 1fr 200px;
    gap: 16px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 64px);
}

/* SIDEBARS */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.sidebar-section {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 16px;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 12px;
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tips-list li {
    font-size: 0.75rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.65);
    padding-left: 10px;
    border-left: 2px solid rgba(255,255,255,0.15);
}

.tips-list a {
    color: rgba(125,255,210,0.85) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.suggestion {
    font-size: 0.74rem;
    color: rgba(255,255,255,0.65);
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.4;
}

.suggestion:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.history-item {
    font-size: 0.73rem;
    color: rgba(255,255,255,0.55);
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    line-height: 1.4;
}

.history-empty {
    font-size: 0.73rem;
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

/* CHAT */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 20px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

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

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(125,255,210,0.15);
    border: 1px solid rgba(125,255,210,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: rgba(125,255,210,0.9);
}

.chat-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.chat-status {
    font-size: 0.72rem;
    color: rgba(125,255,210,0.7);
    margin-top: 1px;
}

.clear-btn {
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.msg-user { display: flex; justify-content: flex-end; }
.msg-ai { display: flex; justify-content: flex-start; }

.msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.user-bubble {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-bottom-right-radius: 4px;
    color: white;
}

.ai-bubble {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom-left-radius: 4px;
    color: rgba(125,255,210,0.9);
}

.ai-bubble p { margin: 4px 0; }
.ai-bubble ul { padding-left: 16px; }

.typing-dots {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(125,255,210,0.6);
    animation: bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-6px); opacity: 1; }
}

#input-row {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

#userInput {
    flex: 1;
    padding: 11px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: white;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

#userInput::placeholder { color: rgba(255,255,255,0.3); }
#userInput:focus {
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.13);
}

button {
    padding: 11px 22px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover { background: rgba(255,255,255,0.25); }
button:active { transform: scale(0.98); }

a:link, a:visited, a:hover { text-decoration: none; }