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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e8e8e8;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #888;
    margin-top: 0.5rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1e1e30;
    color: #fff;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box button, button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.tab {
    background: transparent;
    border: none;
    color: #888;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.tab.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.placeholder {
    color: #666;
    text-align: center;
    padding: 2rem;
}

.result-item, .doc-item {
    background: #1e1e30;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.result-item:hover, .doc-item:hover {
    border-color: #667eea;
}

.result-title, .doc-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.result-snippet {
    color: #aaa;
    font-size: 0.9rem;
}

.result-snippet mark {
    background: rgba(102, 126, 234, 0.3);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}

.result-meta, .doc-meta {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.doc-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #667eea;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-row label {
    color: #888;
}

.filter-row select {
    padding: 0.5rem;
    background: #1e1e30;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
}

#reindex-btn {
    margin-left: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #888;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1e1e30;
    color: #fff;
    font-family: inherit;
}

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

#learn-form button {
    width: 100%;
}

#learn-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

#learn-message.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

#learn-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1e1e30;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: auto;
    padding: 1.5rem;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

#modal-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
}

#modal-content {
    white-space: pre-wrap;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ccc;
}

.close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #fff;
}

footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.85rem;
}
