/**
 * MScribe - Shared UI Components
 * 
 * This file contains reusable component styles used across multiple views.
 * Page-specific styles should remain inline in views or in separate page assets.
 * 
 * Contents:
 * 1. CSS Variables
 * 2. Cards
 * 3. Forms
 * 4. Page Headers
 * 5. Empty States
 * 6. Selection Cards
 * 7. Loading Overlays
 * 8. Sidebar Navigation
 * 9. Stat Cards
 * 10. Utilities
 */

/* CSS Variables are defined in site.css — not duplicated here.
   Both files are always loaded together via AppAsset. */

/* ==========================================================================
   2. Cards
   ========================================================================== */
.ms-card {
    background: white;
    border: none;
    border-radius: var(--ms-radius-md);
    box-shadow: var(--ms-shadow-sm);
}

.ms-card .card-header {
    background: white;
    border-bottom: 1px solid var(--ms-border);
    border-radius: var(--ms-radius-md) var(--ms-radius-md) 0 0 !important;
    padding: 1rem 1.25rem;
}

.ms-card .card-header h5 {
    margin-bottom: 0;
}

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

/* ==========================================================================
   3. Forms
   ========================================================================== */
.ms-form .form-control:focus,
.ms-form .form-select:focus {
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 0.2rem var(--ms-primary-light);
}

.ms-form .form-label {
    font-weight: 600;
    color: var(--ms-dark);
}

.ms-form .form-text {
    color: var(--ms-gray);
}

/* Form card wrapper */
.form-card {
    background: white;
    border-radius: var(--ms-radius-md);
    padding: 32px;
    box-shadow: var(--ms-shadow-sm);
}

/* Slug/URL preview */
.slug-preview {
    background: #f1f5f9;
    border-radius: var(--ms-radius-sm);
    padding: 12px 16px;
    font-family: monospace;
    font-size: 0.875rem;
    color: #475569;
}

.slug-prefix {
    color: var(--ms-gray-light);
}

/* ==========================================================================
   4. Page Headers
   ========================================================================== */
.ms-page-header {
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    color: white;
    border-radius: var(--ms-radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}

.ms-page-header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ms-page-header p {
    opacity: 0.75;
    margin-bottom: 0;
}

.ms-page-header .back-link {
    color: white;
    text-decoration: none;
    opacity: 0.75;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.ms-page-header .back-link:hover {
    opacity: 1;
}

/* ==========================================================================
   5. Empty States
   ========================================================================== */
.empty-state {
    background: var(--ms-light);
    border: 2px dashed var(--ms-border);
    border-radius: var(--ms-radius-lg);
    padding: 48px;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--ms-gray-light);
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--ms-dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--ms-gray);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   6. Selection Cards (Category options, etc.)
   ========================================================================== */
/* Sidebar layout container */
.sidebar-layout {
    display: flex;
    min-height: calc(100vh - 120px);
}
/* ==========================================================================
   8. Sidebar Navigation
   ========================================================================== */
.ms-sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--ms-border);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.ms-sidebar-back-top {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ms-border);
}
.ms-sidebar-back-top a {
    display: block;
    text-decoration: none;
    line-height: 0;
}
.btn-projects-svg {
    width: 155px;
    height: auto;
    filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.15));
}
.btn-projects-img {
    width: 155px;
    height: auto;
    opacity: 0.65;
    transition: opacity 0.2s;
}
.ms-sidebar-back-top a:hover .btn-projects-img {
    opacity: 0.90;
}

.ms-sidebar-back-bottom {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--ms-border);
}
.ms-sidebar-back-bottom a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--ms-gray);
    background: var(--ms-light);
    border: 1px solid var(--ms-border);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.ms-sidebar-back-bottom a:hover {
    background: var(--ms-primary);
    color: white;
    border-color: var(--ms-primary);
}
.ms-sidebar-back-bottom a i {
    margin-right: 8px;
}

.ms-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ms-border);
    margin-bottom: 8px;
}

.ms-sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ms-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    line-height: 1.2;
}

.ms-content-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ms-border);
}

