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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* ========== LOGIN ========== */
.login-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    font-size: 3em;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.login-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary, .btn-secondary, .btn-send {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-bottom: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
}

.demo-info {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.demo-info p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

/* ========== NAVBAR ========== */
.navbar {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

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

.nav-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.nav-btn-logout {
    padding: 10px 20px;
    border: none;
    background: #e74c3c;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* ========== CHAT ========== */
.tab-content {
    padding: 20px;
}

.chat-container {
    background: white;
    border-radius: 20px;
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

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

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.message {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

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

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 15px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message.assistant .message-content {
    background: #f0f0f0;
    color: #333;
}

.chat-input-container {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

#message-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
}

#message-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-send {
    width: auto;
    padding: 15px 30px;
}

/* ========== NOTES ========== */
.notes-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    min-height: calc(100vh - 140px);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.notes-header h2 {
    color: #333;
}

.create-note {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.create-note input,
.create-note textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group button {
    flex: 1;
}

.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
}

.notes-list {
    display: grid;
    gap: 15px;
}

.note-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.note-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.note-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.note-card p {
    color: #666;
    margin-bottom: 10px;
}

.note-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
}

/* ========== MCP ========== */
.mcp-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    min-height: calc(100vh - 140px);
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.mcp-tools-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tool-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.tool-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102,126,234,0.2);
}

.tool-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.mcp-tester {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
}

.mcp-tester h3 {
    margin-bottom: 20px;
    color: #333;
}

#tool-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1em;
}

.tool-params {
    margin-bottom: 20px;
}

.tool-params input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.tool-result {
    margin-top: 20px;
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .message-content {
        max-width: 85%;
    }
}