/* --- 글로벌 리셋 & 다크 테마 배경 --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
  background-color: #0b0f19; /* 깊은 흑색 배경 */
  color: #f1f5f9;
  min-height: 100vh;
}

/* --- 상단 헤더 & 화려한 네온 그라디언트 타이틀 --- */
header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 242, 254, 0.2);
}

header h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #f093fb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
  margin-bottom: 12px;
}

/* 네비게이션 링크 */
nav a {
  margin-right: 20px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #94a3b8;
  transition: all 0.2s ease;
}

nav a:hover, nav a.active {
  color: #00f2fe;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

/* --- 제목 & 보조 텍스트 --- */
h2 {
  color: #38bdf8;
  font-size: 20px;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

h3 {
  color: #e2e8f0;
  font-size: 16px;
  margin-bottom: 10px;
}

.sub {
  font-size: 13px;
  color: #64748b;
}

/* --- 카드 컴포넌트 (글래스모피즘 & 네온 테두리) --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 15px;
}

.card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(56, 189, 248, 0.05);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 242, 254, 0.6);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 242, 254, 0.2);
}

/* 실시간 소비 전력 강조 숫자 (네온 그린 글로우) */
.val {
  font-size: 36px;
  font-weight: 800;
  color: #10b981;
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  margin: 12px 0;
  font-family: monospace;
}

/* --- 입력 폼 & 버튼 --- */
input[type="text"] {
  padding: 10px 14px;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 14px;
  color: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

button {
  padding: 10px 18px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}

button:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.7);
}

button.danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

button.danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
}

/* --- 데이터 테이블 --- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 15px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  font-size: 14px;
}

th {
  background-color: #1e293b;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

td code {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* --- 알림창 (Toast/Alert) --- */
.alert-box {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background-color: rgba(6, 78, 59, 0.7);
  color: #6ee7b7;
  border: 1px solid #059669;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.alert-error {
  background-color: rgba(127, 29, 29, 0.7);
  color: #fca5a5;
  border: 1px solid #dc2626;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* --- CSV 업로드 드롭존 --- */
.upload-zone {
  border: 2px dashed rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.4);
}

/* --- 아키텍처 트리 & 뱃지 스타일 --- */
.tree-dir {
  font-weight: 700;
  margin-top: 18px;
  color: #f59e0b;
}

.tree-file {
  margin-left: 20px;
  padding: 8px 0;
  border-left: 2px solid rgba(56, 189, 248, 0.3);
  padding-left: 14px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
  margin-left: 8px;
  font-family: monospace;
}

/* --- CSV 파일 업로드 영역 다크 테마 보정 --- */
.upload-zone {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 2px dashed #0284c7 !important;
  box-shadow: inset 0 0 20px rgba(2, 132, 199, 0.1);
  padding: 24px;
}

.upload-zone h3 {
  color: #38bdf8;
  font-size: 17px;
}

.upload-zone code {
  background: #1e293b;
  color: #00f2fe;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.3);
  font-family: monospace;
}

/* 파일 선택 인풋 다크 스타일링 */
input[type="file"] {
  color: #94a3b8;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

/* 브라우저 기본 파일 선택 버튼 커스텀 */
input[type="file"]::file-selector-button {
  padding: 6px 12px;
  margin-right: 12px;
  background: #334155;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.6);
}