/* ==========================================================================
   VAISHALI MEDIA WORKS - PLATFORM DESIGN SYSTEM & MODULE STYLING
   High-performance Glassmorphism UI, Analytics Dashboards, Audit & Calculator
   ========================================================================== */

:root {
    --platform-primary: #8a1236;
    --platform-primary-glow: rgba(138, 18, 54, 0.35);
    --platform-accent-cyan: #2dd4bf;
    --platform-accent-purple: #14b8a6;
    --platform-accent-emerald: #10b981;
    --platform-accent-amber: #f59e0b;
    --platform-accent-rose: #f43f5e;
    --platform-card-bg: rgba(255, 255, 255, 0.82);
    --platform-card-border: rgba(255, 255, 255, 0.95);
    --platform-dark-card: rgba(15, 23, 42, 0.75);
    --platform-shadow: 0 16px 36px -10px rgba(138, 18, 54, 0.12), 0 6px 16px -4px rgba(0, 0, 0, 0.04);
    --platform-shadow-hover: 0 24px 48px -12px rgba(138, 18, 54, 0.22), 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}

/* Platform Navigation Header */
.platform-navbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 0.85rem 0;
    transition: all 0.3s ease;
    z-index: 1050;
}

.platform-brand-badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #8a1236, #0d9488);
    color: #fff;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.platform-nav-link {
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155 !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.platform-nav-link:hover,
.platform-nav-link.active {
    color: #8a1236 !important;
    background: rgba(138, 18, 54, 0.08);
}

.status-dot-live {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Glassmorphic Platform Container Cards */
.platform-card {
    background: var(--platform-card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--platform-card-border);
    border-radius: 1.25rem;
    box-shadow: var(--platform-shadow);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.platform-card:hover {
    box-shadow: var(--platform-shadow-hover);
}

.platform-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.platform-card-body {
    padding: 1.5rem;
}

/* KPI Stat Metric Cards */
.kpi-card {
    padding: 1.35rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--platform-shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--platform-shadow-hover);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--platform-primary);
}

.kpi-card.emerald::before { background: var(--platform-accent-emerald); }
.kpi-card.purple::before { background: var(--platform-accent-purple); }
.kpi-card.amber::before { background: var(--platform-accent-amber); }
.kpi-card.cyan::before { background: var(--platform-accent-cyan); }

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.kpi-val {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.2;
}

.kpi-trend {
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
}

.trend-up {
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
}

.trend-neutral {
    color: #8a1236;
    background: rgba(138, 18, 54, 0.12);
}

/* Tab Pill Switcher */
.platform-tabs {
    background: rgba(241, 245, 249, 0.85);
    padding: 0.35rem;
    border-radius: 1rem;
    display: inline-flex;
    gap: 0.25rem;
    border: 1px solid rgba(203, 213, 225, 0.6);
}

.platform-tab-btn {
    border: none;
    background: transparent;
    padding: 0.55rem 1.15rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.platform-tab-btn:hover {
    color: #0f172a;
}

.platform-tab-btn.active {
    background: #ffffff;
    color: #8a1236;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Chart Canvas Container */
.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 290px;
    max-height: 340px;
}

/* Kanban Deliverable Board */
.kanban-col {
    background: rgba(248, 250, 252, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    padding: 1.1rem;
    min-height: 380px;
}

.kanban-col-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.85rem;
    padding: 1rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    cursor: pointer;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(138, 18, 54, 0.08);
    border-color: rgba(138, 18, 54, 0.3);
}

/* Instant AI Audit Engine Styles */
.audit-input-box {
    background: #ffffff;
    border: 2px solid rgba(138, 18, 54, 0.2);
    border-radius: 1.25rem;
    padding: 0.45rem;
    box-shadow: 0 16px 36px -10px rgba(138, 18, 54, 0.2);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.audit-input-box:focus-within {
    border-color: #8a1236;
    box-shadow: 0 20px 40px -10px rgba(138, 18, 54, 0.35);
}

.audit-input-field {
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    width: 100%;
}

.audit-score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.score-high {
    background: radial-gradient(circle, #ffffff 60%, rgba(16, 185, 129, 0.15) 100%);
    border: 6px solid #10b981;
    color: #059669;
}

.score-med {
    background: radial-gradient(circle, #ffffff 60%, rgba(245, 158, 11, 0.15) 100%);
    border: 6px solid #f59e0b;
    color: #d97706;
}

.audit-step-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.6);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.audit-step-item.complete {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #065f46;
}

.audit-step-item.running {
    background: rgba(138, 18, 54, 0.08);
    border-color: rgba(138, 18, 54, 0.25);
    color: #5c0c22;
}

.score-low {
    background: radial-gradient(circle, #ffffff 60%, rgba(239, 68, 68, 0.15) 100%);
    border: 6px solid #ef4444;
    color: #dc2626;
}

.ai-executive-card {
    background: linear-gradient(135deg, rgba(138, 18, 54, 0.05) 0%, rgba(45, 212, 191, 0.05) 100%);
    border: 1px solid rgba(138, 18, 54, 0.2);
    border-radius: 1.25rem;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
}

.ai-executive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #8a1236, #2dd4bf);
}

.ai-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(138, 18, 54, 0.1);
    color: #5c0c22;
    border: 1px solid rgba(138, 18, 54, 0.25);
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.ai-gap-card {
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.9rem;
    padding: 0.9rem 1.15rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: #1e293b;
}

.ai-roadmap-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.ai-roadmap-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(138, 18, 54, 0.1);
}

.ai-timeframe-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: rgba(138, 18, 54, 0.1);
    color: #8a1236;
    margin-bottom: 0.5rem;
}
.calc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    transition: background 0.2s ease;
}

