@charset "UTF-8";
/* ==========================================================================
   TJEdu 서버Git 버전관리 대시보드 스타일시트
   - 테마: 딥 다크 & 퍼플 바이올렛(Purple Violet) 액센트 [롤백 테스트 3단계: v0.12]
   - 반응형 디자인 & 순수 CSS3
   ========================================================================== */

:root {
  --bg-primary: #0f0a1a;
  --bg-secondary: #181128;
  --bg-card: rgba(24, 17, 40, 0.88);
  --bg-card-hover: rgba(36, 26, 60, 0.92);
  --bg-elevated: #261b40;
  --bg-input: #120c20;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(139, 92, 246, 0.65);
  --border-highlight: rgba(139, 92, 246, 0.4);

  --text-main: #fcfcfd;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  /* 메인 컬러: 퍼플 바이올렛 계열 */
  --accent-yellow: #8b5cf6;
  --accent-yellow-bright: #a78bfa;
  --accent-yellow-hover: #7c3aed;
  --accent-yellow-light: #ddd6fe;
  --accent-yellow-bg: rgba(139, 92, 246, 0.15);
  --accent-yellow-border: rgba(139, 92, 246, 0.35);

  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-rose-hover: #e11d48;
  --accent-cyan: #06b6d4;

  --diff-add-bg: rgba(139, 92, 246, 0.15);
  --diff-add-text: #a78bfa;
  --diff-del-bg: rgba(244, 63, 94, 0.15);
  --diff-del-text: #fb7185;
  --diff-header-bg: rgba(139, 92, 246, 0.15);
  --diff-header-text: #ddd6fe;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.25);

  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.13) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(167, 139, 250, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   공통 컨테이너 및 헤더
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  flex: 1;
}

/* 상단 글로벌 내비게이션 바 */
.navbar {
  background: rgba(18, 21, 29, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 24px;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #a78bfa, #8b5cf6, #6d28d9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.brand-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--accent-yellow-bg);
  color: #a78bfa;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid var(--accent-yellow-border);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   버튼 스타일 (퍼플/바이올렛 메인)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 메인 퍼플 바이올렛 버튼 */
.btn-primary, .btn-emerald {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #2e1065;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
  border: 1px solid rgba(139, 92, 246, 0.6);
}
.btn-primary:hover, .btn-emerald:hover {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-outline-danger {
  background: transparent;
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.35);
}
.btn-outline-danger:hover {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   로그인 뷰
   ========================================================================== */
.login-view {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  text-align: center;
}

.login-card-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 179, 8, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.login-notice {
  margin-top: 18px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: #fde68a;
  text-align: left;
  line-height: 1.5;
}

/* ==========================================================================
   대시보드 메인 레이아웃
   ========================================================================== */
.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
}

/* 상태 바 카드 */
.status-bar-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.status-info-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.status-item {
  display: flex;
  flex-direction: column;
}

.status-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 2px;
}

.status-value {
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-yellow);
  box-shadow: 0 0 8px var(--accent-yellow);
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 섹션 타이틀 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.version-counter {
  font-size: 0.75rem;
  background: var(--accent-yellow-bg);
  border: 1px solid var(--accent-yellow-border);
  padding: 3px 8px;
  border-radius: 9999px;
  color: #fbbf24;
  font-weight: 600;
}

/* ==========================================================================
   버전 카드 및 아코디언 스타일 (노란색 테마)
   ========================================================================== */
.version-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.version-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.version-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* 현재 적용 중인 활성 버전 카드 (CURRENT ACTIVE) */
.version-card.current-active {
  border-color: var(--accent-yellow) !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(20, 23, 32, 0.95) 100%) !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.28), var(--shadow-md);
}

/* 롤백으로 인해 현재 미적용된 미래 버전 카드 (FUTURE INACTIVE - 비파괴 보존) */
.version-card.future-inactive {
  opacity: 0.58;
  filter: grayscale(0.45);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(14, 17, 24, 0.65);
}

