/* PHLAZE Web App — Main Stylesheet */
:root {
  --bg: #0A0A0F; --bg2: #12121A; --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08); --text: #F0F0F5; --dim: rgba(255,255,255,0.5);
  --purple: #8B5CF6; --cyan: #F59E0B; --accent: #8B5CF6;
  --gradient: linear-gradient(135deg, #8B5CF6, #F59E0B);
  --accent-glow: rgba(139,92,246,0.15); --cyan-glow: rgba(245,158,11,0.15);
  --red: #ef4444; --green: #22c55e; --blue: #3b82f6;
  --orange: #f97316; --yellow: #f59e0b;
  --radius: 16px; --radius-sm: 12px; --radius-xs: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: all 0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }
a { color: var(--cyan); text-decoration: none; } a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
img { max-width: 100%; height: auto; }

/* Glass Card */
.glass { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(16px); transition: var(--transition); }
.glass:hover { border-color: rgba(255,255,255,0.12); }
.glass.clickable { cursor: pointer; } .glass.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.glass.clickable:active { transform: scale(0.98); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; transition: var(--transition); white-space: nowrap; }
.btn-primary { background: var(--gradient); color: #fff; } .btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary { background: var(--glass); border: 1px solid var(--glass-border); color: var(--text); } .btn-secondary:hover { border-color: var(--purple); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Form Elements */
.input, .textarea, .select { width: 100%; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font-size: 14px; transition: var(--transition); outline: none; }
.input:focus, .textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 2px var(--accent-glow); }
.textarea { resize: vertical; min-height: 80px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.label { display: block; font-size: 13px; font-weight: 500; color: var(--dim); margin-bottom: 6px; }
.error-text { font-size: 12px; color: var(--red); margin-top: 4px; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.grid { display: grid; } .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); }
.text-center { text-align: center; } .text-right { text-align: right; }
.w-full { width: 100%; } .h-full { height: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mt-6{margin-top:24px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.mb-6{margin-bottom:24px}
.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.p-5{padding:20px}.p-6{padding:24px}

/* Typography */
.text-xs { font-size: 12px; } .text-sm { font-size: 14px; } .text-base { font-size: 16px; }
.text-lg { font-size: 18px; } .text-xl { font-size: 24px; } .text-2xl { font-size: 32px; } .text-3xl { font-size: 40px; } .text-4xl { font-size: 48px; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; } .font-black { font-weight: 900; }
.text-dim { color: var(--dim); } .text-accent { color: var(--purple); } .text-cyan { color: var(--cyan); } .text-green { color: var(--green); } .text-red { color: var(--red); }
.text-gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* App Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--bg2); border-right: 1px solid var(--glass-border); padding: 20px 0; position: fixed; top: 0; left: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; transition: transform 0.3s ease; }
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid var(--glass-border); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-phase { padding: 8px 20px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--purple); opacity: 0.7; }
.sidebar-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--dim); cursor: pointer; transition: var(--transition); border-left: 3px solid transparent; }
.sidebar-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sidebar-item.active { color: var(--purple); background: var(--accent-glow); border-left-color: var(--purple); }
.sidebar-item .icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.sidebar-item .badge { margin-left: auto; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.sidebar-item .badge.pro { background: var(--accent-glow); color: var(--purple); }
.sidebar-item .badge.lock { background: rgba(255,255,255,0.05); color: var(--dim); }
.main-content { flex: 1; margin-left: 260px; padding: 24px; min-height: 100vh; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--dim); margin-top: 4px; }

/* Mobile Menu Toggle */
.menu-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 50; width: 40px; height: 40px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--glass-border); align-items: center; justify-content: center; font-size: 20px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 35; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 100; padding: 10px 20px; border-radius: var(--radius-sm); background: var(--gradient); color: #fff; font-size: 14px; font-weight: 600; animation: slideDown 0.3s ease; pointer-events: none; }
@keyframes slideDown { from { transform: translateX(-50%) translateY(-20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 24px; max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }

/* Radar Chart Container */
.radar-container { position: relative; width: 100%; max-width: 300px; margin: 0 auto; }
.radar-container canvas { width: 100%; height: 250px; }

/* Grade Badge */
.grade-badge { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-sm); font-size: 24px; font-weight: 900; color: #0A0A0F; }
.grade-badge.lg { width: 80px; height: 80px; font-size: 40px; border-radius: var(--radius); }

/* Progress Bar */
.progress-bar { width: 100%; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.05); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--gradient); transition: width 0.5s ease; }

