/* Onradar Dashboard Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f7f8fb;
  --card-bg: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ═══ 로그인 페이지 ═══ */
.login-body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 40px;
  align-items: start;
}

.login-box {
  background: white;
  padding: 48px 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.logo { text-align: center; margin-bottom: 36px; }
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.logo h1 { font-size: 32px; font-weight: 800; color: var(--text); }
.tagline { color: var(--text-muted); margin-top: 8px; font-size: 14px; }

.login-buttons { display: flex; flex-direction: column; gap: 12px; }

.login-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}

.kakao-btn { background: #FEE500; color: #191919; }
.kakao-btn:hover { background: #FDD835; }

.naver-btn { background: #03C75A; color: white; }
.naver-btn:hover { background: #02a04a; }

.btn-icon {
  font-size: 18px;
  font-weight: bold;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.login-footer a { color: var(--primary); }
.login-footer .beta {
  margin-top: 8px;
  font-size: 11px;
  color: #9ca3af;
}

/* 기능 소개 */
.features {
  color: white;
  padding: 30px 0;
}

.features h2 {
  font-size: 28px;
  margin-bottom: 24px;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feature {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 12px;
}

.feature .f-icon { font-size: 28px; margin-bottom: 10px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; font-weight: 700; }
.feature p { font-size: 13px; opacity: 0.9; }

@media (max-width: 768px) {
  .login-container { grid-template-columns: 1fr; }
  .features { display: none; }
}

/* ═══ 헤더 ═══ */
.header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.brand-icon { font-size: 22px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.user-name { color: var(--text-muted); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.logout-link {
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.logout-link:hover { background: var(--bg); }

/* ═══ 환영 + 통계 (개선) ═══ */
.welcome-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 28px 32px;
  border-radius: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.welcome-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.welcome-sub {
  opacity: 0.9;
  font-size: 14px;
}

.welcome-stats {
  display: flex;
  gap: 24px;
}

.stat-item {
  text-align: center;
  min-width: 80px;
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
}

/* ═══ 빠른 작업 ═══ */
.quick-actions {
  margin-bottom: 24px;
}

.section-mini-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.action-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.action-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.action-primary:hover {
  background: var(--primary-dark);
}

.action-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.action-text {
  flex: 1;
}

.action-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}

.action-desc {
  font-size: 12px;
  opacity: 0.8;
}

/* ═══ 인사이트 배너 ═══ */
.insight-banner {
  background: linear-gradient(to right, #fef3c7, #fed7aa);
  border-left: 4px solid var(--warning);
  padding: 20px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.banner-icon {
  font-size: 32px;
}

.banner-content {
  flex: 1;
}

.banner-title {
  font-weight: 700;
  font-size: 16px;
  color: #78350f;
  margin-bottom: 4px;
}

.banner-sub {
  font-size: 13px;
  color: #92400e;
}

.banner-btn {
  background: #d97706;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.banner-btn:hover {
  background: #b45309;
}

/* ═══ 필터 ═══ */
.filter-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 14px;
  cursor: pointer;
}

/* ═══ 프로젝트 카드 통계 배지 ═══ */
.project-stats {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.stat-badge {
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ═══ 기존 스타일 ═══ */

/* ═══ 메인 ═══ */
.main {
  padding: 32px 0 80px;
}

.main-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-sub {
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══ 프로젝트 섹션 ═══ */
.project-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  cursor: default;
}

.section-title .count {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  margin-left: 4px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.2s;
  position: relative;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.active-card { border-left: 4px solid var(--success); }
.candidate-card { border-left: 4px solid var(--warning); }
.paused-card { border-left: 4px solid var(--text-muted); opacity: 0.8; }
.archived-card { opacity: 0.6; }

.project-emoji {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.project-info {
  flex: 1;
  min-width: 0;
}

.project-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text);
}

.project-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}

.project-url {
  font-size: 12px;
  color: var(--primary);
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.3s;
}

.progress-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.category-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.sample-badge {
  background: var(--warning);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: middle;
}

.research-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.research-btn:hover { background: var(--primary-dark); }

.project-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* 접기 */
details summary {
  cursor: pointer;
  user-select: none;
  padding: 10px 0;
}

details[open] summary { margin-bottom: 16px; }

.collapsed-section details .project-grid {
  margin-top: 12px;
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: 12px;
  border: 2px dashed var(--border);
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.empty-state-small {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-small .hint {
  font-size: 13px;
  margin-top: 8px;
  color: var(--primary);
}

/* ═══ 버튼 ═══ */
.btn-primary {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

/* ═══ 모달 ═══ */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 28px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 { font-size: 20px; }

.modal-close {
  background: transparent;
  font-size: 20px;
  padding: 4px 10px;
  border-radius: 6px;
}

.modal-close:hover { background: var(--bg); }

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.emoji-input { width: 60px !important; font-size: 20px; text-align: center; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ═══ 프로젝트 상세 ═══ */
.back-link {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  display: inline-block;
}

.back-link:hover { color: var(--primary); }

.project-header {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  box-shadow: var(--shadow);
}

.project-header-left {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex: 1;
}

.project-header-emoji {
  font-size: 48px;
  line-height: 1;
}

.project-header h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.project-url-link {
  color: var(--primary);
  font-size: 14px;
}

.project-meta-tags {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  background: var(--bg);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.tag.status-active { background: #d1fae5; color: #047857; }
.tag.status-candidate { background: #fef3c7; color: #92400e; }

.project-header-right {
  display: flex;
  gap: 10px;
}

.status-selector {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  background: white;
}

.project-description {
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══ 탭 ═══ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 16px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ═══ 인사이트 ═══ */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.insight-card:hover { border-color: var(--primary); }

.insight-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.insight-score {
  text-align: center;
  background: var(--primary);
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  min-width: 56px;
}

.score-num {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 10px;
  opacity: 0.9;
}

.insight-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.insight-actions {
  flex-shrink: 0;
}

.bookmark-btn {
  background: transparent;
  font-size: 22px;
  padding: 4px 8px;
  border-radius: 6px;
}

.bookmark-btn.active { color: var(--warning); }

.insight-desc, .insight-implication, .insight-recommendation {
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.6;
  padding-left: 72px;
}

.insight-implication {
  background: #fef3c7;
  padding: 10px 14px 10px 72px;
  border-radius: 8px;
  margin-left: 0;
}

.insight-recommendation {
  background: #dbeafe;
  padding: 10px 14px 10px 72px;
  border-radius: 8px;
}

.insight-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-left: 72px;
}

.mini-select {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 12px;
  background: white;
}

.source-badge {
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══ 메모 ═══ */
.add-item-box {
  background: white;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.add-item-box textarea,
.add-item-box input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.memo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memo-card {
  background: white;
  padding: 16px;
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

.memo-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.memo-content {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ═══ 체크리스트 ═══ */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-item {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.checklist-item.done {
  opacity: 0.6;
  text-decoration: line-through;
}

/* ═══ AI 리서치 ═══ */
.research-box {
  background: white;
  padding: 32px;
  border-radius: 12px;
  text-align: center;
}

.research-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.research-box > p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.research-info {
  background: var(--bg);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-size: 14px;
}

.research-start-btn {
  padding: 14px 32px;
  font-size: 16px;
  margin-top: 12px;
}

.hint-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  font-style: italic;
}

/* 반응형 */
@media (max-width: 768px) {
  .page-header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .project-header { flex-direction: column; }
  .insight-desc, .insight-implication, .insight-recommendation, .insight-footer { padding-left: 0; }
}
