/* ================================================================
   CLIMOVA HUB — E-Module POPBL Design System
   Theme: Futuristic blue-purple gradient
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-deep: #080614;
    --bg-surface: #0d0a1f;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.08);
    --bg-card-solid: #141028;
    --accent-1: #6C3AED;
    --accent-2: #3B82F6;
    --accent-3: #06B6D4;
    --accent-4: #22C55E;
    --accent-warn: #F59E0B;
    --accent-danger: #EF4444;
    --accent-glow: #8B5CF6;
    --gradient-accent: linear-gradient(135deg, #6C3AED, #3B82F6, #06B6D4);
    --gradient-card: linear-gradient(145deg, rgba(108,58,237,0.12), rgba(59,130,246,0.06));
    --text-primary: #F1F0F7;
    --text-secondary: rgba(241,240,247,0.65);
    --text-muted: rgba(241,240,247,0.4);
    --border: rgba(255,255,255,0.08);
    --border-active: rgba(108,58,237,0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 40px rgba(108,58,237,0.15);
    --font-display: 'Sora', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ── Ambient Background ── */
.ambient {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.ambient .orb {
    position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.25;
    animation: orbDrift 25s ease-in-out infinite;
}
.ambient .orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #6C3AED, transparent 70%); top: -8%; left: -8%; }
.ambient .orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, #3B82F6, transparent 70%); top: 50%; right: -10%; animation-delay: -8s; }
.ambient .orb-3 { width: 350px; height: 350px; background: radial-gradient(circle, #06B6D4, transparent 70%); bottom: -5%; left: 25%; animation-delay: -16s; }
@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -25px) scale(1.08); }
    66% { transform: translate(-15px, 15px) scale(0.96); }
}

.page { position: relative; z-index: 1; }

/* ── NAVBAR ── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 14px 40px;
    display: flex; align-items: center; justify-content: space-between;
    backdrop-filter: blur(20px);
    background: rgba(8,6,20,0.75);
    border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo-img { height: 36px; width: auto; display: block; }
.sidebar-logo-img { height: 32px; width: auto; display: block; }
.nav-brand-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--gradient-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 800; color: #fff;
    font-family: var(--font-display);
}
.nav-brand-text {
    font-family: var(--font-display); font-size: 20px; font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 14px; font-weight: 500;
    padding: 8px 16px; border-radius: 10px; transition: all 0.25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); background: var(--bg-card-hover); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px; border: none; border-radius: 12px;
    font-family: var(--font-body); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.btn-primary { background: var(--gradient-accent); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,58,237,0.4); }
.btn-secondary {
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-active); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 14px; }
.btn-ghost {
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

/* ── LAYOUT ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.main-content { padding-top: 80px; min-height: 100vh; }

/* ── MODULE LIST ── */
.module-list-header {
    padding: 60px 0 40px; text-align: center;
}
.module-list-header h1 {
    font-family: var(--font-display); font-size: 36px; font-weight: 800;
    letter-spacing: -1px; margin-bottom: 12px;
}
.module-list-header p { color: var(--text-secondary); font-size: 16px; max-width: 600px; margin: 0 auto; }

