/* ===================================
   AI워크코치 - 글로벌 스타일
   =================================== */

/* CSS Variables */
:root {
  --primary: #7C3AED;
  --primary-dark: #6D28D9;
  --primary-light: #A78BFA;
  --accent: #3B82F6;
  --accent-dark: #2563EB;
  --gradient: linear-gradient(135deg, #7C3AED 0%, #3B82F6 100%);
  --gradient-hover: linear-gradient(135deg, #6D28D9 0%, #2563EB 100%);
  --bg: #F9FAFB;
  --bg-white: #FFFFFF;
  --text: #1F2937;
  --text-sub: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --transition: all 0.2s ease;
  --max-w: 1280px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* Container */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ===== Navigation ===== */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 0;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.navbar-brand .logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}
.navbar-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-sub);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--primary);
  background: rgba(124,58,237,0.06);
}
.navbar-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.5rem; color: var(--text);
  cursor: pointer; padding: 0.5rem;
}

/* ===== Hero Section ===== */
.hero {
  background: var(--gradient);
  color: white;
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 60%);
}
.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  position: relative;
}
.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}
.btn-primary:hover {
  background: var(--gradient-hover);
  box-shadow: 0 6px 20px rgba(124,58,237,0.45);
  color: white;
}

.btn-white {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow);
}
.btn-white:hover {
  background: #F9FAFB;
  color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  padding: 0.5rem 1rem;
}
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }

.btn:disabled, .btn.disabled {
  opacity: 0.5; cursor: not-allowed; transform: none !important;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 1.5rem; }

/* ===== Section ===== */
.section { padding: 4rem 0; }
.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
}
.section-desc {
  text-align: center;
  color: var(--text-sub);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* ===== Grid ===== */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Form ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text);
  transition: var(--transition);
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-input.error, .form-textarea.error, .form-select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.25rem; display: none; }
.form-error.show { display: block; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.badge-free { background: var(--success-bg); color: #059669; }
.badge-freemium { background: var(--warning-bg); color: #D97706; }
.badge-paid { background: var(--danger-bg); color: #DC2626; }
.badge-beginner { background: var(--info-bg); color: #2563EB; }
.badge-intermediate { background: #FDF4FF; color: #9333EA; }
.badge-advanced { background: var(--danger-bg); color: #DC2626; }
.badge-category {
  background: rgba(124,58,237,0.08);
  color: var(--primary);
}
.badge-status-pending { background: var(--warning-bg); color: #D97706; }
.badge-status-analyzing { background: var(--info-bg); color: #2563EB; }
.badge-status-completed { background: var(--success-bg); color: #059669; }
.badge-status-failed { background: var(--danger-bg); color: #DC2626; }

/* ===== Alert ===== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.alert-info { background: var(--info-bg); color: #1D4ED8; border: 1px solid #BFDBFE; }
.alert-success { background: var(--success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.alert-warning { background: var(--warning-bg); color: #92400E; border: 1px solid #FDE68A; }
.alert-danger { background: var(--danger-bg); color: #991B1B; border: 1px solid #FECACA; }

/* ===== Loading ===== */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 1.5rem;
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-steps { text-align: center; }
.loading-step {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: var(--transition);
}
.loading-step.active { color: var(--primary); font-weight: 600; }
.loading-step.done { color: var(--success); }
.loading-step.done::before { content: '✓ '; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none; border: none;
  font-size: 1.25rem; color: var(--text-sub);
  cursor: pointer; padding: 0.25rem;
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; gap: 0.75rem;
  justify-content: flex-end;
}

/* ===== Footer ===== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}
.footer-brand {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.footer-info { margin-bottom: 0.25rem; }
.footer-copy { margin-top: 1rem; font-size: 0.8rem; opacity: 0.6; }

/* ===== Stars ===== */
.stars { color: var(--warning); font-size: 0.85rem; }
.stars .empty { color: var(--border); }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-sub);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
}
.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
th {
  background: var(--border-light);
  font-weight: 600;
  color: var(--text-sub);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tr:hover { background: rgba(124,58,237,0.02); }

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-sub { color: var(--text-sub); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.25rem; }
.fw-bold { font-weight: 700; }
.fw-semi { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.relative { position: relative; }

/* ===== Filter Buttons ===== */
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: white;
  color: var(--text-sub);
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ===== Search Bar ===== */
.search-bar {
  position: relative;
  margin-bottom: 1.5rem;
}
.search-bar i {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}
.search-bar input {
  padding-left: 2.75rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-sub);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state p { font-size: 1rem; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-nav.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
    box-shadow: var(--shadow-md);
  }
  .navbar-toggle { display: block; }
  
  .hero { padding: 3rem 0; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  
  .section { padding: 2.5rem 0; }
  .section-title { font-size: 1.5rem; }
  
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  
  .btn-lg { padding: 0.85rem 1.75rem; font-size: 0.95rem; }
  
  .modal { margin: 0.5rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .filter-group { gap: 0.35rem; }
  .filter-btn { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
}
