/* 강진군귀농인협의회 통합 시스템 디자인 시스템 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-dark: #064e3b;
  --primary-light: #ecfdf5;
  --primary-subtle: #d1fae5;
  
  --secondary: #0ea5e9;
  --secondary-light: #e0f2fe;

  --accent-kakao: #fee500;
  --accent-kakao-text: #191919;
  --accent-naver: #03c75a;
  --accent-google: #ea4335;

  --dark-bg: #0f172a;
  --card-bg: #ffffff;
  --surface-alt: #f8fafc;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: #f1f5f9;
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

/* 상단 데모 퀵 스위처 바 */
.demo-role-bar {
  background: #1e293b;
  color: #f8fafc;
  padding: 8px 16px;
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.demo-role-bar .badge-label {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.75rem;
}
.demo-switch-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.demo-btn {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.demo-btn:hover {
  background: #475569;
  color: #ffffff;
}
.demo-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

/* 메인 헤더 내비게이션 */
.main-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 37px;
  z-index: 900;
  transition: box-shadow 0.2s;
}
.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}
.logo-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: #334155;
  font-weight: 600;
  font-size: 0.925rem;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover {
  color: var(--primary-dark);
  background: var(--primary-light);
}
.nav-link.active {
  color: #064e3b;
  background: var(--primary-light);
  font-weight: 700;
}
.nav-badge {
  background: #f43f5e;
  color: white;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  cursor: pointer;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
}
.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.user-role-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.role-admin { background: #fee2e2; color: #b91c1c; }
.role-branch { background: #fef3c7; color: #b45309; }
.role-club { background: #e0e7ff; color: #4338ca; }
.role-member { background: #d1fae5; color: #065f46; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}
.btn-outline {
  background: white;
  color: #334155;
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  background: var(--surface-alt);
  border-color: #cbd5e1;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}
.btn-kakao-link {
  background: #fee500;
  color: #191919;
  border: 1px solid #ebd300;
}
.btn-kakao-link:hover {
  background: #fada0a;
}

/* 메인 컨테이너 */
.main-wrapper {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 80px;
  flex: 1;
}

/* 홈 히어로 배너 */
.hero-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 60%, #047857 100%);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin-bottom: 32px;
}
.hero-banner::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.8px;
}
.hero-desc {
  font-size: 1.05rem;
  color: #d1fae5;
  max-width: 650px;
  margin-bottom: 28px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* 대시보드 그리드 & 카드 */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-3 { grid-column: span 3; }

@media (max-width: 1024px) {
  .col-8, .col-4, .col-6, .col-3 {
    grid-column: span 12;
  }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body {
  padding: 24px;
}

/* 통계 카드 */
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.amber { background: #fef3c7; color: #d97706; }

.stat-info .stat-label {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.stat-info .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
}
.stat-info .stat-sub {
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 600;
}

/* 행사 카드 그리드 */
.events-grid, .clubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.event-card, .club-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.event-card:hover, .club-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-media {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: #cbd5e1;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.event-card:hover .card-media img, .club-card:hover .card-media img {
  transform: scale(1.05);
}
.event-type-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.event-fee-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #10b981;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-title-lg {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  line-height: 1.4;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.meta-item svg, .meta-item i {
  color: var(--primary);
}
.card-desc {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.5;
  margin: 12px 0 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer-action {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  gap: 8px;
}

/* 모달 레이아웃 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* SNS 로그인 버튼들 */
.sns-login-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sns-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.sns-btn-kakao {
  background: var(--accent-kakao);
  color: var(--accent-kakao-text);
}
.sns-btn-kakao:hover {
  background: #f7df00;
}
.sns-btn-naver {
  background: var(--accent-naver);
  color: white;
}
.sns-btn-naver:hover {
  background: #02b350;
}
.sns-btn-google {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}
.sns-btn-google:hover {
  background: #f9fafb;
}

/* 폼 스타일링 */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}
.form-label .req {
  color: #ef4444;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.form-helper {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 테이블 스타일링 (ERP 및 회원관리) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: #1e293b;
  vertical-align: middle;
}
.data-table tr:hover td {
  background-color: #f1f5f9;
}

/* 탭 바 */
.sub-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  padding-bottom: 0;
}
.sub-tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #64748b;
  font-weight: 600;
  font-size: 0.925rem;
  cursor: pointer;
  transition: all 0.2s;
}
.sub-tab-btn:hover {
  color: var(--primary);
}
.sub-tab-btn.active {
  color: #064e3b;
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* 토스트 메시지 */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}
.toast.success { background: #065f46; border-left: 4px solid #34d399; }
.toast.error { background: #881337; border-left: 4px solid #fb7185; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 반응형 모바일 조정 */
@media (max-width: 768px) {
  .header-container {
    height: 60px;
  }
  .nav-links {
    display: none; /* 모바일 메뉴 토글 */
  }
  .hero-banner {
    padding: 32px 20px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .demo-role-bar {
    font-size: 0.725rem;
  }
}