/* Kanban Board */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kanban-column { min-height: 200px; }
.kanban-column-header { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px; border-radius: var(--radius-xs); margin-bottom: 8px; }
.kanban-card { padding: 12px; border-radius: var(--radius-xs); background: var(--glass); border: 1px solid var(--glass-border); margin-bottom: 8px; cursor: grab; transition: var(--transition); }
.kanban-card:active { cursor: grabbing; opacity: 0.8; }
.kanban-card.dragging { opacity: 0.4; }
.kanban-column.drag-over { background: rgba(139,92,246,0.05); border: 2px dashed var(--purple); border-radius: var(--radius-sm); }

/* Canvas Grid (Business Model) */
.canvas-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, minmax(120px, auto)); gap: 8px; }
.canvas-block { padding: 12px; border-radius: var(--radius-xs); background: var(--glass); border: 1px solid var(--glass-border); cursor: pointer; transition: var(--transition); min-height: 120px; }
.canvas-block:hover { border-color: var(--purple); }
.canvas-block.editing { border-color: var(--purple); box-shadow: 0 0 0 2px var(--accent-glow); }
.canvas-block-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--purple); margin-bottom: 8px; }
.canvas-block-content { font-size: 13px; color: var(--text); white-space: pre-wrap; }
.canvas-block-placeholder { font-size: 13px; color: var(--dim); font-style: italic; }

/* Priority Colors */
.priority-high { color: var(--red); } .priority-medium { color: var(--yellow); } .priority-low { color: var(--green); }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-dot.high { background: var(--red); } .priority-dot.medium { background: var(--yellow); } .priority-dot.low { background: var(--green); } .priority-dot.urgent { background: var(--purple); }

/* Pricing Cards */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 900px; margin: 0 auto; }
.pricing-card { border-radius: var(--radius); padding: 32px 24px; text-align: center; background: var(--glass); border: 1px solid var(--glass-border); transition: var(--transition); }
.pricing-card.featured { border-color: var(--purple); background: var(--accent-glow); transform: scale(1.05); }
.pricing-card .price { font-size: 40px; font-weight: 900; }
.pricing-card .period { font-size: 14px; color: var(--dim); }
.pricing-card .features { text-align: left; margin: 20px 0; }
.pricing-card .features li { padding: 8px 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pricing-card .features li::before { content: '✓'; color: var(--purple); font-weight: bold; }

/* Slider */
.slider-container { padding: 8px 0; }
.slider-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--purple); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--purple); cursor: pointer; border: none; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fade-in { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.4s ease; }

/* Stat Card */
.stat-card { text-align: center; padding: 16px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--glass-border); }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--dim); margin-top: 2px; }

/* Pro Lock Overlay */
.pro-locked { position: relative; }
.pro-locked .lock-overlay { position: absolute; inset: 0; background: rgba(10,10,15,0.85); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 5; }

/* Tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.tab { padding: 8px 16px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 500; color: var(--dim); border: 1px solid transparent; transition: var(--transition); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--gradient); color: #fff; font-weight: 600; }

/* Checklist */
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.checklist-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--glass-border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); flex-shrink: 0; margin-top: 1px; font-size: 12px; }
.checklist-check.done { background: var(--green); border-color: var(--green); color: white; }
.checklist-text { font-size: 14px; } .checklist-text.done { text-decoration: line-through; color: var(--dim); }


