:root {
  --color-peach: #FFDAB9;
  --color-peach-light: rgba(255, 218, 185, 0.6);
  --color-periwinkle: #CCCCFF;
  --color-periwinkle-light: rgba(204, 204, 255, 0.6);
  --color-primary: #7879F1;
  --color-dark: #2D2D3A;
  --text-main: #333333;
  --text-muted: #666666;
  --glass-bg: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --glass-blur: 16px;
  --transition-speed: 0.3s;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.background-aurora {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 15% 50%, var(--color-peach), transparent 50%),
              radial-gradient(circle at 85% 30%, var(--color-periwinkle), transparent 50%);
  filter: blur(60px);
  z-index: -1;
  opacity: 0.8;
  animation: aurora 15s ease-in-out infinite alternate;
}

@keyframes aurora {
  0% { transform: scale(1); }
  50% { transform: scale(1.05) translate(20px, -20px); }
  100% { transform: scale(1) translate(0, 0); }
}

/* Base Utility Classes */
.hidden { display: none !important; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.w-full { width: 100%; }

/* Glassmorphism Classes */
.glass-card, .glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-card { border-radius: var(--radius-lg); padding: 32px; }
.glass-panel { border-radius: var(--radius-md); }

/* Buttons */
button {
  border: none; cursor: pointer; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 1rem; transition: all var(--transition-speed);
  padding: 12px 20px;
}
.btn-primary {
  background: linear-gradient(135deg, #8485f6, #9b9cff);
  color: white; box-shadow: 0 4px 15px rgba(120, 121, 241, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(120, 121, 241, 0.4);
}
.btn-primary:disabled {
  background: #ccc !important; color: #888 !important; box-shadow: none !important; cursor: not-allowed;
}
.btn-large { padding: 16px 24px; font-size: 1.1rem; border-radius: var(--radius-md); }

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(120, 121, 241, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(120, 121, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(120, 121, 241, 0); }
}
.btn-pulse {
  animation: pulseGlow 2s infinite;
}

/* Overlays */
.overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px); z-index: 1000;
  transition: opacity 0.5s ease;
}

.welcome-card { text-align: center; max-width: 400px; width: 90%; }
.logo-title { font-size: 2.5rem; font-weight: 800; color: var(--color-dark); margin-bottom: 8px; letter-spacing: -1px; }
.subtitle { color: var(--text-muted); margin-bottom: 32px; }
.input-group { display: flex; flex-direction: column; gap: 16px; }
.input-group input {
  padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.7); font-size: 1.1rem; text-align: center; outline: none;
}
.input-group input:focus { background: #fff; box-shadow: 0 0 0 2px var(--color-periwinkle); }

/* Main Layout */
.app-container {
  display: flex; height: 100vh; padding: 20px; gap: 20px; max-width: 1440px; margin: 0 auto;
}

/* Sidebar */
.sidebar {
  width: 260px; display: flex; flex-direction: column; padding: 24px; flex-shrink: 0;
}
.sidebar-header { margin-bottom: 30px; }
.sidebar-logo { font-size: 1.5rem; font-weight: 800; color: var(--color-dark); }
.user-greeting { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding-right: 8px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.nav-label { font-size: 0.75rem; font-weight: 700; color: #999; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 1px; }
.menu-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--text-muted);
  transition: all 0.2s;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.5); color: var(--color-dark); }
