/* ============================================
   Demo-specific styles
   Extends the Proximity Green brand system
   ============================================ */

/* ---- Demo Hub ---- */

.demo-hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.demo-hero .dot-large {
    width: 18px;
    height: 18px;
    background: var(--sage);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    box-shadow:
        0 0 12px rgba(122, 168, 130, 0.6),
        0 0 40px rgba(122, 168, 130, 0.3),
        0 0 80px rgba(122, 168, 130, 0.15);
    animation: pulse 2.4s ease-in-out infinite;
}

.demo-hero h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.demo-hero h1 em {
    color: var(--moss);
    font-style: italic;
}

.demo-hero .lead {
    max-width: 560px;
    margin: 0 auto;
}

.demo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 2.5rem 0;
}

.demo-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    color: var(--text);
}

.demo-card:hover {
    border-color: var(--pale-sage);
    box-shadow: 0 4px 20px rgba(61, 97, 71, 0.08);
    transform: translateY(-2px);
    text-decoration: none;
}

.demo-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.demo-card-icon.icon-member {
    background: var(--hover-green);
    border: 2px solid var(--pale-sage);
}

.demo-card-icon.icon-admin {
    background: var(--amber-bg);
    border: 2px solid rgba(184, 146, 74, 0.3);
}

.demo-card-icon.icon-booking {
    background: var(--blue-bg);
    border: 2px solid rgba(74, 122, 184, 0.3);
}

.demo-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    margin: 0 0 0.5rem;
    color: var(--ink);
}

.demo-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.demo-card .demo-link {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--moss);
}

/* ---- Chat Interface ---- */

.chat-layout {
    display: flex;
    gap: 1.5rem;
    min-height: calc(100vh - 200px);
}

.chat-profile {
    width: 240px;
    flex-shrink: 0;
}

.profile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ground);
    border: 2px solid var(--pale-sage);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--moss);
    margin-bottom: 1rem;
}

.profile-card h3 {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0 0 0.15rem;
    color: var(--ink);
}

.profile-card .profile-org {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.wallet-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.wallet-pill {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 300;
    background: var(--ground);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.wallet-pill strong {
    color: var(--ink);
    font-weight: 400;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header .ai-dot {
    width: 8px;
    height: 8px;
    background: var(--sage);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(122, 168, 130, 0.5);
    animation: pulse 2.4s ease-in-out infinite;
}

.chat-header h3 {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0;
    color: var(--ink);
}

.chat-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

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

.message-user {
    align-self: flex-end;
}

.message-ai {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.6;
}

.message-user .message-bubble {
    background: var(--moss);
    color: var(--cream);
    border-bottom-right-radius: 4px;
}

.message-ai .message-bubble {
    background: var(--ground);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}

.message-annotation {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-top: 0.35rem;
    padding-left: 0.25rem;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.5s forwards;
}

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

/* Rich cards inside AI messages */
.ai-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.ai-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.ai-card-header h4 {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    color: var(--ink);
}

.ai-card-detail {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    font-weight: 300;
}

.ai-card-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.45rem 1.25rem;
    background: var(--moss);
    color: var(--cream);
    border: none;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s;
}

.ai-card-btn:hover {
    background: var(--accent-hover);
}

.ai-card-btn.btn-outline {
    background: transparent;
    color: var(--moss);
    border: 1px solid var(--moss);
}

.ai-card-btn.btn-outline:hover {
    background: var(--hover-green);
}

/* Sparkline */
.sparkline {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.sparkline-bar {
    width: 3px;
    border-radius: 1px;
    background: var(--sage);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    align-self: flex-start;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--pale-sage);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Chat input */
.chat-input-area {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 300;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s;
}

.chat-input:focus {
    border-color: var(--sage);
}

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

.chat-send {
    padding: 0.6rem 1.25rem;
    background: var(--moss);
    color: var(--cream);
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s;
}

.chat-send:hover {
    background: var(--accent-hover);
}

/* Suggested prompts */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.25rem 1rem;
}

.suggestion-chip {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 300;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--pale-sage);
    border-radius: 20px;
    background: var(--hover-green);
    color: var(--moss);
    cursor: pointer;
    transition: all 0.15s;
}

.suggestion-chip:hover {
    background: var(--pale-sage);
    color: var(--ink);
}

/* ---- Admin Dashboard ---- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
}

.kpi-label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--ink);
    line-height: 1.1;
}

.kpi-trend {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 300;
    margin-top: 0.35rem;
}

.kpi-trend.up { color: var(--moss); }
.kpi-trend.down { color: var(--red); }

/* Morning Briefing */
.briefing {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.briefing-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.briefing-header .ai-dot {
    width: 8px;
    height: 8px;
    background: var(--sage);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(122, 168, 130, 0.5);
    animation: pulse 2.4s ease-in-out infinite;
}

.briefing-header h3 {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.briefing-text {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--ink);
}

.briefing-text .highlight {
    background: rgba(184, 146, 74, 0.12);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    color: var(--brass);
    font-weight: 400;
}

.briefing-text .alert {
    background: var(--red-bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    color: var(--red);
    font-weight: 400;
}

.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--moss);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s step-end infinite;
}

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

/* Two-column admin panels */
.admin-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.admin-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}