.version-card.future-inactive:hover {
  opacity: 0.95;
  filter: grayscale(0);
  border-color: rgba(245, 158, 11, 0.4);
}

.future-inactive-banner {
  background: rgba(245, 158, 11, 0.06);
  border-left: 3px solid #f59e0b;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: #d4d4d8;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.current-pill {
  font-size: 0.625rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #2e1065;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rollback-badge-pill {
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 1px 7px;
  border-radius: 9999px;
}

.inactive-pill {
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1px 7px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

/* 롤백 활성 상태 상단 안내 배너 */
.rollback-alert-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: fadeIn 0.3s ease;
}

.rollback-alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: #fef08a;
}

.version-card.latest-version {
  border-color: var(--border-highlight);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, rgba(20, 23, 32, 0.9) 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}

/* 카드 상단 헤더 (클릭 시 토글) */
.version-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 16px;
}

.version-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.version-tag-badge {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-yellow-bg);
  color: #fbbf24;
  border: 1px solid var(--accent-yellow-border);
  white-space: nowrap;
}

.version-card.latest-version .version-tag-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 179, 8, 0.35));
  color: #fef08a;
  border-color: rgba(245, 158, 11, 0.6);
}

.version-title-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.version-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.latest-pill {
  font-size: 0.625rem;
  font-weight: 800;
  background: var(--accent-yellow);
  color: #1e1b07;
  padding: 1px 7px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.version-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
}

.version-hash {
  font-family: var(--font-mono);
  color: #fbbf24;
}

.version-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-chevron {
  font-size: 0.875rem;
  color: var(--text-dim);
  transition: transform 0.25s ease;
  margin-left: 6px;
}

.version-card.expanded .accordion-chevron {
  transform: rotate(180deg);
  color: #fbbf24;
}

/* 카드 아코디언 바디 (상세 내용) */
.version-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  background: rgba(14, 16, 23, 0.7);
  border-top: 1px solid transparent;
}

.version-card.expanded .version-body {
  max-height: 1200px;
  opacity: 1;
  border-top-color: var(--border-color);
  padding: 20px;
}

.version-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .version-detail-grid {
    grid-template-columns: 3fr 2fr;
  }
}

.detail-block-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fbbf24;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 작업 목록 (Tasks List) */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  position: relative;
  padding-left: 20px;
  font-size: 0.875rem;
  color: #e4e4e7;
  line-height: 1.5;
}

.task-item::before {
  content: "•";
  position: absolute;
  left: 6px;
  top: 0;
  color: var(--accent-yellow);
  font-size: 1.25rem;
  line-height: 1.2;
}

.task-empty {
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 6px 0;
}

/* 변경된 파일 목록 태그 */
.files-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: #e4e4e7;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.file-chip.file-php { border-left: 3px solid #777bb4; }
.file-chip.file-js { border-left: 3px solid #f59e0b; }
.file-chip.file-css { border-left: 3px solid #38bdf8; }
.file-chip.file-html { border-left: 3px solid #f97316; }

/* ==========================================
   모달 팝업 공통
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(245, 158, 11, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-window {
  transform: translateY(0) scale(1);
}

.modal-window.modal-lg {
  max-width: 900px;
  height: 85vh;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fbbf24;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

/* Diff 미리보기 모달 전용 뷰어 */
.diff-viewer {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: #090a0f;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.55;
  color: #e4e4e7;
}

.diff-line-header {
  color: var(--diff-header-text);
  background: var(--diff-header-bg);
  padding: 2px 4px;
  display: block;
}

.diff-line-add {
  color: var(--diff-add-text);
  background: var(--diff-add-bg);
  display: block;
}

.diff-line-del {
  color: var(--diff-del-text);
  background: var(--diff-del-bg);
  display: block;
}

/* 토스트 알림 */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-main);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease-out forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-yellow);
}

.toast.toast-error {
  border-left: 4px solid var(--accent-rose);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 반응형 유틸리티 */
@media (max-width: 640px) {
  .navbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .version-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .version-header-right {
    width: 100%;
    justify-content: flex-end;
    margin-top: 10px;
  }
}