.ms-content-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-dark);
    margin: 0;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.published {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.draft {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.queued {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.paused {
    background: #e5e7eb;
    color: #4b5563;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--ms-gray);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-menu li a:hover {
    background: var(--ms-light);
    color: var(--ms-dark);
}

.nav-menu li a.active {
    background: #f1f5f9;
    color: var(--ms-primary);
    font-weight: 600;
    border-right: 3px solid var(--ms-primary);
}

.nav-menu li a.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.nav-menu li a i {
    width: 20px;
    margin-right: 12px;
}

.ms-sidebar-badge-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    animation: rpp-badge-pulse 2s ease-in-out infinite;
}

@keyframes rpp-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ==========================================================================
   9. Stat Cards
   ========================================================================== */
.stat-card {
    background: white;
    border-radius: var(--ms-radius-md);
    padding: 24px;
    box-shadow: var(--ms-shadow-sm);
    height: 100%;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--ms-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ms-dark);
}

.stat-card .stat-label {
    color: var(--ms-gray);
    font-size: 1rem;
}


/* ==========================================================================
   11. Chat UI
   ========================================================================== */

/* Chat container */
.chat-container {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Chat header - colors set via inline style */
.chat-header {
    color: white;
    padding: 14px 20px;
}

.chat-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-logo {
    height: 40px;
    max-width: 120px;
    object-fit: contain;
    border-radius: 6px;
}

.chat-header-company {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
}

.chat-header-project {
    font-size: 0.8rem;
    opacity: 0.85;
    line-height: 1.3;
}

/* Chat body */
.chat-body {
    flex: 1;
    background: var(--ms-light);
    padding: 20px;
    overflow-y: auto;
}

/* Chat messages */
.chat-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

.chat-message.ai {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

/* Chat avatars */
.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    margin-right: 10px;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-avatar.user {
    margin-right: 0;
    margin-left: 10px;
}

/* Chat bubbles - user color set via inline style */
.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.chat-bubble.ai {
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border-bottom-left-radius: 4px;
}

/* Action row (copy button) inside bot bubble */
.chat-bubble-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    opacity: 0.3;
    transition: opacity 0.15s;
    flex-wrap: wrap;
}

.chat-bubble.ai:hover .chat-bubble-actions {
    opacity: 0.7;
}

.chat-action-btn {
    background: none;
    border: none;
    padding: 2px 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.8rem;
    border-radius: 4px;
}

.chat-action-btn:hover {
    color: #334155;
    background: #f1f5f9;
}

.chat-action-btn.active {
    color: #334155;
}

/* Separator between copy and feedback in action row */
.chat-action-sep {
    width: 1px;
    height: 14px;
    background: #e2e8f0;
    align-self: center;
    margin: 0 2px;
}

/* Inline feedback note input (appears in action row) */
.chat-feedback-note-input {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    outline: none;
    width: 300px;
}

.chat-feedback-note-input:focus {
    border-color: #94a3b8;
}

.chat-feedback-note-submit {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    color: #475569;
}

.chat-feedback-note-submit:hover {
    background: #e2e8f0;
}

.chat-feedback-thanks {
    font-size: 0.7rem;
    color: #64748b;
    font-style: italic;
    align-self: center;
}

/* Legacy copy button (kept for backward compat) */
.chat-copy-btn {
    display: block;
    opacity: 0.4;
    transition: opacity 0.15s;
    font-size: 0.8rem;
    text-decoration: none !important;
}

.chat-bubble.ai:hover .chat-copy-btn {
    opacity: 0.7;
}

.chat-copy-btn:hover {
    opacity: 1 !important;
}

.chat-bubble.user {
    color: white;
    border-bottom-right-radius: 4px;
}

/* Chat footer */
.chat-footer {
    background: white;
    border-top: 1px solid var(--ms-border);
    padding: 16px 20px;
}

.chat-input-group {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--ms-border);
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 1rem;
    outline: none;
}

.chat-input:focus {
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.1);
}