.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #8a1236;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 10px rgba(138, 18, 54, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.calc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: #6b0e27;
}

.calc-result-display {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: 1.25rem;
    padding: 1.85rem;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.35);
    position: relative;
    overflow: hidden;
}

.calc-result-display::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 18, 54, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.config-toggle-card {
    border: 2px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    padding: 1.15rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.config-toggle-card:hover {
    border-color: rgba(138, 18, 54, 0.4);
    transform: translateY(-2px);
}

.config-toggle-card.selected {
    border-color: #8a1236;
    background: rgba(138, 18, 54, 0.04);
    box-shadow: 0 8px 20px rgba(138, 18, 54, 0.1);
}

/* User / Client Demo Selector Pill */
.client-demo-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 9999px;
    padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.client-avatar-chip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8a1236, #2dd4bf);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Link-in-bio template gallery & phone preview */
.bio-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.6rem;
}

.bio-template-card {
    border: 2px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.85rem;
    background: #ffffff;
    padding: 0.35rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.bio-template-card:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(138, 18, 54, 0.45);
}

.bio-template-card.selected {
    border-color: #8a1236;
    box-shadow: 0 6px 16px rgba(138, 18, 54, 0.18);
}

.bio-template-card:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.bio-template-swatch {
    height: 52px;
    border-radius: 0.55rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.bio-template-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    margin-top: 0.3rem;
    line-height: 1.2;
}

.bio-template-lock {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    font-weight: 800;
    background: #0f172a;
    color: #ffffff;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
}

.bio-phone {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 9 / 18;
    border-radius: 2rem;
    border: 10px solid #0f172a;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

.bio-phone iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Card headers and long KPI values must never push the page sideways */
.platform-card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kpi-val {
    overflow-wrap: anywhere;
}

/* Desktop: wrap the tab bar onto a second row instead of overflowing */
@media (min-width: 992px) {
    .platform-tabs {
        flex-wrap: wrap;
    }
}

/* Mobile & Tablet Adjustments */
@media (max-width: 991.98px) {
    .platform-tabs {
        display: flex;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .platform-tabs::-webkit-scrollbar {
        display: none;
    }
    .platform-tab-btn {
        flex-shrink: 0;
    }
    .kpi-val {
        font-size: 1.5rem;
    }
    .chart-wrapper {
        min-height: 240px;
    }
    /* Collapsed navbar: stack the account controls instead of one long row */
    .platform-navbar .navbar-collapse > .d-flex {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.75rem 0;
    }
    .platform-navbar .navbar-nav {
        padding-top: 0.5rem;
    }
}

/* Phones */
@media (max-width: 575.98px) {
    .platform-card-header,
    .platform-card-body {
        padding: 1rem;
    }
    .platform-card.p-4 {
        padding: 1.25rem !important;
    }
    .platform-tab-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.82rem;
    }
    .table {
        font-size: 0.85rem;
    }
    .kanban-col {
        min-height: 0;
    }
    #authModal .modal-body {
        padding: 1.25rem !important;
        padding-top: 0 !important;
    }
    .platform-brand-badge {
        display: none;
    }
}