.menu-item.active { background: #fff; color: var(--color-primary); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

.sidebar-footer { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 16px; }

/* Real-time Diagnosis Box */
.realtime-diagnosis-box {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  padding: 16px; border-radius: var(--radius-md);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}
.diagnosis-title { font-size: 0.85rem; font-weight: 800; color: var(--color-primary); margin-bottom: 8px; }
.diagnosis-text { font-size: 0.85rem; color: #444; line-height: 1.4; word-break: keep-all; }

.journey-status { background: rgba(255, 255, 255, 0.6); padding: 16px; border-radius: var(--radius-md); text-align: center; }
.journey-status p { font-size: 0.9rem; margin-bottom: 12px; font-weight: 600; }
.highlight { color: var(--color-primary); font-weight: 800; font-size: 1.1rem; }

/* Main Content Area */
.main-content {
  flex: 1; display: flex; flex-direction: column; gap: 20px; overflow: hidden; min-width: 0;
}

/* Content Views */
.content-view {
  flex: 1; background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); border-radius: var(--radius-md);
  padding: 32px; overflow-y: auto; display: flex; flex-direction: column;
}
.content-view::-webkit-scrollbar { width: 8px; }
.content-view::-webkit-scrollbar-track { background: transparent; }
.content-view::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

/* Journey Section (Top) */
.journey-section { padding: 24px 32px; flex-shrink: 0; }
.journey-header h3 { font-size: 1.1rem; color: var(--color-dark); margin-bottom: 20px; }
.path-container { position: relative; height: 70px; display: flex; align-items: center; }
.journey-svg { position: absolute; top: 15px; left: 0; width: 100%; height: 40px; z-index: 1; }
.nodes-container { display: flex; justify-content: space-between; width: 100%; position: relative; z-index: 2; padding: 0 10px; }
.node-wrapper { display: flex; flex-direction: column; align-items: center; width: 30px; }
.node {
  width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--glass-border); display: flex; justify-content: center; align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.node-number { font-size: 0.75rem; font-weight: 700; color: #999; }
.node.filled {
  background: var(--color-primary); border-color: #fff; transform: scale(1.2); box-shadow: 0 4px 10px rgba(120, 121, 241, 0.4);
}
.check-icon { color: white; font-style: normal; font-weight: bold; font-size: 0.8rem; }
.node-label {
  font-size: 0.65rem; margin-top: 8px; text-align: center; color: var(--color-dark); font-weight: 600;
  white-space: nowrap; opacity: 0; transition: opacity 0.3s;
}
.node.filled + .node-label { opacity: 1; }

/* Shared Section Header */
.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 1.8rem; font-weight: 800; color: var(--color-dark); }
.section-header p { color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }

/* Programs Grid Section (View 1) */
.programs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px;
  transition: opacity 0.3s ease;
}

.program-card {
  background: rgba(255, 255, 255, 0.7); border-radius: var(--radius-md); overflow: hidden;
  cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255,255,255,0.8); display: flex; flex-direction: column;
}
.program-card:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); background: #fff; }

.card-img {
  height: 150px; background-size: cover; background-position: center; position: relative;
}
.card-tag {
  position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; color: var(--color-primary);
}
.card-content { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--color-dark); line-height: 1.3; }
.card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; font-weight: 500; }
.card-desc { font-size: 0.85rem; color: #555; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Slide-over Detail Panel */
.slide-panel {
  position: fixed; top: 20px; right: -420px; bottom: 20px; width: 400px;
  background: rgba(255, 255, 255, 0.95); z-index: 100;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}
.slide-panel.open { right: 20px; }

.btn-close {
  position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,0.1); width: 32px; height: 32px;
  border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #333; z-index: 10;
  padding: 0;
}
.btn-close:hover { background: rgba(0,0,0,0.2); }