/* ─── Phase Progress Bar ─── */
.phase-bar { position: fixed; top: 0; right: 0; left: 260px; z-index: 30; background: var(--bg2); border-bottom: 1px solid var(--glass-border); padding: 10px 24px; }
.phase-bar-inner { max-width: 800px; margin: 0 auto; }
.phase-nodes { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 4px; }
.phase-node { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--glass-border); display: flex; align-items: center; justify-content: center; cursor: default; transition: all 0.3s; background: var(--bg); }
.phase-node-letter { font-size: 13px; font-weight: 900; color: var(--dim); }
.phase-node.completed { background: var(--cyan); border-color: var(--cyan); cursor: pointer; }
.phase-node.completed .phase-node-letter { color: #0A0A0F; }
.phase-node.current { border-color: var(--purple); box-shadow: 0 0 16px rgba(139,92,246,0.4); cursor: pointer; }
.phase-node.current .phase-node-letter { color: var(--purple); }
.phase-node.locked { opacity: 0.3; }
.phase-node.unlocked { border-color: rgba(139,92,246,0.3); cursor: pointer; }
.phase-node.unlocked:hover { border-color: var(--purple); box-shadow: 0 0 12px rgba(139,92,246,0.3); }
.phase-node.unlocked .phase-node-letter { color: var(--text); }
.phase-node.pro-gated { border-color: rgba(139,92,246,0.2); cursor: pointer; opacity: 0.6; }
.phase-node.pro-gated:hover { opacity: 0.8; }
.phase-node.pro-gated .phase-node-letter { color: var(--purple); }
.phase-connector { width: 24px; height: 2px; background: var(--glass-border); }
.phase-connector.filled { background: var(--cyan); }
.phase-bar-label { text-align: center; font-size: 11px; color: var(--dim); }
.phase-bar-label strong { color: var(--text); }

/* Adjust main content for phase bar */
.main-content { padding-top: 80px !important; }

/* Sidebar dimmed items */
.sidebar-item.dimmed { opacity: 0.4; cursor: not-allowed; }
.sidebar-item.dimmed:hover { background: transparent; color: var(--dim); }
.sidebar-phase.locked { opacity: 0.5; }

/* ─── Confetti ─── */
.confetti-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti-piece { position: absolute; top: -10px; left: var(--x); width: 8px; height: 8px; background: var(--color); border-radius: 2px; animation: confetti-fall 3s ease-out var(--delay) forwards; opacity: 0; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* Toggle */
.toggle { position: relative; width: 44px; height: 24px; background: rgba(255,255,255,0.1); border-radius: 12px; cursor: pointer; transition: 0.2s; }
.toggle.on { background: var(--green); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: 0.2s; }
.toggle.on::after { left: 23px; }

@media (max-width: 768px) {
  .phase-bar { left: 0; }
  .main-content { padding-top: 72px !important; }
  .phase-node { width: 26px; height: 26px; }
  .phase-node-letter { font-size: 11px; }
  .phase-connector { width: 12px; }
}


/* ─── AI Badge ─── */
.ai-badge { display:inline-flex;align-items:center;justify-content:center;background:var(--gradient);color:#fff;font-size:10px;font-weight:800;padding:2px 8px;border-radius:6px;letter-spacing:0.5px;text-transform:uppercase; }

/* ─── AI Loading Animation ─── */
.ai-loading { text-align:center;padding:24px; }
.ai-dots { display:inline-flex;gap:6px; }
.ai-dots span { width:8px;height:8px;border-radius:50%;background:var(--purple);animation:ai-bounce 1.4s ease-in-out infinite; }
.ai-dots span:nth-child(2) { animation-delay:0.16s; }
.ai-dots span:nth-child(3) { animation-delay:0.32s; }
@keyframes ai-bounce { 0%,80%,100%{transform:scale(0);opacity:0.3} 40%{transform:scale(1);opacity:1} }

/* ─── 4-col pricing on landing ─── */
@media(max-width:900px) {
  .pricing-grid { grid-template-columns: repeat(2,1fr) !important; max-width: 600px !important; }
}
@media(max-width:520px) {
  .pricing-grid { grid-template-columns: 1fr !important; max-width: 400px !important; }
}
