/* ... Previous Styles ... */
/* CSS Overwrite to include Incident Form styles */
:root {
    /* Colors - FUTURISTIC DARK THEME */
    --bg-dark: #050511;
    /* Deeper Black/Blue */
    --bg-card: #0F121E;
    /* Slightly Lighter */
    --bg-input: #1C222E;

    --text-main: #FFFFFF;
    --text-muted: #94A3B8;

    /* Brand Colors */
    --cyan: #00F0FF;
    --cyan-dim: rgba(0, 240, 255, 0.15);
    --pink: #FF007F;
    --pink-dim: rgba(255, 0, 127, 0.15);
    --purple: #BC13FE;

    --primary: var(--cyan);
    --status-online: #00F0FF;

    /* Link color */
    --link-color: var(--cyan);

    /* Spacing & Layout */
    --header-height: 80px;
    --max-width: 1100px;
    /* Increased for Desktop */
    --content-width: 800px;
    /* Ideal for reading */
    --radius-lg: 24px;
}

/* NO LIGHT MODE OVERRIDES - DARK MODE ONLY */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Guest Mode Tweaks (for Help Widget) */
/* Guest Mode Tweaks (for Help Widget) */
/* Guest Mode Tweaks (for Help Widget) */
.guest-mode .app-header {
    display: none !important;
}

/* Mostramos la cabecera del chat con el nombre Cuky */
.guest-mode .chat-header {
    display: flex !important;
    padding: 12px 15px !important;
    margin-top: 0 !important;
}

/* Ocultamos la flecha de volver */
.guest-mode .chat-header .back-nav {
    display: none !important;
}

/* El chat debe ocupar todo el iframe */
.guest-mode #view-expert {
    display: flex !important;
    padding: 0 !important;
    height: 100vh !important;
    width: 100% !important;
    max-width: 100% !important;
}

.guest-mode .chat-container {
    height: calc(100vh - 120px) !important;
    padding: 15px !important;
}

.guest-mode .chat-input-area {
    padding: 10px 15px 15px !important;
}

/* Background Ambient Effect */
.app-background {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 70% 30%, rgba(188, 19, 254, 0.08) 0%, transparent 40%),
        /* Purple Top Right */
        radial-gradient(circle at 20% 80%, rgba(0, 240, 255, 0.08) 0%, transparent 40%);
    /* Cyan Bottom Left */
    z-index: -1;
    pointer-events: none;
}

/* Header Refined */
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: transparent;
    z-index: 10;
    margin: 10px auto 0;
    width: 100%;
    max-width: var(--max-width);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* LOGO FIX - CRITICAL */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hub-badge {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .hub-badge {
        font-size: 0.85rem;
    }
}

.logo-container img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.logo-auth {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--cyan-dim);
    margin-bottom: 20px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    position: relative;
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--status-online);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    display: none;
    /* Controlled by JS */
}

.user-info .greeting {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.2;
}

.user-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Status Badge */
.status-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-online);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator {
    display: block;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}

/* Logout Button */
.logout-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.logout-btn:hover {
    background: rgba(255, 0, 127, 0.1);
    border-color: var(--pink);
    color: var(--pink);
    transform: scale(1.05);
}

.logout-btn:active {
    transform: scale(0.95);
}

.logout-btn .material-symbols-rounded {
    font-size: 20px;
}

/* DASHBOARD GRID LAYOUT */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 20px 60px;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 24px 20px;
    }

    /* Onboarding Card takes full width on top */
    .card-onboarding {
        grid-column: span 2;
        margin-bottom: 8px;
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        gap: 18px;
    }
}

