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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #000000;
    background-color: #f8f9fa;
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #f8f9fa;
}

.auth-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #e0e0e0;
}

.auth-box h1 {
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    color: #000000;
}

.auth-box .subtitle {
    text-align: center;
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #000000;
    background: #ffffff;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-tab.active {
    background: #000000;
    color: #ffffff;
}

.auth-tab:hover {
    background: #000000;
    color: #ffffff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #000000;
}

.auth-error {
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 15px;
    min-height: 20px;
    border: 2px solid #dc2626;
    padding: 10px;
    border-radius: 8px;
    background: #ffebee;
}

.auth-btn {
    width: 100%;
    padding: 15px 20px;
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-btn:hover:not(:disabled) {
    background: #333333;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    position: relative;
    background: #ffffff;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
}

.google-btn {
    width: 100%;
    padding: 15px 20px;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-btn:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
}

.google-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.username-display {
    font-weight: 600;
    color: #000000;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

header {
    margin-bottom: 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e0e0e0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title {
    text-align: left;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background: #f0f0f0;
}

.menu-btn svg {
    color: #333;
}

.main-content {
    display: flex;
    gap: 0;
    height: calc(100vh - 100px);
}

/* Memory Sidebar */
.memory-sidebar {
    width: 320px;
    background: #ffffff;
    border-radius: 0;
    border: none;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
}

.memory-sidebar.hidden {
    display: none;
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #000000;
    color: white;
}

.memory-header h2 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.icon-btn svg {
    color: white;
}

.memory-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.memory-loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

.memory-section {
    margin-bottom: 20px;
}

.memory-section h3 {
    font-size: 1em;
    font-weight: 600;
    color: #000000;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.memory-item {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
    line-height: 1.5;
}

.memory-item strong {
    color: #333;
}

.memory-empty {
    color: #999;
    font-style: italic;
    padding: 10px;
}

.user-facts-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
}

.user-facts-section h3 {
    color: #000000;
    font-weight: 700;
    margin-bottom: 15px;
}

.memory-category {
    margin-bottom: 12px;
}

.memory-category strong {
    color: #000000;
    font-size: 0.9em;
}

.fact-item {
    display: inline-block;
    margin-left: 10px;
    color: #444;
    font-size: 0.9em;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

h1 {
    font-size: 2.5em;
    font-weight: 600;
    color: #000000;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: #666666;
    letter-spacing: 0.5px;
}

.user-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e0e0e0;
}

.user-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.user-input-group label {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000000;
}

.user-input-group input {
    padding: 12px 24px;
    border: 1px solid #000000;
    border-radius: 8px;
    font-size: 16px;
    background-color: #ffffff;
    color: #000000;
    transition: all 0.3s;
}

.user-input-group input:focus {
    outline: none;
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

.secondary-btn {
    padding: 12px 24px;
    border: 1px solid #000000;
    border-radius: 8px;
    background-color: #ffffff;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.secondary-btn:hover {
    background-color: #000000;
    color: #ffffff;
    transform: translateY(-2px);
}

.chat-container {
    background: #ffffff;
    border-radius: 0;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-message {
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.welcome-message h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #000000;
}

.welcome-message p {
    margin-bottom: 15px;
    color: #666666;
}

.welcome-message ul {
    margin-left: 20px;
    margin-bottom: 15px;
    color: #666666;
}

.welcome-message li {
    margin-bottom: 8px;
}

.message {
    padding: 20px 25px;
    border-radius: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #000000;
}

.message.assistant {
    align-self: flex-start;
    background-color: #f8f9fa;
    color: #000000;
    border: 1px solid #e0e0e0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-content {
    line-height: 1.6;
    font-size: 16px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
}

/* Logged Summary */
.logged-summary {
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #22c55e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.logged-summary-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.logged-summary-text {
    flex: 1;
    color: #166534;
}

.logged-summary-text strong {
    font-weight: 600;
    color: #14532d;
}

.extracted-data {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.message.user .extracted-data {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.message.assistant .extracted-data {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.extracted-data-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-item {
    margin: 5px 0;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.message.user .data-item {
    background-color: rgba(255, 255, 255, 0.15);
}

.follow-up-questions {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    border-left: 4px solid #000000;
}

.follow-up-questions-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.follow-up-questions ul {
    margin-left: 20px;
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    display: flex;
    gap: 15px;
}

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attach-btn {
    padding: 10px;
    border: 2px solid #000000;
    border-radius: 8px;
    background-color: #ffffff;
    color: #000000;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
}

.attach-btn:hover {
    background-color: #000000;
    color: #ffffff;
}

.attach-btn svg {
    stroke: currentColor;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 0;
}

.file-preview:empty {
    display: none;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.file-preview-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.file-preview-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
}

.file-preview-remove:hover {
    color: #991b1b;
}

#message-input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid #000000;
    border-radius: 8px;
    font-size: 16px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    resize: none;
    background-color: #ffffff;
    color: #000000;
    transition: all 0.3s;
}

#message-input:focus {
    outline: none;
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

#message-input::placeholder {
    color: #666666;
}

#message-input:focus::placeholder {
    color: #999999;
}

.send-btn {
    padding: 15px 40px;
    border: 1px solid #000000;
    border-radius: 8px;
    background-color: #000000;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.send-btn:hover {
    background-color: #ffffff;
    color: #000000;
    transform: translateY(-2px);
}

.send-btn:disabled {
    background-color: #666666;
    border-color: #666666;
    cursor: not-allowed;
    transform: none;
}

.loading {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #000000;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 20px 25px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    max-width: 80px;
    align-self: flex-start;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #000000;
    animation: typing 1.4s ease-in-out infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    .user-section {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .user-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-container {
        height: calc(100vh - 400px);
    }

    .message {
        max-width: 90%;
    }

    .chat-input-container {
        flex-direction: column;
    }

    .send-btn {
        width: 100%;
    }
}

/* Debug Modal Styles */
.debug-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.debug-modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 2px solid #000000;
}

.debug-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e0e0e0;
    background: #000000;
    color: #ffffff;
    border-radius: 10px 10px 0 0;
}

.debug-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.debug-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s;
}

.debug-modal-close:hover {
    color: #cccccc;
    transform: rotate(90deg);
}

.debug-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f8f9fa;
}

.debug-modal-body pre {
    margin: 0;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #000000;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.debug-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    background: #ffffff;
    border-radius: 0 0 10px 10px;
}

.debug-modal-copy {
    padding: 12px 24px;
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.debug-modal-copy:hover {
    background: #333333;
    transform: translateY(-2px);
}

/* Add hover effect to messages to indicate they're clickable */
.message {
    transition: all 0.2s;
}

.message:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