.modules-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px; padding-bottom: 60px;
}
.module-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all 0.4s var(--transition); cursor: pointer;
    text-decoration: none; color: inherit; display: block;
}
.module-card:hover {
    transform: translateY(-6px); border-color: var(--border-active);
    box-shadow: var(--shadow-lg);
}
.module-card-cover {
    height: 180px; display: flex; align-items: center; justify-content: center;
    font-size: 64px; position: relative;
    background: linear-gradient(135deg, #1a0b3e, #0f1b3d);
}
.module-card-body { padding: 24px; }
.module-card-tag {
    display: inline-block; padding: 4px 12px;
    background: rgba(108,58,237,0.12); border-radius: 6px;
    font-size: 11px; font-weight: 700; color: var(--accent-glow);
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px;
}
.module-card-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.module-card-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ── MODULE SHOW (Overview) ── */
.module-header {
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}
.module-header h1 {
    font-family: var(--font-display); font-size: 32px; font-weight: 800;
    letter-spacing: -1px; margin-bottom: 8px;
}
.module-header p { color: var(--text-secondary); font-size: 16px; max-width: 700px; }

/* Progress Bar */
.progress-bar-wrapper { margin: 32px 0; }
.progress-label {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px; font-size: 13px;
}
.progress-label span:first-child { color: var(--text-secondary); }
.progress-label span:last-child { font-weight: 700; color: var(--accent-3); }
.progress-track {
    height: 8px; background: rgba(255,255,255,0.06);
    border-radius: 8px; overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 8px;
    background: var(--gradient-accent);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Phase Timeline */
.phase-timeline {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 20px; margin-bottom: 48px;
}
.phase-timeline-item {
    text-align: center; text-decoration: none; color: inherit;
    padding: 28px 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.35s; cursor: pointer; position: relative;
}
.phase-timeline-item:hover {
    transform: translateY(-4px); background: var(--bg-card-hover);
    border-color: var(--border-active);
}
.phase-timeline-item.completed { border-color: rgba(34,197,94,0.3); }
.phase-timeline-item.current { border-color: var(--border-active); box-shadow: var(--shadow-glow); }
.phase-timeline-item.locked { opacity: 0.45; pointer-events: none; }
.phase-num {
    width: 44px; height: 44px; margin: 0 auto 14px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 16px; font-weight: 800; color: #fff;
}
.phase-num.c-purple { background: linear-gradient(135deg, #6C3AED, #8B5CF6); }
.phase-num.c-blue { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.phase-num.c-cyan { background: linear-gradient(135deg, #06B6D4, #22D3EE); }
.phase-num.c-green { background: linear-gradient(135deg, #10B981, #34D399); }
.phase-num.c-amber { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.phase-num.c-red { background: linear-gradient(135deg, #EF4444, #F87171); }
.completed .phase-num { background: linear-gradient(135deg, #10B981, #34D399) !important; }
.phase-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.phase-subtitle { font-size: 12px; color: var(--text-muted); }
.phase-status {
    display: inline-block; margin-top: 10px;
    font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    padding: 3px 10px; border-radius: 6px;
}
.phase-status.done { background: rgba(34,197,94,0.12); color: #22C55E; }
.phase-status.active { background: rgba(108,58,237,0.12); color: var(--accent-glow); }
.phase-status.lock { background: rgba(255,255,255,0.04); color: var(--text-muted); }

/* ── PHASE VIEW ── */
.phase-view { padding-bottom: 80px; }
.phase-view-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 48px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 40px;
}
.phase-view-info {}
.phase-view-label {
    font-family: var(--font-display); font-size: 12px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase; color: var(--accent-3);
    margin-bottom: 8px;
}
.phase-view-title {
    font-family: var(--font-display); font-size: 28px; font-weight: 800;
    letter-spacing: -0.5px; margin-bottom: 4px;
}
.phase-view-subtitle { font-size: 15px; color: var(--text-secondary); }
.phase-nav { display: flex; gap: 8px; align-items: center; padding-top: 8px; }

/* Nova Dialog Bubble */
.nova-bubble {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 24px; margin-bottom: 36px;
    background: linear-gradient(135deg, rgba(108,58,237,0.08), rgba(59,130,246,0.04));
    border: 1px solid rgba(108,58,237,0.12);
    border-radius: var(--radius);
}
.nova-bubble-avatar {
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, #6C3AED, #3B82F6);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.nova-bubble-content {}
.nova-bubble-name {
    font-family: var(--font-display); font-size: 13px; font-weight: 700;
    color: var(--accent-glow); margin-bottom: 4px;
}
.nova-bubble-text {
    font-size: 15px; color: var(--text-secondary); line-height: 1.7;
    font-style: italic;
}

/* Interaction Panels */
.interaction-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 36px; margin-bottom: 24px;
}
.interaction-panel h3 {
    font-family: var(--font-display); font-size: 18px; font-weight: 700;
    margin-bottom: 20px;
}

/* ── PHASE 1: Opening — Video + Reflection ── */
.video-placeholder {
    width: 100%; aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a0b3e, #0f1b3d);
    border-radius: var(--radius); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 16px;
    margin-bottom: 24px; position: relative; overflow: hidden;
}
.video-placeholder::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(108,58,237,0.15), transparent 70%);
}
.video-placeholder .play-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; cursor: pointer; transition: all 0.3s;
    border: 2px solid rgba(255,255,255,0.15); z-index: 1;
}
.video-placeholder .play-icon:hover { background: rgba(108,58,237,0.3); transform: scale(1.08); }
.video-placeholder .play-label { font-size: 14px; color: var(--text-muted); z-index: 1; }
.scene-tags {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}
.scene-tag {
    padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.25s; cursor: pointer;
}
.scene-tag:hover { background: var(--bg-card-hover); border-color: var(--border-active); }
.scene-tag.active { border-color: var(--accent-1); background: rgba(108,58,237,0.1); }

/* ── PHASE 2: Problem Selection ── */
.problem-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.problem-option {
    padding: 24px; background: var(--bg-card); border: 2px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: all 0.35s;
    display: flex; align-items: flex-start; gap: 16px;
}
.problem-option:hover { border-color: var(--border-active); background: var(--bg-card-hover); }
.problem-option.selected { border-color: var(--accent-1); background: rgba(108,58,237,0.08); }
.problem-option .p-icon {
    width: 48px; height: 48px; border-radius: 14px;
    background: rgba(108,58,237,0.1); display: flex; align-items: center;
    justify-content: center; font-size: 24px; flex-shrink: 0;
}
.problem-option .p-text { font-size: 15px; font-weight: 600; line-height: 1.5; }

/* ── PHASE 3: Cause-Effect Drag & Drop ── */
.dragdrop-container { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.dragdrop-column h4 {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.drag-item, .drop-zone {
    padding: 16px 20px; margin-bottom: 10px;
    border-radius: var(--radius-sm); font-size: 14px;
    transition: all 0.25s; cursor: grab;
}
.drag-item {
    background: var(--bg-card); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.drag-item:hover { background: var(--bg-card-hover); border-color: var(--border-active); }
.drag-item.dragging { opacity: 0.5; transform: scale(0.95); }
.drag-item .drag-handle { color: var(--text-muted); font-size: 16px; }
.drop-zone {
    background: rgba(108,58,237,0.04); border: 2px dashed rgba(108,58,237,0.15);
    min-height: 52px; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 13px;
}
.drop-zone.over { border-color: var(--accent-1); background: rgba(108,58,237,0.08); }
.drop-zone.matched { border-style: solid; border-color: var(--accent-4); background: rgba(34,197,94,0.06); color: var(--text-primary); }
.drop-zone.wrong { border-color: var(--accent-danger); background: rgba(239,68,68,0.06); }

/* ── PHASE 4: Solution Canvas ── */
.solution-categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.sol-cat {
    padding: 20px 16px; text-align: center;
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: all 0.3s;
}
.sol-cat:hover { border-color: var(--border-active); }
.sol-cat.selected { border-color: var(--accent-1); background: rgba(108,58,237,0.08); }
.sol-cat .sc-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.sol-cat .sc-label { font-size: 13px; font-weight: 600; }

.canvas-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.canvas-field {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px;
}
.canvas-field label {
    display: block; font-family: var(--font-display);
    font-size: 13px; font-weight: 700; color: var(--accent-3);
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px;
}
.canvas-field textarea, .canvas-field input[type="text"] {
    width: 100%; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 12px 14px; color: var(--text-primary);
    font-family: var(--font-body); font-size: 14px;
    resize: vertical; min-height: 80px; transition: border-color 0.25s;
}
.canvas-field textarea:focus, .canvas-field input[type="text"]:focus {
    outline: none; border-color: var(--accent-1);
}

/* ── PHASE 5: Project Collaboration ── */
.task-board { margin-bottom: 24px; }
.task-item {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; margin-bottom: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); transition: all 0.25s;
}
.task-item:hover { background: var(--bg-card-hover); }
.task-check {
    width: 22px; height: 22px; border-radius: 6px;
    border: 2px solid var(--border); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s; flex-shrink: 0; font-size: 12px; color: transparent;
}
.task-check.checked { background: var(--accent-4); border-color: var(--accent-4); color: #fff; }
.task-text { flex: 1; font-size: 14px; }
.task-text.done { text-decoration: line-through; color: var(--text-muted); }
.task-assignee {
    padding: 4px 10px; background: rgba(108,58,237,0.1);
    border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--accent-glow);
}

/* ── PHASE 6: Impact Tracker ── */
.metric-row {
    display: grid; grid-template-columns: 1fr 120px 120px 60px;
    gap: 16px; align-items: center; padding: 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 12px;
}
.metric-name { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.metric-name .m-icon { font-size: 24px; }
.metric-input {
    width: 100%; padding: 10px 12px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: var(--radius-xs); color: var(--text-primary);
    font-family: var(--font-body); font-size: 14px; text-align: center;
}
.metric-input:focus { outline: none; border-color: var(--accent-1); }
.metric-unit { font-size: 13px; color: var(--text-muted); }
.metric-change {
    padding: 6px 12px; border-radius: 8px;
    font-size: 13px; font-weight: 700; text-align: center;
}
.metric-change.positive { background: rgba(34,197,94,0.12); color: #22C55E; }
.metric-change.negative { background: rgba(239,68,68,0.12); color: #EF4444; }

/* ── PHASE 7: Communication Upload ── */
.format-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.format-option {
    padding: 24px 16px; text-align: center;
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: all 0.3s;
}
.format-option:hover { border-color: var(--border-active); }
.format-option.selected { border-color: var(--accent-1); background: rgba(108,58,237,0.08); }
.format-option .fo-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.format-option .fo-label { font-size: 13px; font-weight: 600; }
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 48px; text-align: center; cursor: pointer; transition: all 0.3s;
}
.upload-zone:hover { border-color: var(--border-active); background: var(--bg-card); }
.upload-zone .uz-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone .uz-text { font-size: 15px; color: var(--text-secondary); margin-bottom: 4px; }
.upload-zone .uz-hint { font-size: 13px; color: var(--text-muted); }

/* ── PHASE 8: Reflection Journal ── */
.reflection-prompts {}
.reflection-prompt {
    margin-bottom: 24px;
}
.reflection-prompt .rp-question {
    font-family: var(--font-display); font-size: 15px; font-weight: 600;
    margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.reflection-prompt textarea {
    width: 100%; min-height: 100px; padding: 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: var(--font-body); font-size: 14px;
    line-height: 1.7; resize: vertical; transition: border-color 0.25s;
}
.reflection-prompt textarea:focus { outline: none; border-color: var(--accent-1); }

/* ── Toast Notification ── */
.toast {
    position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(120px);
    padding: 14px 28px; background: rgba(15,12,35,0.95); backdrop-filter: blur(16px);
    border: 1px solid var(--border-active); border-radius: 14px;
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    z-index: 999; opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Footer inside module ── */
.phase-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 32px 0; margin-top: 40px;
    border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    .phase-timeline { grid-template-columns: repeat(2, 1fr); }
    .problem-grid { grid-template-columns: 1fr; }
    .dragdrop-container { grid-template-columns: 1fr; }
    .solution-categories { grid-template-columns: repeat(2, 1fr); }
    .canvas-grid { grid-template-columns: 1fr; }
    .metric-row { grid-template-columns: 1fr; gap: 10px; }
    .format-options { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .navbar { padding: 12px 16px; }
    .nav-links { display: none; }
    .container { padding: 0 16px; }
    .phase-timeline { grid-template-columns: 1fr; }
    .solution-categories { grid-template-columns: 1fr; }
    .format-options { grid-template-columns: 1fr; }
    .interaction-panel { padding: 24px 20px; }
}
