/* Ardyn Ghost Dashboard Styles */
:root {
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --accent-primary: #a855f7;
    --accent-secondary: #22c55e;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #3f3f46;
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Login Styles */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

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

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

.btn-primary:hover {
    background: #9333ea;
}

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

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

.alert {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

/* Dashboard Styles */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.new-chat-btn {
    width: 100%;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
}

.chat-history-header {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-list {
    padding: 0 1rem;
}

.chat-item {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: var(--bg-tertiary);
}

.chat-item.active {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.chat-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.chat-item-preview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ghost-score-panel {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}

.ghost-score-header {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.ghost-score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.ghost-score-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.ghost-score-details > div {
    margin-bottom: 0.25rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ghost-score-mini {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Chat Area */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.chat-messages {
    max-width: 800px;
    margin: 0 auto;
}

.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-message h2 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.welcome-message p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.message {
    display: flex;
    margin-bottom: 2rem;
}

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

.message-bubble {
    max-width: 70%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    line-height: 1.5;
}

.message.user .message-bubble {
    background: var(--accent-primary);
    color: white;
}

.message.assistant .message-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.ghost-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-secondary);
    margin-top: 0.5rem;
}

.ghost-badge svg {
    width: 14px;
    height: 14px;
}

/* Input Area */
.input-area {
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.input-controls {
    max-width: 800px;
    margin: 0 auto 1rem;
}

.model-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.input-container textarea {
    flex: 1;
    min-height: 50px;
    max-height: 200px;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
}

.input-container textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.input-container button {
    background: var(--accent-primary);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s;
}

.input-container button:hover {
    background: #9333ea;
}

.input-container button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Processing States */
.processing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 600px;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-body {
    padding: 2rem;
}

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

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.settings-section .input-group {
    margin-bottom: 1rem;
}

.settings-section label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .top-bar {
        padding: 1rem;
    }
    
    .chat-area {
        padding: 1rem;
    }
    
    .input-area {
        padding: 1rem;
    }
    
    .input-container textarea {
        min-height: 44px;
    }
}
