:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --border: #2a2a35;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 15px;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 48px;
    margin-bottom: 10px;
    color: var(--accent);
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.status-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

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

.oracle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.card-icon {
    color: var(--accent);
    font-weight: bold;
}

.model-selector {
    margin-bottom: 20px;
}

.model-selector label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.model-selector select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.model-selector select:hover {
    border-color: var(--accent);
}

.input-area {
    position: relative;
    margin-bottom: 20px;
}

.input-area textarea {
    width: 100%;
    height: 120px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-area textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

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

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

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

.quick-prompts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.quick-prompt {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-prompt:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.response-area {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    min-height: 150px;
    position: relative;
}

.response-area.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #a855f7, var(--accent));
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px 12px 0 0;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.response-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.response-text {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.response-text.placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.metadata {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.meta-item {
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.history-item {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 10px;
}

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

.history-prompt {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.history-response {
    font-size: 14px;
    line-height: 1.5;
}

.history-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--accent);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Wallet styles */
.wallet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.1);
}

.wallet-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.btn-wallet {
    background: linear-gradient(135deg, #f6851b, #e2761b);
    color: white;
}

.btn-wallet:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(246, 133, 27, 0.3);
}

.btn-chain {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-chain:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

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

.wallet-address, .wallet-balance {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.wallet-address .label, .wallet-balance .label {
    color: var(--text-secondary);
    font-size: 13px;
}

.wallet-address .address {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: var(--accent);
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 6px;
}

.status-dot.disconnected {
    background: var(--error);
}

.status-dot.connected {
    background: var(--success);
}

.wallet-status {
    cursor: pointer;
}

#meta-tx {
    color: var(--accent);
    text-decoration: none;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
}

#meta-tx:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .header h1 { font-size: 24px; }
    .oracle-card { padding: 20px; }
    .button-row { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}
