/* ─── MaaSify ON DEMAND — Portal Shared Styles ─────── */
/* Reuses landing variables + adds portal-specific styles */

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

:root {
    --bg-dark: #0d0d1a;
    --bg-surface: #141428;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(231, 92, 11, 0.3);
    --orange: #E75C0B;
    --orange-light: #FF7A2F;
    --orange-glow: rgba(231, 92, 11, 0.25);
    --green: #22c55e;
    --red: #ef4444;
    --text: #f0f0f5;
    --text-dim: rgba(240, 240, 245, 0.55);
    --text-mid: rgba(240, 240, 245, 0.75);
    --radius: 16px;
    --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── Auth Pages (Login / Register) ──────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 30% 60%, var(--orange-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(231, 92, 11, 0.08) 0%, transparent 50%);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 44px 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(231, 92, 11, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px;
}

.auth-brand h1 {
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-brand h1 span {
    color: var(--orange);
    font-weight: 800;
}

.auth-brand p {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 4px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-glow);
}

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

.btn-auth {
    width: 100%;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--orange-glow);
}

.btn-auth:active { transform: scale(0.98); }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.auth-footer a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Dashboard Layout ────────────────────────────────── */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--glass-border);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
    text-decoration: none;
    color: var(--text);
}

.sidebar-logo-icon {
    width: 48px;
    height: 48px;
}

.sidebar-logo-text {
    font-weight: 300;
    font-size: 1.1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.sidebar-logo-text span {
    color: var(--orange);
    font-weight: 800;
}

.sidebar-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 12px 24px 8px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: var(--orange);
    background: rgba(231, 92, 11, 0.08);
    border-right: 2px solid var(--orange);
}

.sidebar-link .material-symbols-outlined {
    font-size: 20px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.sidebar-user-info { flex: 1; }
.sidebar-user-name { font-weight: 600; color: var(--text); }
.sidebar-user-plan { font-size: 0.75rem; color: var(--text-dim); }

/* ─── Main Content ────────────────────────────────────── */
.main-content {
    padding: 32px 40px;
    overflow-y: auto;
}

/* ─── Dashboard Page (with shared header, no sidebar) ──── */
.dashboard-page {
    padding-top: 100px;
    padding-bottom: 60px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* ─── Profile Page ────────────────────────────────────── */
.profile-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: start;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.profile-avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--glass-border);
    transition: border-color 0.2s;
}

.profile-avatar-preview:hover {
    border-color: var(--orange);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-initial {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
}

.profile-avatar-actions {
    width: 100%;
}

.profile-avatar-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-avatar-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.profile-hint-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: border-color 0.2s, color 0.2s;
}

.profile-hint-btn:hover {
    border-color: var(--orange);
    color: var(--text);
}

.profile-fields {
    min-width: 0;
}

/* ─── Cards ───────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .material-symbols-outlined {
    color: var(--orange);
    font-size: 20px;
}

/* ─── Stats Grid ──────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-value.green { color: var(--green); }
.stat-value.orange { color: var(--orange); }

/* ─── API Key Display ─────────────────────────────────── */
.key-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.key-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-mid);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.key-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 4px;
}

.key-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}

.btn-icon:hover { color: var(--text); border-color: var(--orange); }
.btn-icon.danger:hover { color: var(--red); border-color: var(--red); }

.btn-icon .material-symbols-outlined { font-size: 16px; }

.btn-small {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--orange-glow);
}

.btn-small .material-symbols-outlined { font-size: 16px; }

/* ─── Docs Page ───────────────────────────────────────── */
.docs-layout {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 40px 60px;
}

.docs-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 40px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13, 13, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.docs-section {
    margin-bottom: 48px;
}

.docs-section h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.docs-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 24px 0 12px;
    color: var(--orange);
}

.docs-section p {
    color: var(--text-mid);
    margin-bottom: 14px;
}

.docs-code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 12px 0 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-mid);
    overflow-x: auto;
}

.docs-code .key { color: #7dd3fc; }
.docs-code .string { color: #86efac; }
.docs-code .number { color: var(--orange-light); }
.docs-code .comment { color: rgba(255,255,255,0.25); }

.docs-endpoint {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.docs-method {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-right: 10px;
}

.docs-method.post { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.docs-method.get { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

.docs-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text);
}

/* ─── Plugin Catalog ──────────────────────────────────── */
.plugin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.plugin-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.plugin-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 4px 20px rgba(231, 92, 11, 0.08);
}

.plugin-card.coming-soon {
    opacity: 0.7;
}

.plugin-card.coming-soon:hover {
    border-color: var(--glass-border);
    box-shadow: none;
}

.plugin-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.plugin-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plugin-icon .material-symbols-outlined {
    font-size: 24px;
    color: #fff;
}

.plugin-meta { flex: 1; }

.plugin-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.plugin-subtitle {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.plugin-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plugin-badge.available {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.plugin-badge.soon {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    border: 1px solid var(--glass-border);
}

.plugin-description {
    color: var(--text-mid);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.plugin-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.plugin-feature {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.plugin-feature .material-symbols-outlined {
    font-size: 14px;
    color: var(--orange);
}

/* Plugin tabs */
.plugin-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--glass-border);
}

.plugin-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}

.plugin-tab:hover { color: var(--text-mid); }

.plugin-tab.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

.plugin-tab-content {
    display: none;
}

.plugin-tab-content.active {
    display: block;
}

/* Code snippets */
.plugin-snippet {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 16px 20px;
    position: relative;
    overflow-x: auto;
}

.plugin-snippet pre {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-mid);
}

.plugin-snippet .s-tag { color: #f472b6; }
.plugin-snippet .s-attr { color: #7dd3fc; }
.plugin-snippet .s-val { color: #86efac; }
.plugin-snippet .s-comment { color: rgba(255,255,255,0.25); }

.snippet-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}

.snippet-copy-btn:hover {
    color: var(--text);
    border-color: var(--orange);
}

.snippet-copy-btn .material-symbols-outlined {
    font-size: 16px;
}

/* Coming soon overlay */
.plugin-coming-soon-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    margin-top: 8px;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.85rem;
}

.plugin-coming-soon-overlay .material-symbols-outlined {
    font-size: 20px;
    color: var(--orange);
}

/* Demo widget preview */
.demo-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 0;
}

.demo-preset {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-preset:hover {
    background: rgba(231, 92, 11, 0.1);
    border-color: rgba(231, 92, 11, 0.3);
    color: var(--text-mid);
}

.demo-preset.active {
    background: rgba(231, 92, 11, 0.15);
    border-color: var(--orange);
    color: var(--orange);
}

.demo-widget-frame {
    height: 420px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #0a0a0a;
}

.demo-hint {
    padding: 10px 0 4px;
    font-size: 0.78rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-content { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .plugin-features { gap: 6px; }
}