.panel-content { flex: 1; overflow-y: auto; }
.panel-hero { height: 240px; background-size: cover; background-position: center; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.panel-body { padding: 24px; }
.panel-body .tag { display: inline-block; background: var(--color-periwinkle-light); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; color: var(--color-primary); margin-bottom: 12px; }
.panel-title { font-size: 1.6rem; font-weight: 800; color: var(--color-dark); margin-bottom: 16px; line-height: 1.3; }
.panel-meta-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.meta-item { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; color: #555; }
.divider { height: 1px; background: rgba(0,0,0,0.08); margin: 24px 0; }
.desc-title { font-size: 1.1rem; margin-bottom: 12px; color: var(--color-dark); }
.panel-desc { font-size: 1rem; line-height: 1.6; color: #444; }

.panel-footer { padding: 20px 24px; background: #fff; border-top: 1px solid rgba(0,0,0,0.05); border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* --- Curation View (View 2) --- */
.curation-container {
  display: flex; flex-direction: column; gap: 24px;
}
.curation-card {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden; border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.curation-header {
  padding: 20px 24px; color: white;
}
.theme-relax { background: linear-gradient(135deg, #A8B8D8, #8698C2); }
.theme-find { background: linear-gradient(135deg, #D4A5A5, #C08D8D); }
.theme-active { background: linear-gradient(135deg, #F6B98F, #E59F6F); }
.curation-header h3 { font-size: 1.2rem; font-weight: 800; }

.curation-body { padding: 24px; }
.curation-desc { font-size: 0.95rem; color: #555; margin-bottom: 20px; line-height: 1.5; }
.curation-steps { display: flex; flex-direction: column; gap: 12px; }
.step-item {
  background: rgba(255,255,255,0.8); padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.95rem; color: var(--color-dark); font-weight: 600;
  display: flex; align-items: center; gap: 12px;
}
.step-num { 
  background: var(--color-primary); color: white; padding: 4px 8px; border-radius: 6px; 
  font-size: 0.75rem; font-weight: bold;
}

/* --- Diary & Mentoring (Calendar) View (View 3) --- */
.diary-layout {
  display: flex; gap: 24px; height: 100%; min-height: 500px;
}

/* Calendar Styling */
.calendar-container {
  width: 400px; background: rgba(255,255,255,0.6); border-radius: var(--radius-md); padding: 20px;
  display: flex; flex-direction: column; border: 1px solid var(--glass-border); flex-shrink: 0;
}
.calendar-title { font-size: 1.1rem; font-weight: 800; color: var(--color-dark); margin-bottom: 16px; }
.calendar-grid { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; flex: 1; padding-right: 4px; }
.calendar-grid::-webkit-scrollbar { width: 4px; }
.calendar-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.week-row {
  background: #fff; border-radius: var(--radius-sm); padding: 12px; border: 1px solid rgba(0,0,0,0.05);
}
.week-title { font-size: 0.85rem; font-weight: 700; color: var(--color-primary); margin-bottom: 8px; }
.days-container { display: flex; gap: 8px; }

.day-cell {
  flex: 1; background: #f8f9fa; border-radius: 6px; padding: 8px; text-align: center; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s; min-height: 60px; display: flex; flex-direction: column; justify-content: center;
}
.day-cell:hover { background: #f1f3f5; border-color: rgba(0,0,0,0.1); }
.day-cell.filled { background: var(--color-peach-light); border-color: var(--color-peach); }
.day-cell.active { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.day-num { font-size: 0.7rem; color: #777; margin-bottom: 4px; }
.day-label { font-size: 0.75rem; font-weight: 700; color: var(--color-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-status { font-size: 0.65rem; color: var(--color-primary); margin-top: 4px; }

.empty-state { text-align: center; padding: 40px 20px; color: #888; font-size: 0.9rem; line-height: 1.5; }

/* Editor Area */
.diary-editor-container {
  flex: 1; background: rgba(255,255,255,0.8); border-radius: var(--radius-md); padding: 32px;
  display: flex; flex-direction: column; border: 1px solid var(--glass-border); overflow-y: auto;
}
.editor-header { margin-bottom: 24px; }
.editor-header .tag { display: inline-block; background: var(--color-periwinkle-light); padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: 700; color: var(--color-primary); margin-bottom: 12px; }
.editor-header h3 { font-size: 1.6rem; color: var(--color-dark); font-weight: 800; }

.editor-body { flex: 1; display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.editor-body textarea {
  flex: 1; min-height: 200px; padding: 20px; border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.1); resize: none; font-size: 1.05rem; line-height: 1.6;
  background: #fdfdfd; outline: none; transition: border-color 0.3s;
}
.editor-body textarea:focus { border-color: var(--color-primary); }

.mentor-feedback-area {
  background: linear-gradient(to right, rgba(120, 121, 241, 0.05), rgba(155, 156, 255, 0.1));
  border-left: 4px solid var(--color-primary);
  padding: 24px; border-radius: 0 var(--radius-md) var(--radius-md) 0;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.mentor-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.mentor-avatar { width: 44px; height: 44px; background: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.3rem; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.mentor-header h4 { font-size: 1.1rem; color: var(--color-dark); font-weight: 700; }
.mentor-time { font-size: 0.85rem; color: #777; }
.mentor-message { font-size: 1rem; color: #444; line-height: 1.6; }


/* Expanded Boarding Pass Result View */
#result-view { display: flex; justify-content: center; align-items: center; }
.boarding-pass-container.expanded {
  width: 100%; max-width: 900px; padding: 0; background: transparent; border: none; box-shadow: none;
}
.btn-close-absolute { position: absolute; top: -40px; right: 0; background: #fff; border-radius: 50%; width: 36px; height: 36px; display: flex; justify-content: center; align-items: center; z-index: 10; border: none; cursor: pointer; }

.boarding-pass.flex-row {
  display: flex; background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15); position: relative;
}

/* Ticket Notches */
.boarding-pass.flex-row::before, .boarding-pass.flex-row::after {
  content: ''; position: absolute; top: -15px; width: 30px; height: 30px; background: rgba(0,0,0,0.3); border-radius: 50%; z-index: 2; box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}
.boarding-pass.flex-row::before { left: 450px; }
.boarding-pass.flex-row::after { left: 450px; top: auto; bottom: -15px; }

.pass-left {
  flex: 1; padding: 40px; background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  display: flex; flex-direction: column;
}
.pass-right {
  width: 380px; padding: 32px; background: #fff;
  display: flex; flex-direction: column;
}
.pass-divider-vertical {
  width: 2px; background-image: linear-gradient(to bottom, #ccc 50%, transparent 50%);
  background-size: 100% 12px; margin-left: -1px; z-index: 1;
}

.text-left { text-align: left !important; }
.text-center { text-align: center; }

.pass-logo { font-size: 0.8rem; font-weight: 800; color: var(--color-primary); letter-spacing: 3px; margin-bottom: 12px; }
.pass-title { font-size: 2rem; font-weight: 900; color: var(--color-dark); letter-spacing: 1px; margin-bottom: 8px; }
.pass-subtitle { font-size: 1rem; color: var(--text-muted); }

/* Stats */
.pass-stats { margin: 32px 0; background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.stat-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stat-item:last-child { margin-bottom: 0; }
.stat-label { width: 40px; font-size: 0.85rem; font-weight: 700; color: #555; }
.stat-bar-bg { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.stat-bar { height: 100%; background: var(--color-primary); width: 0%; transition: width 1s ease; }
.stat-val { width: 35px; font-size: 0.8rem; font-weight: 800; color: var(--color-dark); text-align: right; }

/* Letter */
.pass-letter { background: rgba(255,255,255,0.6); padding: 24px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.05); flex: 1; }
.pass-letter h4 { font-size: 1.1rem; color: var(--color-dark); margin-bottom: 12px; }
.pass-letter p { font-size: 0.95rem; line-height: 1.6; color: #444; word-break: keep-all; }

/* Mini List for Ticket */
.mini-list { max-height: 350px; padding-right: 10px; }
.mini-list .pass-item { margin-bottom: 12px; border-bottom: 1px dashed #eee; padding-bottom: 12px; }
.mini-list .pass-item:last-child { border: none; margin-bottom: 0; padding-bottom: 0; }
.mini-list .pass-index { font-size: 0.9rem; color: var(--color-primary); }
.mini-list .pass-item-title { font-size: 0.9rem; margin-bottom: 2px; }
.mini-list .pass-item-meta { font-size: 0.75rem; }
.mini-list .pass-item-tag { font-size: 0.65rem; padding: 2px 6px; }

.pass-footer { padding-top: 24px; text-align: center; margin-top: auto; }
.pass-message { font-weight: 700; font-size: 1.1rem; color: var(--color-dark); margin-bottom: 16px; }
.barcode { font-family: monospace; font-size: 2.5rem; color: #333; letter-spacing: -2px; transform: scaleY(1.5); display: inline-block; }

.result-actions { margin-top: 24px; }


/* Responsive */
@media (max-width: 1024px) {
  .app-container { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 16px; height: auto; gap: 20px; flex-wrap: wrap; }
  .sidebar-header { margin-bottom: 0; }
  .sidebar-nav { flex: 1; display: flex; align-items: center; gap: 12px; overflow-x: auto; }
  .nav-label { display: none; }
  .menu-list { flex-direction: row; flex-wrap: wrap; }
  .sidebar-footer { width: 100%; padding-top: 0; }
  .slide-panel { right: -100%; width: 100%; top: 0; bottom: 0; border-radius: 0; }
  .slide-panel.open { right: 0; }
  .diary-layout { flex-direction: column; }
  .calendar-container { width: 100%; max-height: 250px; }
  .boarding-pass.flex-row { flex-direction: column; }
  .boarding-pass.flex-row::before, .boarding-pass.flex-row::after { display: none; }
  .pass-divider-vertical { width: 100%; height: 2px; background-image: linear-gradient(to right, #ccc 50%, transparent 50%); background-size: 12px 100%; margin: 0; }
  .pass-right { width: 100%; }
}
