/* NEXUS AI Bot Studio & Telegram Simulator CSS */

:root {
    --bg-main: #09090b;
    --card-bg: #131316;
    --card-border: #222227;
    --text-primary: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.25);
    
    /* Telegram Theme Colors */
    --tg-bg: #0e1621;
    --tg-header: #17212b;
    --tg-bot-msg: #182533;
    --tg-user-msg: #2b5278;
    --tg-text: #f5f5f5;
    --tg-text-muted: #7f91a4;
    --tg-btn-bg: #2b5278;
    --tg-btn-hover: #37638f;
    --tg-accent: #5288c1;
    --tg-online: #40b3ff;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 90px;
    margin: 0;
}

@media (max-width: 900px) {
    body { padding-top: 70px; }
}

.studio-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 20px 80px;
}

/* Page Header */
.studio-header {
    text-align: center;
    max-width: 860px;
    margin: 0 auto 36px;
}

.badge-ai {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.studio-title {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 14px;
}

.studio-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Industry Tabs */
.industry-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.tab-btn {
    background: rgba(24, 24, 27, 0.85);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

/* Two-column Studio Layout */
.studio-grid {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 1080px) {
    .studio-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}

/* SMARTPHONE MOCKUP */
.phone-wrapper {
    width: 100%;
    max-width: 440px;
}

.phone-mockup {
    width: 100%;
    height: 760px;
    background: #000;
    border-radius: 46px;
    padding: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 4px #27272a, inset 0 0 0 2px #3f3f46;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
}

.phone-notch {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 18px;
    background: #000;
    border-radius: 20px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-camera {
    width: 8px;
    height: 8px;
    background: #111;
    border-radius: 50%;
    border: 1px solid #222;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--tg-bg);
    border-radius: 36px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 10px;
}

/* Telegram Header */
.tg-header {
    background: var(--tg-header);
    height: 64px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.tg-back {
    color: var(--tg-accent);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

.tg-avatar-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2b5278, #17212b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.tg-info {
    flex: 1;
    overflow: hidden;
}

.tg-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tg-bot-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #3390ec;
    border-radius: 50%;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}

.tg-status {
    font-size: 0.75rem;
    color: var(--tg-online);
}

.tg-menu-btn {
    color: var(--tg-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Telegram Chat Feed */
.tg-chat-feed {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.tg-chat-feed::-webkit-scrollbar {
    width: 4px;
}
.tg-chat-feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.tg-date-divider {
    align-self: center;
    background: rgba(0, 0, 0, 0.4);
    color: var(--tg-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    margin: 4px 0 8px;
}

/* Messages */
.msg-row {
    display: flex;
    flex-direction: column;
    max-width: 86%;
    animation: fadeIn 0.25s ease;
}

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

.msg-row.bot {
    align-self: flex-start;
}

.msg-row.user {
    align-self: flex-end;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
}

.msg-row.bot .msg-bubble {
    background: var(--tg-bot-msg);
    color: var(--tg-text);
    border-bottom-left-radius: 4px;
}

.msg-row.user .msg-bubble {
    background: var(--tg-user-msg);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.68rem;
    color: var(--tg-text-muted);
    margin-top: 4px;
}

.msg-row.user .msg-meta {
    color: rgba(255, 255, 255, 0.7);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--tg-bot-msg);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    align-self: flex-start;
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--tg-text-muted);
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

/* Inline Keyboard Buttons */
.inline-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
}

.tg-inline-btn {
    background: rgba(43, 82, 120, 0.4);
    border: 1px solid rgba(82, 136, 193, 0.35);
    color: #fff;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
}

.tg-inline-btn:hover {
    background: var(--tg-btn-bg);
    border-color: var(--tg-accent);
}

/* Quick Suggestion Chips Carousel */
.quick-chips-carousel {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    background: rgba(14, 22, 33, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-chips-carousel::-webkit-scrollbar { display: none; }

.quick-chip {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e7;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-chip:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* Telegram Input Bar */
.tg-input-bar {
    background: var(--tg-header);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.tg-attach-btn, .tg-mic-btn {
    color: var(--tg-text-muted);
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.tg-attach-btn:hover, .tg-mic-btn:hover {
    color: #fff;
}

.tg-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.92rem;
    outline: none;
    padding: 6px 4px;
}

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

.tg-send-btn {
    background: #3390ec;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.tg-send-btn:hover {
    background: #40b3ff;
    transform: scale(1.05);
}

/* Controls under phone */
.phone-controls {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.ctrl-btn {
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ctrl-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

/* RIGHT COLUMN: CRM DASHBOARD */
.crm-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.crm-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.crm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 600;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Lead Status Gauge */
.lead-status-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 22px;
}

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

.gauge-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.gauge-value {
    font-size: 1rem;
    font-weight: 700;
    color: #34d399;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gauge-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b, #ef4444);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* CRM Grid */
.crm-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

@media (max-width: 600px) {
    .crm-details-grid {
        grid-template-columns: 1fr;
    }
}

.crm-item {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-item-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.crm-item-val {
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    transition: color 0.3s ease;
}

.crm-item-val.highlight {
    color: #34d399;
}

/* AI Executive Summary Box */
.ai-summary-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 16px;
    font-size: 0.92rem;
    color: #e4e4e7;
    line-height: 1.5;
}

.ai-summary-box strong {
    color: #34d399;
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ROI / Economics Table Card */
.roi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-top: 10px;
}

.roi-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.roi-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.roi-badge-good {
    color: #34d399;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.roi-badge-bad {
    color: #f87171;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.crm-cta-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #ffffff, #d4d4d8);
    color: #000;
    text-align: center;
    padding: 16px 24px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-top: 20px;
}

.crm-cta-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.4);
}