/* Logout Link at Bottom */
.logout-link-container {
    margin-top: 20px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.logout-link:hover {
    color: var(--pink);
    background: rgba(255, 0, 127, 0.05);
}

.logout-link .material-symbols-rounded {
    font-size: 18px;
}

/* CLASSIC PREMIUM CARDS (Restored) */
.futuristic-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    /* Match global radius */
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
    .futuristic-card:hover {
        background: var(--bg-input);
        border-color: var(--cyan-dim);
        transform: translateY(-4px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .futuristic-card:hover .arrow-icon {
        transform: translateX(5px);
        color: var(--cyan);
    }
}

.futuristic-card:active {
    transform: scale(0.98);
}

/* Card Glow Effect - Keep subtle */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

/* Icon Styles - Compact & Vibrant */
.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon span {
    font-size: 22px;
    color: white;
}

/* 1. Tutorials: Purple */
.card-tutorials .card-icon {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
    box-shadow: 0 4px 12px rgba(126, 34, 206, 0.3);
}

/* 2. AI: Cyan */
.card-ai .card-icon {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* 3. Incident: Pink/Red */
.card-incident .card-icon {
    background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3);
}

/* Content */
.card-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-main);
}

.card-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Decoration */
.arrow-icon {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 20px;
}

.futuristic-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Views Management */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Card */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin: auto;
    text-align: center;
}

.auth-card .logo-container {
    justify-content: center;
    margin-bottom: 24px;
}

.auth-card .logo-container img.login-logo-circle {
    height: 120px;
    width: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    margin-bottom: 10px;
}

.auth-card h2 {
    text-align: center;
}

.auth-card .auth-subtitle {
    text-align: center;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 32px;
}

/* Form Elements Generic */
.input-group {
    margin-bottom: 20px;
}

.input-group label,
.form-section label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    /* Smooth rounded corners */
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(0, 212, 197, 0.1);
}

