/**
 * @file readiness-pulse-v2.css
 * @filepath css/readiness-pulse-v2.css
 * @version 1.4.0
 * @updated 2026-02-23 11:50:00 AM CDT
 * @author Greg Paskal
 * @company MissionWares®
 * 
 * @description New Readiness Pulse styles with Study/Review mode toggle
 * 
 * @changeLog:
 * Date        Author          Version  Description
 * ----------  --------------  -------  --------------------------
 * 2026-02-14  Greg Paskal     1.0.6    Mobile: ultra-compact layout - score+label
 *                                      inline, dots+terms on same row, smaller toggle
 * 2026-02-14  Greg Paskal     1.0.5    Mobile: compact layout - smaller toggle,
 *                                      dropdown, score (36px gradient), stats
 * 2026-02-14  Greg Paskal     1.0.4    Desktop: full width, gradient score styling
 * 2026-02-14  Greg Paskal     1.0.3    Add marquee spacing below dropdown trigger
 */

/* ═══════════════════════════════════════════════════════════════════════════
   MODE TOGGLE (Study / Review) - Ultra compact for mobile
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   MODE SELECTOR CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.mode-selector {
    display: flex;
    gap: 10px;
    padding: 12px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-card {
    flex: 1;
    position: relative;
    background: linear-gradient(145deg, #1a1a35, #1e1e40);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
}

/* Glow border — hidden by default */
.mode-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--card-c1), var(--card-c2), var(--card-c1));
    background-size: 200% 200%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s ease;
    animation: mode-glow-shift 3s ease infinite;
}

@keyframes mode-glow-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.mode-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Active state */
.mode-card.active {
    border-color: transparent;
    background: linear-gradient(145deg, #1a1a40, #22224a);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px var(--card-glow, rgba(37, 99, 235, 0.15));
}

.mode-card.active::before {
    opacity: 0.7;
}

/* Icon */
.mode-card-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.mode-card.active .mode-card-icon {
    transform: scale(1.1);
}

/* Body wrapper */
.mode-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* Title */
.mode-card-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    transition: all 0.3s ease;
}

.mode-card.active .mode-card-title {
    color: white;
}

/* Description */
.mode-card-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.mode-card.active .mode-card-desc {
    color: rgba(255, 255, 255, 0.55);
}

/* Study card colors — blue to purple */
.mode-card.study {
    --card-c1: #2563EB;
    --card-c2: #a855f7;
    --card-glow: rgba(37, 99, 235, 0.2);
}

/* Review card colors — cyan to green */
.mode-card.review {
    --card-c1: #06b6d4;
    --card-c2: #22c55e;
    --card-glow: rgba(6, 182, 212, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   READINESS PULSE V2 - SHARED STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.readiness-pulse-v2 {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CURRICULUM SELECTOR DROPDOWN - Compact for mobile
   ═══════════════════════════════════════════════════════════════════════════ */

.curriculum-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.4);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.curriculum-dropdown-trigger:hover {
    background: rgba(37, 99, 235, 0.25);
    border-color: rgba(37, 99, 235, 0.6);
}

.curriculum-dropdown-trigger .dropdown-chevron {
    transition: transform 0.2s ease;
    font-size: 8px;
}

.curriculum-dropdown-trigger.open .dropdown-chevron {
    transform: rotate(180deg);
}

/* Full curriculum name (shown below dropdown on mobile) */
.curriculum-full-name {
    text-align: center;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 10px;
    margin-top: 2px;
}

/* Marquee spacing when below dropdown trigger */
.curriculum-dropdown-trigger + .curriculum-marquee {
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STUDY MODE DROPDOWN PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.study-dropdown-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.study-dropdown-panel.open {
    display: flex;
}

.study-dropdown-content {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.study-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
}

.study-dropdown-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.study-dropdown-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Curriculum Groups */
.curriculum-group {
    padding: 12px 16px 4px;
}

.curriculum-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.curriculum-group-icon {
    font-size: 14px;
}

/* Curriculum Items */
.curriculum-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.curriculum-item:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.3);
}

.curriculum-item.selected {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.5);
}

