@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
    --bg: #000000;
    --fg: #ffffff;
    --accent: #00ff00;
    --muted: #666666;
    --input-bg: #0a0a0a;
    --border: #333333;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 300;
}

.terminal-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

.header {
    padding: 40px 20px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.title {
    font-size: 24px;
    font-weight: 400;
    color: var(--fg);
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
    cursor: pointer;
    transition: color 0.2s ease;
}

.title::after {
    content: '_';
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.reset-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 16px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.reset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    opacity: 1;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.output {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    margin-bottom: 20px;
}

.output::-webkit-scrollbar {
    width: 6px;
}

.output::-webkit-scrollbar-track {
    background: transparent;
}

.output::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.output::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.message {
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user {
    color: var(--fg);
}

.message.user::before {
    content: '> ';
    color: var(--accent);
}

.message.ai {
    color: var(--fg);
    opacity: 0;
    animation: typeIn 0.5s ease-out forwards;
}

.message.loading {
    color: var(--muted);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes typeIn {
    to { opacity: 1; }
}

@keyframes pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt {
    color: var(--accent);
    font-size: 14px;
    user-select: none;
}

.input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--fg);
    font-family: inherit;
    font-size: 16px;
    font-weight: 300;
    outline: none;
    padding: 0;
    caret-color: var(--accent);
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

.input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

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

.config-content {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 40px;
    max-width: 500px;
    width: 90%;
}

.config-content h3 {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 20px;
    color: var(--fg);
}

.config-content input {
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    font-weight: 300;
    margin: 20px 0;
    outline: none;
    caret-color: var(--accent);
}

.config-content input:focus {
    border-bottom-color: var(--accent);
}

.config-buttons {
    display: flex;
    gap: 20px;
    margin: 30px 0 0 0;
}

.config-buttons button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 10px 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-buttons button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.config-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 20px;
    opacity: 0.7;
}

.commands {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.commands:hover {
    opacity: 1;
}

.commands span {
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.commands span:hover {
    color: var(--accent);
}

.error {
    color: #ff4444;
}

.success {
    color: var(--accent);
}

.title:hover {
    color: var(--accent);
}

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

.disclaimer-content {
    background: var(--bg);
    border: 1px solid var(--accent);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.disclaimer-content h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--accent);
    text-align: center;
}

.disclaimer-content p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: var(--fg);
}

.disclaimer-content strong {
    color: var(--accent);
    font-weight: 500;
}

.disclaimer-content ul {
    margin: 16px 0 16px 20px;
    color: var(--fg);
}

.disclaimer-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.close-disclaimer-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 12px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 20px;
}

.close-disclaimer-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.disclaimer-footer {
    text-align: center;
    margin: 20px 0 10px 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.github-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.github-link:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .terminal-container {
        max-width: 100%;
    }
    
    .header {
        padding: 20px 15px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .title {
        font-size: 20px;
    }
    
    .output {
        padding: 0 15px;
    }
    
    .input-area {
        padding: 15px;
        position: sticky;
        bottom: 0;
        background: var(--bg);
    }
    
    .input {
        font-size: 16px;
        min-height: 44px;
        line-height: 1.5;
        padding: 10px 0;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 0;
    }
    
    .commands {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 15px 0;
        opacity: 0.5;
    }
    
    .disclaimer-content {
        padding: 30px 20px;
        margin: 20px;
        width: auto;
    }
    
    .disclaimer-content h3 {
        font-size: 16px;
    }
}