.btn-primary {
    width: 100%;
    /* Gradient Pink Scale */
    background: linear-gradient(135deg, #FF007F 0%, #db2777 100%);
    color: #FFFFFF;
    /* White Text */
    border: none;
    padding: 14px;
    border-radius: 14px;
    /* Slightly larger rounded corners for button */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-top: 10px;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.6);
    /* Neon Glow Pink */
    transform: translateY(-2px);
    background: linear-gradient(135deg, #FF007F 0%, #E0006F 100%);
    color: #FFFFFF;
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
}

.auth-footer p {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* Dashboard Styles */
.dashboard-header {
    margin-bottom: 32px;
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

.dashboard-header h2,
.view-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 4px;
}

.modules-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    max-width: 600px;
}

.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.module-card:hover {
    border-color: var(--border-focus);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.icon-expert {
    background: linear-gradient(135deg, #00D4C5 0%, #009e93 100%);
    box-shadow: 0 4px 12px rgba(0, 212, 197, 0.3);
}

.icon-tutorials {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

.icon-incident {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.card-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.card-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.card-arrow {
    margin-left: auto;
    color: var(--text-dim);
    transition: transform 0.2s;
}

.module-card:hover .card-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* Dashboard Featured Card */
@media (min-width: 600px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-featured {
        grid-column: span 2;
    }
}

.card-featured {
    grid-row: span 1;
    background: linear-gradient(145deg, #151A23 0%, #0f131a 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.card-featured:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.glow-tutorials {
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Interior View Containers */
#view-incident,
#view-tutorials,
#view-promptgen {
    flex: 1;
    overflow-y: auto;
    padding: 10px 24px 40px;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

#view-expert {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 24px 0;
    position: relative;
    /* For absolute positioning context if needed */
}

.view-header {
    margin-bottom: 32px;
    margin-top: 10px;
}

/* Back Navigation */
.back-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    margin-bottom: 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    width: fit-content;
}

.back-nav:hover {
    color: var(--text-main);
}

/* CHAT UI STYLES */
.chat-header {
    display: flex;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0;
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 10;
    margin-top: 10px;
}

.chat-header .back-nav {
    margin-bottom: 0;
    margin-right: 16px;
    font-size: 1.2rem;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chat-title h3 {
    font-size: 1rem;
    margin: 0;
}

.chat-title .subtitle {
    font-size: 0.75rem;
    color: var(--primary);
    display: block;
}

.chat-title .status-dot {
    background-color: var(--status-online);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.chat-actions {
    color: var(--text-muted);
    cursor: pointer;
}

/* Chat Container */
/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding: 20px 4px 100px;
    /* Included 100px bottom padding to clear fixed input */
    height: auto;
    /* Allow flex to dictate height */
    scrollbar-width: thin;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20px, black calc(100% - 10px), transparent 100%);
    /* Fade out at bottom for smoothness */
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot .avatar {
    background: rgba(0, 212, 197, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 212, 197, 0.2);
}

.user .avatar {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.avatar.cuky-avatar {
    background-image: url('cuky.webp');
    background-size: cover;
    background-position: center;
    border: 1px solid var(--primary);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
}

.bot .bubble {
    background: var(--bg-card);
    color: var(--text-main);
    border-top-left-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.user .bubble {
    background: var(--primary);
    color: #000;
    border-top-right-radius: 4px;
    font-weight: 500;
}

/* Chat Video Card - Premium Look */
.chat-video-card {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    max-width: 260px;
    /* Constrain width in bubble */
}

.chat-video-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.chat-video-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    background: #000;
}

.chat-video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.chat-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    opacity: 0.9;
}

.chat-video-play span {
    font-size: 32px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.chat-video-info {
    padding: 10px 12px;
}

.chat-video-tag {
    font-size: 0.65rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2px;
}

.chat-video-info h5 {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    margin: 0;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.suggestions button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestions button:hover {
    background: rgba(0, 212, 197, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 18px;
    width: fit-content;
    border-top-left-radius: 4px;
    margin-left: 48px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-dim);
    border-radius: 50%;
    animation: typing 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 {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.chat-input-area {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);

    padding: 16px 20px;
    background: rgba(11, 14, 20, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-subtle);
}

.chat-input-area form {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.chat-input-area input {
    flex: 1;
    border-radius: 100px;
    padding: 14px 20px;
}

.chat-input-area button {
    background: var(--primary);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-input-area button:disabled {
    background: var(--bg-card);
    color: var(--text-dim);
    cursor: not-allowed;
}

#view-expert {
    padding-bottom: 80px;
}

/* INCIDENTS FORM STYLES (NEW) */
.incident-form {
    max-width: 600px;
    width: 100%;
    margin-bottom: 40px;
}

.form-section {
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-section.half {
    flex: 1;
}

.upload-section {
    margin-top: 12px;
}

.file-drop-area {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    transition: all 0.2s;
    cursor: pointer;
}

.file-drop-area:hover {
    border-color: var(--primary);
    background: rgba(0, 212, 197, 0.05);
}

.file-drop-area span.material-symbols-rounded {
    font-size: 40px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.file-drop-area .file-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.file-drop-area input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

#filePreview {
    margin-top: 8px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-subtle);
}

#filePreview.hidden {
    display: none;
}

.file-name {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.remove-file {
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
}

.remove-file:hover {
    color: #ef4444;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* Success Overlay */
.success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.success-content {
    text-align: center;
    width: 100%;
    max-width: 360px;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.check-icon {
    width: 64px;
    height: 64px;
    background: var(--status-online);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.4);
}

.check-icon span {
    font-size: 32px;
    color: #fff;
}

.success-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.success-content p {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.success-content .sub-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 24px;
}

/* Tutorials (Missing in previous sometimes) */
.view-header {
    margin-bottom: 24px;
}

.view-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-top: 12px;
}

.tutorials-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    padding-left: 42px;
}

.categories-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-chip.active {
    background: var(--primary);
    color: #000;
    font-weight: 500;
    border-color: var(--primary);
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 40px;
}

/* Background Ambient Effect - Optimized */
.app-background {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 212, 197, 0.05) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
    /* Removed heavy scale animation to prevent full-page repaint jitter */
    opacity: 0.6;
}

/* ... existing code ... */

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    /* Stability Fixes */
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    transform: translateZ(0);
}

.video-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-subtle);
}

.thumbnail-container {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.play-overlay span {
    color: #fff;
    font-size: 24px;
}

.video-info {
    padding: 12px;
}

.video-info h4 {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-card);
    width: 95%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-frame-container {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.video-frame-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-info {
    padding: 16px;
}

.modal-info h3 {
    margin-bottom: 8px;
    color: var(--text-main);
}

.modal-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Animation Utility */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Media Queries */
@media (min-width: 600px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
        border: none;
        background: transparent;
        box-shadow: none;
    }

    .app-header {
        background: rgba(11, 14, 20, 0.95);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* === STANDARD VIEW LAYOUT FOR DESKTOP === */
#view-tutorials,
#view-incident,
#view-onboarding,
#view-promptgen,
#view-faqs {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 24px 80px;
    overflow-y: auto;
}

#view-onboarding,
#view-faqs {
    max-width: var(--content-width);
    /* Narrower for readability */
}

@media (min-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Fix for existing components to use full width inside their containers */
.tutorials-controls,
.video-grid,
.onboarding-hub-container,
.faq-accordion-hub {
    width: 100%;
}

/* === ONBOARDING INTERACTIVE HUB === */
.onboarding-hub-container {
    width: 100%;
    margin: 0 auto;
    padding-bottom: 60px;
}

.onboarding-progress-hub {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(240, 240, 255, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-percent {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.progress-hub-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 100px;
    overflow: hidden;
}

.progress-hub-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan), #00d4c5);
    box-shadow: 0 0 15px var(--cyan);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accordion Board */
.onboarding-accordion-board {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.onboarding-item-hub {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.onboarding-item-hub.active {
    border-color: var(--cyan-dim);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.05);
}

.onboarding-item-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.step-badge-hub {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.onboarding-item-hub.completed .step-badge-hub {
    background: var(--cyan);
    color: var(--bg-dark);
    border-color: var(--cyan);
}

.onboarding-item-header h4 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.onboarding-chevron {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.onboarding-item-hub.expanded .onboarding-chevron {
    transform: rotate(180deg);
}

/* Interior Content */
.onboarding-item-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.1);
}

.onboarding-item-hub.expanded .onboarding-item-body {
    max-height: 1000px;
    /* Large enough for content */
}

.onboarding-body-content {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.step-desc-hub {
    font-size: 0.95rem;
    color: var(--cyan);
    margin-bottom: 20px;
    font-weight: 500;
}

.substeps-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.substep-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.substep-row:hover {
    background: #1e2536;
}

/* Custom Checkbox */
.hub-checkbox {
    width: 22px;
    height: 22px;
    background: var(--bg-dark);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.hub-checkbox.checked {
    background: var(--cyan);
    border-color: var(--cyan);
}

.hub-checkbox span {
    font-size: 16px;
    color: var(--bg-dark);
    display: none;
}

.hub-checkbox.checked span {
    display: block;
}

.substep-text {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
}

.substep-row.done .substep-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Mini Progress Dashboard */
.mini-progress-badge {
    position: absolute;
    top: 20px;
    right: 50px;
    background: rgba(0, 240, 255, 0.1);
    color: var(--cyan);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid var(--cyan-dim);
}

/* FAQ HUB VERSION */
.faq-accordion-hub {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item-hub {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item-hub.active {
    border-color: var(--cyan-dim);
}

.faq-item-hub-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.faq-icon-hub {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
}

.faq-item-hub-header h4 {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.faq-item-hub-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 24px;
}

.faq-item-hub.active .faq-item-hub-body {
    max-height: 600px;
    padding-bottom: 24px;
}

.faq-item-hub-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Scrollbar for Dashboard */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* PROMPT GENERATOR PREMIUM STYLES */
.prompt-step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.step-number {
    width: 24px;
    height: 24px;
    background: var(--cyan);
    color: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.modality-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.modality-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
}

.modality-card.active {
    background: rgba(0, 240, 255, 0.05);
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.05);
}

.modality-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.modality-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.modality-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--cyan);
    cursor: pointer;
}

.data-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.data-field-item {
    font-size: 0.8rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.data-field-item:hover {
    opacity: 1;
}

#generatedPromptText {
    background: #000;
    border: 1px solid var(--cyan);
    color: #00F0FF;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan) transparent;
}

#generatedPromptText::-webkit-scrollbar {
    width: 6px;
}

#generatedPromptText::-webkit-scrollbar-thumb {
    background: var(--cyan);
    border-radius: 10px;
}

.form-section-header {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-header label {
    margin-bottom: 0 !important;
}

.field-container {
    animation: slideDown 0.3s ease-out forwards;
    overflow: hidden;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); max-height: 0; }
    to { opacity: 1; transform: translateY(0); max-height: 500px; }
}