﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: #0a0a0a;
    color: #eeeeee;
    font-family: 'Inter', -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
}

.auth-wrapper, .profile-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.auth-card, .profile-card {
    background: #161616;
    border: 1px solid #222;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 45px 35px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    text-align: center;
}

    .auth-card h1 {
        font-size: 2.2rem;
        margin-bottom: 30px;
        letter-spacing: 2px;
        color: #ffffff;
        font-weight: 900;
    }

.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 20px;
    width: 100%;
}

    .input-group label {
        font-size: 11px;
        color: #888;
        text-transform: uppercase;
        margin-bottom: 8px;
        letter-spacing: 1px;
        font-weight: 600;
    }

.auth-card input {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    padding: 14px;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: 0.3s border-color;
}

    .auth-card input:focus {
        border-color: #007bff;
        background: #282828;
    }

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    padding-right: 44px;
}

.btn-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #333;
    background: rgba(255, 255, 255, 0.04);
    color: #ddd;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-eye:hover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.10);
    color: #fff;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 35px;
    background: #111;
    border-bottom: 1px solid #222;
    width: 100%;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    color: #007bff;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
}

.profile-trigger {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #007bff;
    cursor: pointer;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
}

#nav-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-logout {
    background: transparent;
    border: 1.5px solid #ff4444;
    color: #ff4444;
    padding: 7px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s all;
}

    .btn-logout:hover {
        background: #ff4444;
        color: white;
        box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
        align-content: center;
    }

.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100%;
    background: #111;
    border-right: 1px solid #222;
    z-index: 1000;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 25px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

    .sidebar.active {
        left: 0;
    }

.btn-new-chat {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #222;
    color: white;
    border: 1px solid #333;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: 0.2s;
}

    .btn-new-chat:hover {
        background: #2a2a2a;
        border-color: #007bff;
    }

.chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 950px;
    width: 95%;
    margin: 20px auto;
    background: #121212;
    border: 1px solid #222;
    border-radius: 18px;
    overflow: hidden;
}

#chat-box {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.msg {
    max-width: 78%;
    padding: 14px 20px;
    line-height: 1.6;
    font-size: 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.user-msg {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-msg {
    align-self: flex-start;
    background-color: #222;
    color: #eee;
    border: 1px solid #333;
    border-bottom-left-radius: 4px;
}

#chat-form {
    display: flex;
    padding: 22px;
    background: #181818;
    border-top: 1px solid #222;
    gap: 15px;
}

#chat-input {
    flex: 1;
    background: #252525;
    border: 1px solid #333;
    padding: 14px 22px;
    border-radius: 30px;
    color: white;
    outline: none;
    font-size: 15px;
}

.btn-primary, #chat-form button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-primary:hover {
        background: #0056b3;
        transform: translateY(-1px);
    }

.hidden {
    display: none !important;
}

.auth-card select {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    padding: 14px;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

.auth-card textarea {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    padding: 14px;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    outline: none;
    height: 120px;
    resize: none;
    font-family: inherit;
}

    .auth-card textarea:focus, .auth-card select:focus {
        border-color: #007bff;
    }

.profile-container {
    width: 100%;
    max-width: 820px;
    background: #121212;
    border: 1px solid #222;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.profile-header {
    padding: 28px 28px 22px;
    border-bottom: 1px solid #222;
    text-align: center;
    background: linear-gradient(180deg, rgba(0, 123, 255, 0.10), rgba(0, 0, 0, 0));
}

.avatar-container {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #007bff;
    margin: 0 auto 12px;
    background: #1b1b1b;
}

#profile-pic-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#user-display-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.user-role {
    margin-top: 6px;
    color: #a5a5a5;
    font-size: 0.95rem;
}

.profile-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.data-section {
    border: 1px solid #222;
    border-radius: 16px;
    background: #141414;
    padding: 18px;
}

.data-section h3 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #cfcfcf;
    margin-bottom: 12px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.info-box {
    background: #101010;
    border: 1px solid #222;
    border-radius: 14px;
    padding: 12px;
}

.info-box.full-width {
    grid-column: 1 / -1;
}

.info-box label {
    display: block;
    font-size: 11px;
    color: #8f8f8f;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 700;
}

.info-box span {
    display: block;
    font-size: 15px;
    color: #f1f1f1;
}

.profile-container input,
.profile-container textarea {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #333;
    padding: 12px 14px;
    border-radius: 12px;
    color: #fff;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

.profile-container textarea {
    min-height: 120px;
    resize: vertical;
}

.profile-container input:focus,
.profile-container textarea:focus {
    border-color: #007bff;
    background: #232323;
}

.profile-footer {
    padding: 18px 22px;
    border-top: 1px solid #222;
    display: flex;
    justify-content: flex-end;
    background: #111;
}

.profile-wrapper {
    align-items: flex-start;
    padding-top: 32px;
    min-height: calc(100vh - 60px);
}

#btn-save-instructions,
#btn-change-password {
    background: #007bff;
    border: 1px solid #007bff;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

#btn-save-instructions:hover,
#btn-change-password:hover {
    background: #0056b3;
    border-color: #0056b3;
}

#btn-save-instructions:active,
#btn-change-password:active {
    transform: translateY(1px);
}

.data-section > div[style*="justify-content:flex-end"] {
    margin-top: 10px;
}

/* ===== Nav Buttons (Return to Chat + History) ===== */

.back-btn,
.btn-sidebar {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;
    border-radius: 12px;

    font-weight: 700;
    font-size: 13px;
    line-height: 1;

    cursor: pointer;

    color: #eee;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #2a2a2a;

    transition: 0.2s;
}

.back-btn:hover,
.btn-sidebar:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: #007bff;
}

.back-btn:active,
.btn-sidebar:active {
    transform: translateY(1px);
}

/* History icon spacing */
.btn-sidebar span {
    display: inline-flex;
    width: 18px;
    justify-content: center;
    font-size: 16px;
}

/* ===== History Sidebar UI ===== */

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

.btn-sidebar-close {
    margin-left: auto;
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #d7d7d7;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-sidebar-close:hover {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.08);
}

.history-label {
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #8f8f8f;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.history-item {
    background: #101010;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    color: #eaeaea;
    font-size: 13px;
    line-height: 1.35;
}

.history-item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.history-item-main {
    flex: 1;
    min-width: 0;
}

.history-delete {
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #ff6666;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    flex: 0 0 auto;
}

.history-delete:hover {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.08);
    color: #ff4444;
}