/* Chat send button - color set via inline style */
.chat-send {
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.chat-send:hover {
    transform: scale(1.05);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--ms-gray-light);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Demo banner */
.demo-banner {
    background: #fef3c7;
    color: #92400e;
    padding: 12px 20px;
    text-align: center;
    font-size: 0.875rem;
    border-bottom: 1px solid #fcd34d;
}

.demo-banner a {
    color: #92400e;
    font-weight: 600;
}

/* Chat sources bar */
.chat-sources {
    font-size: 0.8rem;
    color: var(--ms-gray);
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    line-height: 1.6;
}

.source-tag {
    display: inline-block;
    background: white;
    border: 1px solid var(--ms-border);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Chat confidence badge */
.chat-confidence {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 8px;
    display: inline-block;
}

.confidence-high {
    background: #dcfce7;
    color: #166534;
}

.confidence-medium {
    background: #fef9c3;
    color: #854d0e;
}

.confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

.confidence-none {
    background: #f1f5f9;
    color: var(--ms-gray);
}

/* Tier-based confidence badges (from RAG engine) */
.confidence-verified {
    background: #d1fae5;
    color: #065f46;
}

.confidence-grounded {
    background: #dbeafe;
    color: #1e40af;
}

.confidence-mixed {
    background: #fef3c7;
    color: #92400e;
}

.confidence-ungrounded {
    background: #f1f5f9;
    color: var(--ms-gray);
}

/* Chat suggested questions */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 16px;
}

.suggestion-pill {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.suggestion-pill:hover {
    border-color: var(--ms-primary);
    color: var(--ms-primary);
    background: #f8fafc;
}

/* Chat bubble error state */
.chat-bubble.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================================================================
   11b. Widget Mode (chat loaded inside iframe via widget.js)
   ========================================================================== */

/* Compact container in widget mode */
.chat-container.widget-mode {
    min-height: 100vh;
    margin: 0 !important;
}

.widget-mode .chat-header {
    padding: 10px 16px;
}

.widget-mode .chat-header-brand {
    position: relative;
    flex: 1;
}

.widget-mode .chat-header-logo {
    height: 32px;
}

.widget-mode .chat-header-company {
    font-size: 0.95rem;
}

.widget-mode .chat-header-project {
    font-size: 0.75rem;
}

.widget-mode .chat-header-pill {
    padding: 5px 10px;
    font-size: 0.75rem;
    gap: 4px;
}
.widget-mode .chat-header-pill i {
    font-size: 0.8rem;
}

/* Close button in widget header */
.widget-close-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.15s;
}

.widget-close-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* Chat header action buttons */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Pill buttons — icon + label, used in both chat and example headers */
.chat-header-pill {
    background: rgba(255,255,255,0.6);
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: rgba(0,0,0,0.7);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.chat-header-pill:hover {
    background: rgba(255,255,255,0.85);
    color: rgba(0,0,0,0.9);
    text-decoration: none;
}
.chat-header-pill i {
    font-size: 0.9rem;
}

/* Legacy round icon-only button (widget close etc.) */
.chat-header-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}
.chat-header-btn:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Powered by badge */
.powered-by-badge {
    text-align: center;
    padding: 8px 0 2px;
}

.powered-by-badge a {
    color: var(--ms-gray-light);
    text-decoration: none;
    font-size: 0.75rem;
}

.powered-by-badge a:hover {
    color: var(--ms-primary);
}

.powered-by-badge strong {
    font-weight: 600;
}

/* Compact footer in widget mode */
.widget-mode .chat-footer {
    padding: 12px 16px;
}

.widget-mode .chat-body {
    padding: 16px;
}

.widget-mode .chat-input {
    padding: 10px 16px;
    font-size: 0.9rem;
}

.widget-mode .chat-send {
    width: 42px;
    height: 42px;
}

.widget-mode .chat-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
    margin-right: 8px;
}

.widget-mode .chat-avatar.user {
    margin-right: 0;
    margin-left: 8px;
}

/* Back arrow link in chat header */
.chat-header .back-arrow {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
}
.chat-header .back-arrow:hover {
    color: white;
}

/* ==========================================================================
   11c. Print styles
   ========================================================================== */

@media print {
    .chat-header, .chat-footer, .chat-suggestions,
    .chat-bubble-actions, .chat-header-actions,
    .chat-copy-btn, .chat-avatar { display: none !important; }
    .chat-container { min-height: auto; }
    .chat-body { padding: 0; overflow: visible; }
    .chat-bubble { max-width: 100%; box-shadow: none; }
    .chat-bubble.user { color: #334155; background: #f1f5f9 !important; }
}

/* Multi-line text truncation */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 300px;
}

/* ==========================================================================
   12. Callout Boxes (Tips, Warnings)
   ========================================================================== */
.callout {
    padding: 12px 16px;
    margin: 20px 0;
    border-left: 4px solid;
    border-radius: 0 4px 4px 0;
}

.callout-tip {
    background: #dbeafe;
    border-left-color: #3b82f6;
}

.callout-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.callout-danger {
    background: #fee2e2;
    border-left-color: #ef4444;
}

.callout-info {
    background: #e0f2fe;
    border-left-color: #0ea5e9;
}


/* ==========================================================================
   13. Code Blocks
   ========================================================================== */
.code-block {
    background: var(--ms-dark);
    color: #e2e8f0;
    border-radius: var(--ms-radius-sm);
    padding: 16px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    position: relative;
}

.code-block code {
    background: none;
    padding: 0;
    color: inherit;
}

.code-block .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.code-block .copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ==========================================================================
   14. Step Indicators
   ========================================================================== */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ms-border);
    transition: background 0.2s;
}

.step-dot.active {
    background: var(--ms-primary);
}

.step-dot.completed {
    background: var(--ms-success);
}

/* ==========================================================================
   15. Invitation/Accept Cards
   ========================================================================== */
.invite-card {
    background: white;
    border-radius: var(--ms-radius-lg);
    box-shadow: var(--ms-shadow-md);
    padding: 48px;
    text-align: center;
}

.invite-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 2rem;
}

/* ==========================================================================
   16. Marketing Pages
   ========================================================================== */

/* Marketing hero section */
.marketing-hero {
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    color: white;
    padding: 60px 30px;
    border-radius: var(--ms-radius-lg);
}

.marketing-hero.centered {
    text-align: center;
}