.admin-panel h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--ink);
    margin: 0 0 1rem;
}

/* Anomaly items */
.anomaly-item {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.anomaly-item:hover {
    border-color: var(--pale-sage);
}

.anomaly-item.expanded {
    border-color: var(--brass);
    background: rgba(184, 146, 74, 0.03);
}

.anomaly-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.anomaly-org {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
}

.anomaly-amount {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--brass);
}

.anomaly-explain {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.6;
}

.anomaly-item.expanded .anomaly-explain {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Churn cards */
.churn-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.churn-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.churn-org {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
}

.churn-signals {
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

.churn-action {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 400;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--moss);
    border-radius: 6px;
    background: transparent;
    color: var(--moss);
    cursor: pointer;
    transition: all 0.15s;
}

.churn-action:hover {
    background: var(--hover-green);
}

/* ---- Smart Booking ---- */

.booking-context {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.context-item {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-muted);
}

.context-item strong {
    color: var(--ink);
    font-weight: 500;
}

.booking-split {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.ai-pick {
    background: var(--bg-surface);
    border: 2px solid var(--sage);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.ai-pick-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--moss);
    color: var(--cream);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    z-index: 1;
}

.room-hero {
    height: 160px;
    background: linear-gradient(135deg, var(--ground) 0%, var(--pale-sage) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 3rem;
    color: rgba(61, 97, 71, 0.15);
}

.ai-pick-body {
    padding: 1.25rem;
}

.ai-pick-body h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    margin: 0 0 0.15rem;
    color: var(--ink);
}

.room-meta {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.room-meta span {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-muted);
}

.room-why {
    margin-top: 1rem;
}

.room-why summary {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--moss);
    cursor: pointer;
    padding: 0.35rem 0;
}

.room-why .why-text {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.7;
    padding: 0.5rem 0;
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.room-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.15s;
}

.room-item:hover {
    border-color: var(--pale-sage);
}

.room-item.ai-highlighted {
    border-color: var(--sage);
    background: var(--hover-green);
}

.room-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--ground);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(61, 97, 71, 0.2);
}

.room-info {
    flex: 1;
}

.room-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.15rem;
    color: var(--ink);
}

.room-info p {
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0;
}

.room-cost {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--moss);
    white-space: nowrap;
}

/* Before/After Contrast */
.contrast-section {
    margin-top: 2rem;
}

.contrast-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.contrast-box {
    border-radius: 10px;
    padding: 1.5rem;
}

.contrast-old {
    background: #e8e8e8;
    border: 1px solid #ccc;
}

.contrast-new {
    background: var(--hover-green);
    border: 1px solid var(--pale-sage);
}

.contrast-label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contrast-old .contrast-label { color: #888; }
.contrast-new .contrast-label { color: var(--moss); }

/* Fake old form elements */
.fake-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fake-select, .fake-input {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
    color: #888;
    font-family: Arial, sans-serif;
}

.fake-select::after {
    content: ' ▼';
    font-size: 0.6rem;
}

.fake-btn {
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.45rem;
    font-size: 0.72rem;
    margin-top: 0.25rem;
    text-align: center;
}

.contrast-stat {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 1rem;
    text-align: center;
}

.contrast-old .contrast-stat { color: #999; }
.contrast-new .contrast-stat { color: var(--moss); }

/* ---- Responsive Demo ---- */

@media (max-width: 768px) {
    .chat-layout {
        flex-direction: column;
    }

    .chat-profile {
        width: 100%;
    }

    .profile-card {
        position: static;
    }

    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .admin-panels {
        grid-template-columns: 1fr;
    }

    .booking-split {
        grid-template-columns: 1fr;
    }

    .contrast-grid {
        grid-template-columns: 1fr;
    }
}
