/* Supa Terminal - Light Theme (Claude Code style) */

:root {
    /* Background colors */
    --bg-main: #fafafa;
    --bg-panel: #ffffff;
    --bg-code: #f7f7f7;
    --bg-hover: #f0f0f0;

    /* Border colors */
    --border-light: #e5e5e5;
    --border-medium: #d4d4d4;
    --border-orange: #ea580c;

    /* Text colors */
    --text-primary: #1a1a1a;
    --text-secondary: #525252;
    --text-muted: #737373;
    --text-dim: #a3a3a3;

    /* Accent colors */
    --orange: #ea580c;
    --orange-light: #fed7aa;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --green: #16a34a;
    --green-light: #dcfce7;
    --yellow: #ca8a04;
    --yellow-light: #fef9c3;
    --red: #dc2626;
    --red-light: #fee2e2;

    /* Typography */
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
    --font-size-sm: 12px;
    --font-size-base: 13px;
    --font-size-lg: 14px;
}

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

body {
    font-family: var(--font-mono);
    font-size: var(--font-size-base);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* App Layout */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* =================== */
/* Welcome Section     */
/* =================== */

.welcome-box {
    flex-shrink: 0;
    padding-bottom: 16px;
    margin-bottom: 8px;
}

.welcome-version {
    color: var(--orange);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: 16px;
}

.welcome-content {
    display: flex;
    gap: 40px;
}

.welcome-left {
    flex: 1;
}

.welcome-right {
    width: 280px;
    flex-shrink: 0;
}

.welcome-greeting {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    margin-bottom: 16px;
}

.ascii-logo {
    color: var(--orange);
    font-size: 10px;
    line-height: 1.15;
    margin: 0 0 16px 0;
    font-family: var(--font-mono);
}

.welcome-tagline {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin-bottom: 20px;
}

.welcome-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-base);
    color: var(--text-muted);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-sep {
    color: var(--text-dim);
}

.info-dot {
    color: var(--green);
    font-size: 10px;
}

/* Tips Section */
.tips-section {
    margin-bottom: 16px;
}

.tips-title {
    color: var(--orange);
    font-weight: 600;
    font-size: var(--font-size-base);
    margin-bottom: 8px;
}

.tips-list {
    font-size: var(--font-size-base);
}

.tip-item {
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.6;
}

.tip-cmd {
    color: var(--blue);
    font-weight: 500;
}

/* Activity Section */
.activity-section {
}

.activity-title {
    color: var(--orange);
    font-weight: 600;
    font-size: var(--font-size-base);
    margin-bottom: 8px;
}

.activity-preview {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.activity-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.activity-preview-item:last-child {
    margin-bottom: 0;
}

.activity-preview-icon {
    flex-shrink: 0;
}

.activity-preview-icon.success {
    color: var(--green);
}

.activity-preview-icon.error {
    color: var(--red);
}

.activity-preview-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.activity-preview-type {
    flex-shrink: 0;
    font-weight: 500;
}

.activity-preview-type.support {
    color: var(--blue);
}

.activity-preview-type.marketing {
    color: var(--yellow);
}

.no-activity {
    color: var(--text-dim);
}

/* =================== */
/* Terminal Output     */
/* =================== */

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px;
    min-height: 0;
}

.terminal-output:empty {
    display: none;
}

/* Log Entry Styles */
.log-entry {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-command {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
}

.log-prefix {
    color: var(--text-muted);
    font-weight: 500;
}

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

.log-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 8px 20px;
    font-size: var(--font-size-sm);
}

.log-status .status-icon {
    color: var(--blue);
    animation: pulse 1s ease-in-out infinite;
}

.log-status .status-icon.done {
    color: var(--green);
    animation: none;
}

.log-status .status-icon.error {
    color: var(--red);
    animation: none;
}

.log-status .status-msg {
    color: var(--text-secondary);
}

.log-status .status-msg.done {
    color: var(--green);
}

.log-status .status-msg.error {
    color: var(--red);
}

.log-result {
    margin-top: 8px;
}

.log-result:empty {
    display: none;
}

/* Result Block */
.result-block {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-code);
    border-bottom: 1px solid var(--border-light);
}

.result-title {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.result-badge.support {
    background: var(--blue-light);
    color: var(--blue);
}

.result-badge.marketing {
    background: var(--yellow-light);
    color: var(--yellow);
}

.result-badge.spam {
    background: var(--red-light);
    color: var(--red);
}

.result-badge.posted {
    background: var(--green-light);
    color: var(--green);
}

.result-body {
    padding: 14px;
}

/* Result Fields */
.result-field {
    display: flex;
    margin-bottom: 8px;
}

.result-field:last-child {
    margin-bottom: 0;
}

.field-label {
    width: 100px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.field-value {
    color: var(--text-primary);
    word-break: break-word;
}

/* Result Sections */
.result-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.section-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Match List */
.match-list {
    list-style: none;
}

.match-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: var(--font-size-sm);
}

.match-num {
    width: 20px;
    color: var(--text-dim);
}

.match-title {
    flex: 1;
    color: var(--text-secondary);
}

.match-score {
    color: var(--green);
    font-size: 11px;
    margin-left: 8px;
}

.no-matches {
    color: var(--text-dim);
    font-style: italic;
    font-size: var(--font-size-sm);
}

/* Response Preview */
.response-preview {
    background: var(--bg-code);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 14px;
    max-height: 300px;
    overflow-y: auto;
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.response-preview p {
    margin-bottom: 12px;
}

.response-preview p:last-child {
    margin-bottom: 0;
}

.response-preview ul, .response-preview ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.response-preview li {
    margin-bottom: 4px;
}

.response-preview a {
    color: var(--blue);
}

/* Action Buttons */
.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background: #c2410c;
    border-color: #c2410c;
}

.btn-secondary {
    background: var(--bg-panel);
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

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

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

/* =================== */
/* Terminal Input      */
/* =================== */

.terminal-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    flex-shrink: 0;
}

.input-prompt {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-size-base);
    outline: none;
}

.terminal-input::placeholder {
    color: var(--text-dim);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* =================== */
/* Error Message       */
/* =================== */

.error-message {
    color: var(--red);
    background: var(--red-light);
    padding: 12px 14px;
    border-radius: 6px;
    font-size: var(--font-size-sm);
}

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

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-size-base);
    margin-bottom: 16px;
    outline: none;
}

.modal-input:focus {
    border-color: var(--orange);
}

.modal-content .btn {
    width: 100%;
}

/* =================== */
/* Scrollbar           */
/* =================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

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

@media (max-width: 768px) {
    .app {
        padding: 12px;
    }

    .welcome-content {
        flex-direction: column;
    }

    .welcome-left {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 20px;
    }

    .welcome-right {
        width: 100%;
    }

    .ascii-logo {
        font-size: 8px;
    }
}