.marketing-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.marketing-hero .lead {
    font-size: 1.25rem;
    color: #94a3b8;
    max-width: 600px;
}

.marketing-hero.centered .lead {
    margin-left: auto;
    margin-right: auto;
}

/* Hero badge */
.hero-badge {
    display: inline-block;
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.hero-img {
    width: 100%;
    height: auto;
    border-radius: var(--ms-radius-lg);
}

.pricing-preview-img {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: var(--ms-radius-md);
}

/* Hover card - lifts on hover */
.hover-card {
    background: white;
    border-radius: var(--ms-radius-lg);
    padding: 32px;
    height: 100%;
    box-shadow: var(--ms-shadow-sm);
    border: 2px solid #dee2e6;
    transition: all 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* Feature card with image */
.feature-card {
    padding: 0;
    overflow: hidden;
}

.feature-card h5,
.feature-card p {
    padding: 0 24px;
}

.feature-card h5 {
    padding-top: 20px;
}

.feature-card p {
    padding-bottom: 24px;
}

.feature-img {
    width: 100%;
    height: auto;
    display: block;
}

.hover-card.featured {
    border-color: var(--ms-primary);
}

.hover-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ms-primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Feature icon */
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--ms-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Section titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ms-dark);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--ms-gray);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


/* Step numbers for "How it works" sections */
.step-number {
    width: 40px;
    height: 40px;
    background: var(--ms-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 16px;
}

.step-img {
    width: 100%;
    height: auto;
    border-radius: var(--ms-radius-md);
}

/* Alternating background section */
.section-alt {
    background: var(--ms-light);
}

/* Pricing preview banner */
.pricing-banner {
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    color: white;
    border-radius: 24px;
    padding: 48px;
}
/* CTA section */
.cta-section {
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

/* Trust badges */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
}


/* ==========================================================================
   Examples Gallery (example/index)
   ========================================================================== */
.examples-hero {
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    color: white;
    padding: 60px 0 40px;
    text-align: center;
}

.examples-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.examples-hero p {
    color: #94a3b8;
    font-size: 1.1rem;
    margin: 0;
}

.examples-hero-lead {
    max-width: 600px;
    margin: 0 auto;
}

.examples-hero-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.examples-hero-features i {
    color: var(--ms-secondary);
    margin-right: 4px;
}

.category-filter {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px 0;
    background: var(--ms-light);
    border-bottom: 1px solid var(--ms-border);
}

.category-filter a {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ms-gray);
    text-decoration: none;
    border: 1px solid var(--ms-border);
    background: white;
    transition: all 0.2s ease;
}

