/* LeadFlow 프리미엄 라이트 모드 디자인 시스템 CSS */

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

:root {
  /* 색상 토큰 (Harmonious Light Mode Palette) */
  --primary: #4f46e5;          /* 로열 인디고 블루 */
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --secondary: #0ea5e9;        /* 생생한 스카이 블루 */
  
  --bg-primary: #f8fafc;       /* 맑은 연슬레이트 배경 */
  --bg-secondary: #ffffff;
  
  /* 글래스모피즘 플레이트 */
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.65);
  
  /* 텍스트 챠콜 계열 */
  --text-main: #0f172a;        /* 딥 슬레이트 */
  --text-muted: #475569;       /* 클래식 차콜 */
  --text-light: #94a3b8;       /* 라이트 챠콜 */
  
  --border-color: rgba(226, 232, 240, 0.8);
  --success: #10b981;          /* 비비드 민트 그린 */
  --success-light: #d1fae5;
  --danger: #ef4444;           /* 부드러운 로즈 레드 */
  
  /* 기하 토큰 */
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* 부드러운 하이 엔드 그림자 */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 30px -10px rgba(79, 70, 229, 0.08);
  --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.05);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
}

/* 기본 리셋 & 폰트 매핑 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

h1, h2, h3, h4, .brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* 스크롤바 커스텀 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 70, 229, 0.3);
}

/* 전체 백그라운드 오라(Aura) 장식 데코 */
.bg-aura {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, rgba(14, 165, 233, 0.02) 60%, transparent 100%);
  border-radius: 50%;
  top: -200px;
  right: -200px;
  z-index: -1;
  pointer-events: none;
}

.bg-aura-left {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.03) 0%, rgba(79, 70, 229, 0.01) 50%, transparent 100%);
  border-radius: 50%;
  bottom: -100px;
  left: -200px;
  z-index: -1;
  pointer-events: none;
}

/* 사이드바 레이아웃 */
.sidebar {
  width: 280px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3.5rem;
  padding-left: 0.5rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.nav-item a:hover {
  background-color: rgba(79, 70, 229, 0.04);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-item.active a {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.avatar {
  width: 38px;
  height: 38px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-company {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem;
  width: 100%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.logout-btn:hover {
  background-color: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

/* 메인 콘텐츠 레이아웃 */
.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1300px;
}

.page-header {
  margin-bottom: 2.5rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.page-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* 글래스 카드 모던 컴포넌트 */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-glass), var(--shadow-md);
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glass), var(--shadow-lg);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 통계 메트릭 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background-color: var(--primary-light);
  color: var(--primary);
}

.stat-card:nth-child(2) .stat-icon {
  background-color: #e0f2fe;
  color: #0284c7;
}
.stat-card:nth-child(3) .stat-icon {
  background-color: #d1fae5;
  color: #059669;
}
.stat-card:nth-child(4) .stat-icon {
  background-color: #fef3c7;
  color: #d97706;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

/* 폼 스타일링 */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

/* 버튼 컴포넌트 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background-color: var(--bg-primary);
  color: var(--text-main);
}

/* 깔끔한 미적 테이블 */
.table-container {
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
}

.custom-table td {
  padding: 1.15rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.custom-table tr:hover td {
  background-color: rgba(79, 70, 229, 0.01);
}

/* 배지 컴포넌트 */
.badge {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
}

.badge-new {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-replied {
  background-color: var(--success-light);
  color: var(--success);
}

.badge-contacted {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* 얼럿 알림 */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.alert-success {
  background-color: var(--success-light);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 로그인 / 회원가입 전용 세련된 화면 */
.auth-wrapper {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-glass), var(--shadow-lg);
  z-index: 10;
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo {
  margin: 0 auto 1rem auto;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* 수집 지역/키워드 선택 그리드 */
.scrape-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 1rem;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .sidebar {
    width: 80px;
    padding: 2rem 0.5rem;
  }
  .brand-name, .user-info, .sidebar-footer span {
    display: none;
  }
  .main-content {
    margin-left: 80px;
    padding: 2rem;
  }
  .scrape-controls {
    grid-template-columns: 1fr;
  }
}