/* Readiness dot indicator */
.curriculum-readiness-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.curriculum-readiness-dot.grey { background: #6B7280; }
.curriculum-readiness-dot.red { background: #EF4444; }
.curriculum-readiness-dot.orange { background: #F59E0B; }
.curriculum-readiness-dot.green { background: #22C55E; }

/* Curriculum info */
.curriculum-item-info {
    flex: 1;
    min-width: 0;
}

.curriculum-item-name {
    font-size: 15px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.curriculum-item-terms {
    font-size: 12px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    margin-top: 2px;
}

/* Readiness percentage */
.curriculum-item-readiness {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    flex-shrink: 0;
}

.curriculum-item-readiness.grey { color: #6B7280; }
.curriculum-item-readiness.red { color: #EF4444; }
.curriculum-item-readiness.orange { color: #F59E0B; }
.curriculum-item-readiness.green { color: #22C55E; }

/* Shared terms hint */
.curriculum-item-shared {
    font-size: 11px;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    font-style: italic;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STUDY LOUNGE PULSE ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.sl-pulse-score-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    margin-top: -4px;
    margin-bottom: 12px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCORE DISPLAY - Ultra compact for mobile
   ═══════════════════════════════════════════════════════════════════════════ */

.pulse-score-section {
    padding: 8px 16px 10px;
    text-align: center;
}

/* Score and label on same line */
.pulse-score-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.pulse-score-large {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #f59e0b, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pulse-score-pct {
    font-size: 0.5em;
    vertical-align: super;
}

.pulse-score-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

/* Progress bar - thinner */
.pulse-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 6px 0;
    overflow: hidden;
}

.pulse-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22C55E, #06B6D4);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Mastery stats + term count on same row */
.pulse-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    font-size: 11px;
}

.pulse-mastery-stats {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.pulse-mastery-stat {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.pulse-mastery-stat i {
    font-style: normal;
    font-size: 8px;
}

.pulse-mastery-stat.mastered i { color: #22C55E; }
.pulse-mastery-stat.familiar i { color: #F59E0B; }
.pulse-mastery-stat.missed i { color: #EF4444; }
.pulse-mastery-stat.unseen i { color: #6B7280; }

.pulse-stats-separator {
    color: var(--text-muted, rgba(255, 255, 255, 0.3));
    font-size: 10px;
}

.pulse-term-count {
    font-size: 11px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESKTOP STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    .readiness-pulse-v2 {
        margin: 0;
        /* Fill available width like zone cards */
        width: 100%;
        border-radius: 16px;
    }

    .mode-selector {
        padding: 16px 20px;
        gap: 14px;
    }

    .mode-card {
        padding: 16px 18px;
        gap: 14px;
        border-radius: 16px;
    }

    .mode-card::before {
        border-radius: 18px;
    }

    .mode-card-icon {
        font-size: 28px;
    }

    .mode-card-title {
        font-size: 16px;
    }

    .mode-card-desc {
        font-size: 12px;
    }

    /* Desktop horizontal layout */
    .pulse-content-desktop {
        display: flex;
        align-items: center;
        padding: 24px;
        gap: 32px;
    }

    /* Score card on left - with gradient styling */
    .pulse-score-card {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 16px;
        padding: 28px 36px;
        text-align: center;
        min-width: 160px;
    }

    .pulse-score-card .pulse-score-large {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 56px;
        font-weight: 700;
        line-height: 1;
        background: linear-gradient(135deg, #f59e0b, #22c55e);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .pulse-score-card .pulse-score-label {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary, rgba(255, 255, 255, 0.6));
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-top: 8px;
    }

    /* Main content on right */
    .pulse-main-content {
        flex: 1;
    }

    /* Curriculum selector inline with full name */
    .curriculum-selector-row {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 16px;
        min-width: 0;
    }

    .curriculum-dropdown-trigger {
        margin: 0;
        padding: 10px 20px;
        font-size: 16px;
        border-radius: 12px;
        border-width: 2px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .curriculum-dropdown-trigger .dropdown-chevron {
        font-size: 12px;
    }

    .curriculum-full-name-desktop {
        font-size: 16px;
        color: var(--text-secondary, rgba(255, 255, 255, 0.7));
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Progress bar wider */
    .pulse-progress-bar {
        margin: 16px 0;
        height: 8px;
    }

    /* Desktop mastery with labels */
    .pulse-mastery-stats-desktop {
        display: flex;
        gap: 24px;
        flex-wrap: nowrap;
    }

    .pulse-mastery-stat-desktop {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .pulse-mastery-stat-desktop .stat-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
    }

    .pulse-mastery-stat-desktop .stat-dot.mastered { background: #22C55E; }
    .pulse-mastery-stat-desktop .stat-dot.familiar { background: #F59E0B; }
    .pulse-mastery-stat-desktop .stat-dot.missed { background: #EF4444; }
    .pulse-mastery-stat-desktop .stat-dot.unseen { background: #6B7280; }

    .pulse-mastery-stat-desktop .stat-count {
        font-size: 16px;
        font-weight: 600;
        color: white;
    }

    .pulse-mastery-stat-desktop .stat-label {
        font-size: 14px;
        color: var(--text-muted, rgba(255, 255, 255, 0.5));
        white-space: nowrap;
    }

    /* Desktop dropdown - modal style */
    .study-dropdown-panel {
        align-items: center;
    }

    .study-dropdown-content {
        border-radius: 20px;
        max-width: 600px;
        max-height: 70vh;
    }

    /* Desktop curriculum items show more info */
    .curriculum-item {
        padding: 16px;
    }

    .curriculum-item-full-name {
        font-size: 13px;
        color: var(--text-muted, rgba(255, 255, 255, 0.5));
        margin-top: 2px;
    }

    /* Contextual tip */
    .pulse-tip {
        margin-top: 16px;
        padding: 12px 16px;
        background: rgba(37, 99, 235, 0.1);
        border-radius: 8px;
        font-size: 14px;
        color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    }

    .pulse-tip .tip-icon {
        margin-right: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.study-dropdown-panel.open .study-dropdown-content {
    animation: slideUp 0.3s ease;
}

@media (min-width: 768px) {
    @keyframes fadeIn {
        from { opacity: 0; transform: scale(0.95); }
        to { opacity: 1; transform: scale(1); }
    }

    .study-dropdown-panel.open .study-dropdown-content {
        animation: fadeIn 0.2s ease;
    }
}