/* ==================== */
/* CSS Variables & Reset */
/* ==================== */

:root {
    --primary: #10a37f;
    --primary-hover: #0d8a6a;
    --background: #0d0d0d;
    --surface: #171717;
    --surface-hover: #212121;
    --text-primary: #ececec;
    --text-secondary: #8e8e8e;
    --border: #2f2f2f;
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Orbitron', monospace;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
    text-shadow: 0 0 10px rgba(236, 236, 236, 0.1);
}

/* ==================== */
/* Container */
/* ==================== */

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

/* ==================== */
/* Top Navigation */
/* ==================== */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    z-index: 100;
    background: transparent;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

.nav-btn:hover {
    background: var(--surface-hover);
    border-color: var(--text-secondary);
}

#settingsBtn {
    display: none;
}

/* ==================== */
/* Welcome Screen */
/* ==================== */

.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 4rem;
}

.welcome-content {
    text-align: center;
}

.brand-logo {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    filter: drop-shadow(0 0 20px rgba(236, 236, 236, 0.3));
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.welcome-input {
    width: 100%;
    max-width: 700px;
}

.main-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.main-input:focus {
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.main-input::placeholder {
    color: var(--text-secondary);
}

/* ==================== */
/* Chat View */
/* ==================== */

.chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 4rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--surface-hover);
}

/* ==================== */
/* Messages */
/* ==================== */

.message {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    animation: fadeSlideIn 0.3s ease;
}

.user-message {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.assistant-message {
    background: transparent;
}

.message-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-text p {
    margin-bottom: 1rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* ==================== */
/* Typing Indicator */
/* ==================== */

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

/* ==================== */
/* Chat Input */
/* ==================== */

.chat-input-container {
    padding: 1.5rem 2rem 2rem;
    background: var(--background);
}

.chat-input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 200px;
    min-height: 24px;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    background: var(--text-primary);
    border: none;
    color: var(--background);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--text-secondary);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.send-icon {
    width: 16px;
    height: 16px;
}

/* ==================== */
/* Modal */
/* ==================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ==================== */
/* Form Elements */
/* ==================== */

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.input-group {
    position: relative;
    display: flex;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.input-group input {
    padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.toggle-visibility {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toggle-visibility:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.eye-icon {
    width: 18px;
    height: 18px;
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ==================== */
/* Buttons */
/* ==================== */

.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--background);
}

.btn-primary:hover {
    background: var(--text-secondary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

/* ==================== */
/* Animations */
/* ==================== */

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

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* ==================== */
/* Responsive Design */
/* ==================== */

@media (max-width: 768px) {
    .brand-logo {
        font-size: 3rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .welcome-screen {
        gap: 3rem;
        padding: 1.5rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message {
        padding: 1rem;
    }

    .chat-input-container {
        padding: 1rem;
    }

    .top-nav {
        padding: 1rem;
    }

    .nav-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .brand-logo {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .nav-btn svg {
        display: none;
    }
}

/* ==================== */
/* Utility Classes */
/* ==================== */

.hidden {
    display: none !important;
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.success-message {
    color: var(--success);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
