/* ==========================================
   선거 캠페인 올인원 관리 - 스타일시트
   ========================================== */

/* 기본 스크롤바 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* 페이드 인 애니메이션 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 20px 5px rgba(59, 130, 246, 0.15); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-in { animation: slideInRight 0.3s ease-out; }
.pulse-glow { animation: pulse-glow 2s infinite; }

/* 카드 호버 효과 */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* 메인 카드 그라디언트 */
.card-strategy { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.card-policy { background: linear-gradient(135deg, #065f46 0%, #10b981 100%); }
.card-promotion { background: linear-gradient(135deg, #9333ea 0%, #c084fc 100%); }
.card-complaint { background: linear-gradient(135deg, #c2410c 0%, #fb923c 100%); }
.card-speech { background: linear-gradient(135deg, #be185d 0%, #f472b6 100%); }
.card-voter { background: linear-gradient(135deg, #0e7490 0%, #22d3ee 100%); }

/* 서브 카드 */
.sub-card {
  transition: all 0.2s ease;
  border: 2px solid transparent;
}
.sub-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.sub-card.active {
  border-color: #2563eb;
  background: #dbeafe;
}

/* 마크다운 결과 영역 */
.markdown-body h1 { font-size: 1.5rem; font-weight: 700; margin: 1rem 0 0.5rem; color: #1e3a8a; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.5rem; }
.markdown-body h2 { font-size: 1.25rem; font-weight: 600; margin: 1rem 0 0.5rem; color: #1e40af; }
.markdown-body h3 { font-size: 1.1rem; font-weight: 600; margin: 0.75rem 0 0.25rem; color: #374151; }
.markdown-body p { margin: 0.5rem 0; line-height: 1.75; color: #374151; }
.markdown-body ul { list-style-type: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
.markdown-body ol { list-style-type: decimal; padding-left: 1.5rem; margin: 0.5rem 0; }
.markdown-body li { margin: 0.25rem 0; line-height: 1.6; }
.markdown-body strong { color: #1e3a8a; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.markdown-body th { background: #1e3a8a; color: white; padding: 0.75rem; text-align: left; }
.markdown-body td { padding: 0.75rem; border-bottom: 1px solid #e2e8f0; }
.markdown-body tr:hover td { background: #f8fafc; }
.markdown-body blockquote { border-left: 4px solid #3b82f6; padding: 0.75rem 1rem; margin: 0.75rem 0; background: #eff6ff; border-radius: 0 0.5rem 0.5rem 0; }
.markdown-body code { background: #f1f5f9; padding: 0.15rem 0.4rem; border-radius: 0.25rem; font-size: 0.875rem; color: #e11d48; }
.markdown-body pre { background: #1e293b; color: #e2e8f0; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin: 0.75rem 0; }
.markdown-body pre code { background: none; color: inherit; padding: 0; }
.markdown-body hr { border: none; border-top: 2px solid #e2e8f0; margin: 1.5rem 0; }

/* 로딩 스피너 */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 토스트 알림 */
.toast {
  animation: fadeIn 0.3s ease-out;
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  padding: 1rem 1.5rem; border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  font-weight: 500;
}
.toast-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.toast-error { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.toast-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* 입력 필드 포커스 */
input:focus, textarea:focus, select:focus {
  outline: none;
  ring: 2px;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 버튼 기본 */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: #374151;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid #d1d5db;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
}

/* 탭 네비게이션 */
.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #6b7280;
}
.tab-btn:hover { background: #f3f4f6; color: #374151; }
.tab-btn.active { background: #2563eb; color: white; }

/* 사이드바 */
.sidebar-item {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #e2e8f0;
  font-weight: 500;
}
.sidebar-item:hover { background: rgba(255,255,255,0.1); }
.sidebar-item.active { background: rgba(255,255,255,0.2); border-left: 3px solid white; }

/* 반응형 */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; z-index: 50; left: 0; top: 0; width: 280px; height: 100vh; }
  .main-content { margin-left: 0 !important; }
}

/* 인쇄 스타일 */
@media print {
  .no-print { display: none !important; }
  .markdown-body { max-width: 100%; }
  body { background: white; }
}
