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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f1a;
    color: #fff;
    min-height: 100vh;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: #1a1a2e;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
}

.auth-form input:focus {
    outline: none;
    border-color: #6366f1;
}

.auth-form input::placeholder {
    color: #666;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox input {
    width: auto;
}

.checkbox label {
    font-size: 14px;
    color: #888;
    cursor: pointer;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.auth-links a {
    color: #6366f1;
    text-decoration: none;
    font-size: 14px;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background: #1a1a2e;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 18px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 18px;
}

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

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

.chat-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-item.active {
    background: rgba(99, 102, 241, 0.2);
}

.chat-name {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
}

.chat-date {
    font-size: 12px;
    color: #666;
}

.no-chats {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.sidebar-section {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section h3 {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.sidebar-section select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    margin-bottom: 8px;
}

.sidebar-section .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 14px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.chat-header h2 {
    font-size: 18px;
}

.chat-actions button {
    padding: 6px 12px;
    margin-left: 8px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 13px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.message {
    margin-bottom: 16px;
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: #4f46e5;
    border-bottom-right-radius: 4px;
}

.message.system .message-content {
    background: rgba(139, 92, 246, 0.2);
    font-style: italic;
    max-width: 100%;
}

.message.typing .message-content {
    opacity: 0.5;
}

.chat-input {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
}

.chat-input input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 15px;
}

.chat-input input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.chat-input button {
    padding: 14px 28px;
    border-radius: 24px;
    border: none;
    background: #4f46e5;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a2e;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 16px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    margin-bottom: 12px;
}

.modal-content textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.modal-buttons .btn {
    width: auto;
    padding: 10px 20px;
}

.import-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.import-section h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: #888;
}