.category-filter a:hover {
    color: var(--ms-primary);
    border-color: var(--ms-primary);
}
.category-filter a.cat-internal:hover  { color: #475569; border-color: #94a3b8; }
.category-filter a.cat-support:hover   { color: #0369a1; border-color: #7dd3fc; }
.category-filter a.cat-operations:hover { color: #92400e; border-color: #fbbf24; }
.category-filter a.cat-community:hover { color: #047857; border-color: #34d399; }

.category-filter a.active {
    background: var(--ms-primary);
    color: white;
    border-color: var(--ms-primary);
}
.category-filter a.cat-internal.active  { background: #475569; border-color: #475569; }
.category-filter a.cat-support.active   { background: #0369a1; border-color: #0369a1; }
.category-filter a.cat-operations.active { background: #92400e; border-color: #92400e; }
.category-filter a.cat-community.active { background: #047857; border-color: #047857; }

.example-card {
    background: white;
    border-radius: var(--ms-radius-lg);
    height: 100%;
    box-shadow: var(--ms-shadow-sm);
    border: 1px solid var(--ms-border);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.example-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.example-card.image-bottom {
    flex-direction: column-reverse;
}

.example-image {
    width: 100%;
    flex-shrink: 0;
}
.example-image img {
    width: 100%;
    height: auto;
    display: block;
}

.example-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.example-card.image-bottom .example-body {
    flex-direction: column;
}

.example-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    color: var(--ms-primary);
    background: var(--ms-primary-light);
}
.example-category.cat-internal   { color: #475569; background: #f1f5f9; }
.example-category.cat-support    { color: #0369a1; background: #e0f2fe; }
.example-category.cat-operations { color: #92400e; background: #fef3c7; }
.example-category.cat-community  { color: #047857; background: #ecfdf5; }

/* Use Case Cards (Homepage) */
.use-case-card {
    padding: 32px 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.use-case-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.use-case-icon.cat-internal   { color: #475569; background: #f1f5f9; }
.use-case-icon.cat-support    { color: #0369a1; background: #e0f2fe; }
.use-case-icon.cat-operations { color: #92400e; background: #fef3c7; }
.use-case-icon.cat-community  { color: #047857; background: #ecfdf5; }

/* Use Cases Page */
.use-case-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.use-case-table td, .use-case-table th {
    font-size: 0.9rem;
}

.use-case-table td:last-child {
    font-style: italic;
    color: var(--ms-gray);
}

.use-case-value {
    margin-top: 16px;
    margin-bottom: 16px;
}

.example-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ms-dark);
    margin-bottom: 8px;
}

.example-description {
    font-size: 0.85rem;
    color: var(--ms-gray);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 16px;
}

.example-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon i {
    font-size: 3rem;
    color: var(--ms-gray-light);
    margin-bottom: 16px;
}

/* ==========================================================================
   Example Preview (example/view)
   ========================================================================== */
.example-preview {
    min-height: 100vh;
    background: var(--ms-light);
}

.preview-header {
    background: white;
    border-bottom: 1px solid var(--ms-border);
    padding: 12px 0;
}

.preview-badge {
    display: inline-block;
    background: var(--ms-primary-light);
    color: var(--ms-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.preview-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 16px;
}

.preview-card {
    background: white;
    border-radius: var(--ms-radius-lg);
    padding: 32px;
    box-shadow: var(--ms-shadow-sm);
    border: 1px solid var(--ms-border);
    margin-bottom: 24px;
}

.preview-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ms-dark);
    margin: 0;
}

.preview-description {
    font-size: 1rem;
    color: var(--ms-gray);
    line-height: 1.6;
    margin-bottom: 24px;
}

.config-preview {
    background: var(--ms-light);
    border-radius: var(--ms-radius-md);
    padding: 16px;
    border: 1px solid var(--ms-border);
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.config-item + .config-item {
    border-top: 1px solid var(--ms-border);
}

.config-label {
    font-size: 0.875rem;
    color: var(--ms-gray);
    font-weight: 500;
}

.config-value {
    font-size: 0.875rem;
    color: var(--ms-dark);
}

.cta-overlay {
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    color: white;
    border-radius: var(--ms-radius-lg);
    padding: 32px;
    text-align: center;
}

.cta-overlay h3 {
    font-weight: 700;
    margin-bottom: 8px;
}

.cta-overlay p {
    opacity: 0.9;
    margin-bottom: 16px;
}
/* ==========================================================================
   17. Legal Pages (Terms, Privacy)
   ========================================================================== */

/* Legal page hero */
.legal-hero {
    background: linear-gradient(135deg, var(--ms-dark) 0%, var(--ms-dark-light) 100%);
    color: white;
    padding: 40px;
    margin-bottom: 40px;
    border-radius: var(--ms-radius-md);
    text-align: center;
}

/* Legal content styling */
.legal-content {
    /* Width controlled by col-xl-10 container, not max-width */
}

.legal-content h2 {
    scroll-margin-top: 80px;
    color: var(--ms-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-content h3 {
    color: var(--ms-dark-light);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-content p {
    color: var(--ms-gray);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.legal-content ul,
.legal-content ol {
    color: var(--ms-gray);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.legal-content a:not(.btn) {
    color: var(--ms-primary);
}

.legal-content a:hover {
    text-decoration: underline;
}

/* Table of contents for legal pages */
.legal-toc {
    background: var(--ms-light);
    border-radius: var(--ms-radius-md);
    padding: 24px;
    margin-bottom: 32px;
}

.legal-toc h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--ms-dark);
}

.legal-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legal-toc li {
    margin-bottom: 8px;
}

.legal-toc a {
    color: var(--ms-gray);
    text-decoration: none;
    font-size: 0.9rem;
}

.legal-toc a:hover {
    color: var(--ms-primary);
}

/* ==========================================================================
   18. Pricing Page
   ========================================================================== */

/* Pricing card description — fixed height so prices align */
.pricing-desc {
    min-height: 48px;
}

/* Price display */
.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--ms-dark);
}

.price-period {
    color: var(--ms-gray);
}

/* Feature list with check/x icons */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-list li > i {
    flex-shrink: 0;
    margin-top: 3px;
    width: 16px;
    text-align: center;
}

.feature-list .x {
    color: #cbd5e1;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Pricing card tier accents */
.hover-card.tier-free    { border-top: 4px solid #94a3b8; }
.hover-card.tier-starter { border-top: 4px solid #3b82f6; }
.hover-card.tier-pro     { border-top: 4px solid #6366f1; }
.hover-card.tier-business { border-top: 4px solid #1e293b; }

/* ==========================================================================
   19. FAQ Section
   ========================================================================== */
.faq-section {
    background: var(--ms-light);
}

.faq-item {
    background: white;
    border-radius: var(--ms-radius-md);
    padding: 24px;
    margin-bottom: 16px;
}

.faq-item h5 {
    color: var(--ms-dark);
    margin-bottom: 12px;
}

.faq-item p {
    color: var(--ms-gray);
    margin-bottom: 0;
}

/* ==========================================================================
   19b. Features Page
   ========================================================================== */

/* Large icon showcase circle for feature sections */
.feature-showcase {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ms-primary-light) 0%, rgba(37,99,235,0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.feature-showcase i {
    font-size: 4rem;
    color: var(--ms-primary);
}

/* Small detail cards within feature sections */
.ms-feature-detail-card {
    background: var(--ms-light);
    border-radius: var(--ms-radius-md);
    padding: 20px;
    height: 100%;
}

.ms-feature-detail-card i {
    font-size: 1.5rem;
    display: block;
}

/* ==========================================================================
   19c. Comparison Table
   ========================================================================== */
.comparison-table {
    border-radius: var(--ms-radius-md);
    overflow: hidden;
    box-shadow: var(--ms-shadow-sm);
}

.comparison-table thead th {
    font-weight: 600;
    padding: 16px;
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}

.comparison-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

.comparison-table tbody tr:hover {
    background: var(--ms-light);
}

/* ==========================================================================
   10. Utilities
   ========================================================================== */
.text-primary { color: var(--ms-primary) !important; }
.bg-primary-light { background: var(--ms-primary-light) !important; }

/* Content area for sidebar layouts */
.ms-content {
    flex: 1;
    padding: 24px 32px;
    background: var(--ms-light);
    overflow-y: auto;
}

/* Content cards - used across dashboard, settings, and other sidebar pages */
.content-card {
    background: white;
    border-radius: var(--ms-radius-md);
    padding: 24px;
    box-shadow: var(--ms-shadow-sm);
    margin-bottom: 24px;
}

/* Quick stats grid (dashboard) */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.quick-stat {
    text-align: center;
    padding: 16px;
    background: var(--ms-light);
    border-radius: var(--ms-radius-sm);
}

.quick-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ms-dark);
}

.quick-stat-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--ms-gray);
    margin-top: 4px;
}

/* ==========================================================================
   20. Project Cards (project/index)
   ========================================================================== */
.project-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    cursor: pointer;
}
.project-card-link:hover {
    color: inherit;
}
.project-card {
    background: white;
    border-radius: var(--ms-radius-md);
    padding: 24px;
    box-shadow: var(--ms-shadow-sm);
    border: 1px solid var(--ms-border);
    height: 100%;
    transition: all 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ms-shadow-md);
}

.project-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ms-dark);
}

.project-desc {
    font-size: 1rem;
    color: var(--ms-gray);
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-status.published {
    background: #d1fae5;
    color: #065f46;
}

.project-status.draft {
    background: #fef3c7;
    color: #92400e;
}

.project-status.queued {
    background: #dbeafe;
    color: #1e40af;
}

.project-status.paused {
    background: #e5e7eb;
    color: #4b5563;
}

.project-stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--ms-border);
    padding-top: 16px;
}

.project-stat {
    text-align: center;
    flex: 1;
}

.project-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ms-dark);
}

.project-stat-label {
    font-size: 1rem;
    color: var(--ms-gray);
    margin-top: 2px;
}

.project-card--needs-docs {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #fff 40%);
}

.project-card-nudge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* ==========================================================================
   Error Page
   ========================================================================== */

/* Container for error page content */
.error-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* Large status code display */
.error-status-code {
    font-size: 3rem;
    color: #e2e8f0;
    line-height: 1;
    margin-bottom: 8px;
}

/* Icon circle on error pages */
.error-icon-circle {
    width: 80px;
    height: 80px;
}

/* Detail table for error info (label-value rows) */
.error-detail-table {
    width: 100%;
}

.error-detail-table td:first-child {
    padding: 2px 8px 2px 0;
    white-space: nowrap;
    color: var(--ms-gray-light);
}

.error-detail-table td:last-child {
    padding: 2px 0;
}

/* Light panel background */
.panel-light {
    background: var(--ms-light);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #cbd5e1;
    padding: 48px 0 24px;
    margin-top: auto;
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand img {
    border-radius: 50%;
}

.footer-tagline {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.6;
}

.footer-heading {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-divider {
    border-color: #475569;
    margin: 32px 0 16px;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    text-align: center;
}

/* ============================================================
 * Help Center
 * ============================================================ */

/* Layout */
.help-layout {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.help-content-section {
    padding-top: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
    scroll-margin-top: 80px;
}

.help-content-section:last-child {
    border-bottom: none;
}

/* Sidebar nav */
.help-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.5rem 0;
}

.help-nav-sticky {
    position: sticky;
    top: 80px;
}

.help-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.help-nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.help-nav-link:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.help-nav-link.active {
    color: var(--ms-primary);
    background: #eff6ff;
    font-weight: 600;
}

/* Mobile toggle button */
.help-sidebar-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1040;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--ms-primary);
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.help-sidebar-toggle:hover {
    background: #1d4ed8;
}

/* Off-canvas nav styling */
#helpSidebar .help-nav {
    padding: 0.5rem;
}

#helpSidebar .help-nav-link {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

.help-section {
    max-width: none;
}

.help-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--ms-primary);
}

.help-section-header i {
    font-size: 1.5rem;
}

.help-section-header h2 {
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
}

.help-topic {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.help-topic:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.help-topic h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.help-topic h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #334155;
}

.help-topic p,
.help-topic li {
    font-size: 0.925rem;
    line-height: 1.7;
    color: #475569;
}

.help-topic ol,
.help-topic ul {
    padding-left: 1.25rem;
}

.help-topic li {
    margin-bottom: 0.35rem;
}

.help-topic code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #0f172a;
}

.help-topic pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.help-topic pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.help-topic .table {
    font-size: 0.9rem;
}

.help-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #eff6ff;
    border-left: 3px solid var(--ms-primary);
    border-radius: 0 6px 6px 0;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #1e40af;
}

.help-note i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* ============================================================
 * How Our AI Works Page
 * ============================================================ */

.ai-feature-block {
    position: relative;
    margin-bottom: 3.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e2e8f0;
}

.ai-feature-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ai-feature-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.ai-feature-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ms-primary);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ai-feature-block h2 {
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

.ai-stage {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.ai-stage-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--ms-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-top: 2px;
}

.ai-stage h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #1e293b;
}

.ai-stage p {
    font-size: 0.925rem;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 0;
}

.ai-pipeline-summary {
    padding: 0.85rem 1.25rem;
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #166534;
    margin-top: 1rem;
}

.ai-signal-card {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    height: 100%;
}

.ai-signal-card h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ai-signal-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 0;
}

.ai-confidence-tiers {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.ai-tier {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #475569;
}

.ai-tier .badge {
    min-width: 90px;
    text-align: center;
}

.ai-tech-card {
    padding: 1.5rem 1.25rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    height: 100%;
}

.ai-tech-card h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ai-tech-card p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 0;
}

.ai-feature-list {
    list-style: none;
    padding-left: 0;
}

.ai-feature-list li {
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}

.ai-feature-list li::before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #22c55e;
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

/* ============================================================
   Ask AI — Embedded Chat Page
   ============================================================ */

.ask-ai-chat-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.ask-ai-chat-frame {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

@media (max-width: 767.98px) {
    .ask-ai-chat-frame {
        height: 500px;
    }
}

/* ==========================================================================
   11. Document Status Badges
   ========================================================================== */
.badge-ready    { background: var(--ms-success); color: #fff; }
.badge-queued   { background: #8b5cf6; color: #fff; }
.badge-pending  { background: var(--ms-secondary); color: #fff; }
.badge-processing { background: var(--ms-warning); color: #fff; }
.badge-failed   { background: var(--ms-danger); color: #fff; }
.badge-unknown  { background: var(--ms-gray); color: #fff; }

/* ==========================================================================
   12. Status Icon Circles (Publish page)
   ========================================================================== */
.status-circle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.status-circle-published { background: #d1fae5; }
.status-circle-published i { color: #065f46; }
.status-circle-queued    { background: #dbeafe; }
.status-circle-queued i  { color: #1e40af; }
.status-circle-draft     { background: #fef3c7; }
.status-circle-draft i   { color: #92400e; }
.status-circle-paused    { background: #e5e7eb; }
.status-circle-paused i  { color: #4b5563; }

/* ==========================================================================
   13. Document Table Utilities
   ========================================================================== */
.doc-table          { table-layout: fixed; width: 100%; }
.doc-table .col-doc { width: 45%; }
.doc-table .col-size { width: 10%; }
.doc-table .col-status { width: 20%; }
.doc-table .col-date { width: 15%; }
.doc-table .col-actions { width: 10%; }

.cell-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap-normal { white-space: normal; }

/* ==========================================================================
   14. Progress Bars
   ========================================================================== */
.progress-thin   { height: 6px; }
.progress-medium { height: 8px; }
.progress-thick  { height: 12px; }

/* ==========================================================================
   15. Upload Overlay
   ========================================================================== */
.upload-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.upload-overlay-box {
    background: #fff;
    border-radius: var(--ms-radius-md);
    padding: 32px 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--ms-shadow-lg);
}

/* ==========================================================================
   16. Dashboard
   ========================================================================== */
.getting-started-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
}
.getting-started-icon {
    font-size: 2.5rem;
    line-height: 1;
    color: #3b82f6;
}

/* ==========================================================================
   17. Danger Zone
   ========================================================================== */
.danger-zone {
    border: 2px solid var(--ms-danger);
    border-radius: 0.5rem;
}

/* ==========================================================================
   18. Feedback Table
   ========================================================================== */
.feedback-table .col-icon     { width: 5%; }
.feedback-table .col-question { width: 35%; }
.feedback-table .col-response { width: 30%; }
.feedback-table .col-note     { width: 18%; }
.feedback-table .col-date     { width: 12%; }
.feedback-row { cursor: pointer; }

/* ==========================================================================
   19. Chart Container
   ========================================================================== */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 160px;
    padding: 0 4px;
}
.bar-chart-bar {
    flex: 1;
    min-width: 4px;
    border-radius: 2px 2px 0 0;
    cursor: default;
}

/* ==========================================================================
   20. Slug Preview (Create page)
   ========================================================================== */
.slug-preview-box {
    background: #f0f4ff;
    border: 1px solid #c7d7fe;
}

/* ==========================================================================
   21. Misc Utilities
   ========================================================================== */
.text-gray       { color: var(--ms-gray); }
.text-gray-light { color: var(--ms-gray-light); }
.text-danger-sm  { color: var(--ms-danger); margin-top: 4px; }
.font-xs         { font-size: 0.65em; }
.font-sm         { font-size: 0.7em; }
.font-75         { font-size: 0.75em; }
.font-075rem     { font-size: 0.75rem; }
.min-w-0         { min-width: 0; }
.min-w-120       { min-width: 120px; }

/* Bootstrap 5 + Yii2 input-group validation fix:
   When using inputTemplate with input-group (e.g. password toggle button),
   Yii2 places {error} outside the input-group div via the default field template.
   Bootstrap's .is-invalid ~ .invalid-feedback sibling selector doesn't reach it.
   This rule shows the error when the input-group contains an invalid input. */
.input-group:has(.is-invalid) ~ .invalid-feedback { display: block; }

/* ==========================================================================
   11. MScribe UI Components (added for MScribe, not from Ask360)
   ========================================================================== */

/* Page Headers & Content Patterns */
.ms-page-title {
    font-weight: 700;
    color: var(--ms-dark);
}

.ms-page-subtitle {
    color: var(--ms-gray);
}

.ms-page-icon {
    font-size: 3.5rem;
    color: var(--ms-primary);
}

/* Page header zone — tinted background for title/actions/context */
.ms-page-header-zone {
    background: var(--ms-light);
    border: 1px solid var(--ms-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.ms-page-icon-success {
    font-size: 4rem;
    color: var(--ms-success);
}

/* Auth Card Pattern (two-column and single-column) */
.ms-auth-card {
    border-top: 3px solid var(--ms-primary);
    border-radius: var(--ms-radius-md);
}

.ms-auth-card-success {
    border-top: 3px solid var(--ms-success);
    border-radius: var(--ms-radius-md);
}

.ms-auth-card .card-heading {
    font-weight: 600;
}

.ms-auth-card .card-subheading {
    color: var(--ms-gray);
}

/* Info panel (gradient right column on auth pages) */
.ms-info-panel {
    background: linear-gradient(135deg, var(--ms-primary) 0%, var(--ms-primary-dark) 100%);
    border-radius: 0 var(--ms-radius-md) var(--ms-radius-md) 0;
}

.ms-info-panel h2,
.ms-info-panel h3 {
    font-weight: 700;
}

.ms-info-panel .ms-info-subtitle {
    opacity: 0.9;
}

.ms-info-panel .ms-info-item-detail {
    opacity: 0.85;
}

/* Supporting Info Cards (below auth forms) */
.ms-support-card {
    border-radius: var(--ms-radius-sm);
    background: var(--ms-light);
}

/* Dashboard Stat Cards */
.ms-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.ms-stat-label {
    color: var(--ms-gray);
}

/* Role Selection Cards (signup) */
.ms-role-card {
    cursor: pointer;
    border: 2px solid var(--ms-border);
    border-radius: var(--ms-radius-md);
    padding: 1.25rem;
    text-align: center;
    transition: all 0.15s ease;
}

.ms-role-card:hover {
    border-color: var(--ms-primary);
    background: var(--ms-primary-light);
}

.ms-role-card.selected {
    border-color: var(--ms-primary);
    background: var(--ms-primary-light);
    box-shadow: 0 0 0 2px var(--ms-primary);
}

.ms-role-card .role-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.ms-role-card .role-title {
    font-weight: 600;
    font-size: 1rem;
}

.ms-role-card .role-desc {
    font-size: 0.8rem;
    color: var(--ms-gray);
    margin-top: 0.25rem;
}

/* Acknowledgment Checkboxes */
.ms-ack-checkbox {
    background: var(--ms-light);
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.ms-ack-checkbox .form-check-label {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Form Overrides */
.form-check-input {
    border: 2px solid #6c757d;
}

/* Feature Icons (landing page) */
.ms-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
