:root {
  /* 색상 변수 - 사이버펑크 테마 */
  --primary: #0f4c81;          /* 어두운 청색 네온 */
  --primary-hover: #1a6bab;
  --secondary: #512da8;        /* 어두운 보라색 */
  --secondary-hover: #673ab7;
  --success: #00695c;          /* 어두운 청록색 */
  --info: #0d47a1;             /* 어두운 파란색 */
  --warning: #bf360c;          /* 어두운 오렌지색 */
  --danger: #b71c1c;           /* 어두운 빨간색 */
  --light: #263238;            /* 어두운 배경에 적합한 '밝은' 색 */
  --dark: #10151a;             /* 매우 어두운 색 */
  --accent: #2f4f4f;           /* 어두운 틸 색상 */
  --accent-glow: #346566;      /* 엑센트 글로우 */

  /* 배경색 - 더 어두워진 사이버펑크 */
  --bg-primary: #0a0e14;       /* 매우 어두운 청색/검정 */
  --bg-secondary: #111921;     /* 약간 밝은 어두운 청색/검정 */
  --bg-elevated: #1a242f;      /* 더 밝은 어두운 청색/검정 */
  --bg-input: #232e3c;         /* 입력 영역용 */
  
  /* 텍스트 색상 */
  --text-primary: #c5d3e0;     /* 밝은 청백색 (순수 흰색보다 부드러움) */
  --text-secondary: #a7b6c2;   /* 약간 더 어두운 청백색 */
  --text-muted: #5a6978;       /* 흐린 청회색 */
  --text-glow: rgba(151, 197, 235, 0.15); /* 텍스트 글로우 효과 */
  
  /* 경계선 색상 */
  --border-color: #1f3449;     /* 어두운 청색 테두리 */
  --border-dark: #0f1c2a;      /* 더 어두운 테두리 */
  --border-glow: rgba(30, 77, 115, 0.4); /* 테두리 글로우 */
  
  /* 그림자 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
  --shadow-neon: 0 0 10px rgba(30, 77, 115, 0.3), 0 0 20px rgba(30, 77, 115, 0.1);
  
  /* 폰트 */
  --font-sans: 'Noto Sans KR', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-display: 'Poppins', 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* 경계 반경 */
  --border-radius-sm: 0.25rem;
  --border-radius: 0.375rem;
  --border-radius-lg: 0.5rem;
  
  /* 전환 시간 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.5s ease;
}

/* 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* 사이버펑크 애니메이션 키프레임 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes glowing {
  0% {
    box-shadow: 0 0 5px rgba(30, 77, 115, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(30, 77, 115, 0.5);
  }
  100% {
    box-shadow: 0 0 5px rgba(30, 77, 115, 0.3);
  }
}

@keyframes borderGlow {
  0% {
    border-color: var(--border-color);
  }
  50% {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(15, 76, 129, 0.4);
  }
  100% {
    border-color: var(--border-color);
  }
}

/* 앱 컨테이너 */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

/* 앱 헤더 */
.app-header {
  display: flex;
  align-items: center;
  height: 60px;
  background-color: var(--bg-secondary);
  padding: 0 1.5rem;
  box-shadow: var(--shadow), var(--shadow-neon);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 10;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--border-glow) 30%, 
    var(--border-glow) 70%, 
    transparent 100%);
}

.app-header h1 {
  flex-grow: 1;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  margin-right: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.user-menu span {
  color: var(--text-secondary);
  font-weight: 500;
}

/* 메인 컨테이너 */
.main-container {
  display: flex;
  flex: 1;
}

/* 사이드바 */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow), var(--shadow-neon);
  border-right: 1px solid var(--border-color);
  z-index: 5;
  transition: transform var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    var(--border-glow) 30%, 
    var(--border-glow) 70%, 
    transparent 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background-color: var(--bg-elevated);
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 600;
  gap: 0.75rem;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-item.active .nav-link {
  background-color: var(--primary);
  color: var(--text-primary);
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  gap: 0.75rem;
}

.nav-link:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-link i {
  width: 20px;
  text-align: center;
}

/* 콘텐츠 영역 */
.content {
  flex: 1;
  padding: 1.5rem;
  background-color: var(--bg-primary);
  overflow-y: auto;
  max-width: calc(100% - 260px);
  margin-left: 100px;
}

.content-wrapper {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 페이지 헤더 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  width: 100%;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
}

/* 카드 */
.card {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow), var(--shadow-neon);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--border-glow) 50%, 
    transparent 100%);
}

.card-header {
  background-color: var(--bg-elevated);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(30, 77, 115, 0.2);
}

.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0)
  );
  transform: rotate(45deg);
  opacity: 0.1;
  transition: transform 0.6s;
}

.btn:hover {
  opacity: 0.9;
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(15, 76, 129, 0.3);
}

.btn:hover::after {
  transform: rotate(45deg) translate(0, 100%);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(15, 76, 129, 0.3);
  animation: glowing 3s infinite;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 0 15px rgba(26, 107, 171, 0.4);
}

.btn-secondary {
  background-color: var(--secondary);
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  border-color: var(--secondary-hover);
}

.btn-success {
  background-color: var(--success);
  border-color: var(--success);
}

.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

.btn-xs {
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--border-radius-sm);
}

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 폼 요소 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: flex;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.form-row > .form-group {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  flex: 1;
}

.form-control {
  display: block;
  width: 96%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 8px rgba(15, 76, 129, 0.4);
  animation: borderGlow 2s infinite;
}

label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* 계정 목록 */
.accounts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm), var(--shadow-neon);
  width: 100%;
}

.account-item:hover {
  transform: translateY(-2px);
}

.account-info {
  flex: 1;
}

.account-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.account-token-preview {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.account-controls {
  display: flex;
  gap: 0.5rem;
}

/* 채널 목록 */
.channel-list-display {
  padding: 1rem;
  background-color: var(--bg-elevated);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  min-height: 100px;
  box-shadow: var(--shadow-sm), var(--shadow-neon);
  width: 100%;
}

/* 채널 항목 스타일 */
.channel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  width: 100%;
}

.channel-inputs {
  flex-grow: 1;
  margin-right: -15px;
}

.channel-remove {
  margin-left: auto;
}

.channel-display-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.channel-display-item {
  background-color: var(--bg-input);
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

/* 메시지 미리보기 */
.message-preview {
  background-color: var(--bg-elevated);
  white-space: pre-wrap;
  font-family: var(--font-sans);
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm), var(--shadow-neon);
  padding: 1rem;
}

/* 전송 상태 */
.status-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.status-item {
  background-color: var(--bg-elevated);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm), var(--shadow-neon);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.status-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.status-value {
  font-weight: 500;
}

/* 로그 컨테이너 */
.log-container {
  background-color: var(--bg-elevated);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  height: 300px;
  overflow-y: auto;
  padding: 0;
  box-shadow: var(--shadow-sm), var(--shadow-neon);
  width: 100%;
}

.log-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-elevated);
}

.log-header {
  display: flex;
  margin-bottom: 0.5rem;
  gap: 1rem;
  font-size: 0.875rem;
}

.log-time {
  color: var(--text-muted);
}

.log-account {
  font-weight: 500;
}

.log-status.success {
  color: var(--success);
}

.log-status.error {
  color: var(--danger);
}

.log-content {
  font-size: 0.9375rem;
}

/* 폼 액션 */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* 계정 체크박스 */
.accounts-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.account-checkbox-item {
  display: flex;
  align-items: center;
  background-color: var(--bg-elevated);
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm), var(--shadow-neon);
  width: 100%;
}

.account-checkbox-item input[type="checkbox"] {
  margin-right: 1rem;
}

.account-checkbox-label {
  font-weight: 500;
}

/* 그리드 시스템 */
.col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

/* 로그인 페이지 */

.login-container {
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  text-align: center;
}

.login-card {
  background-color: var(--bg-secondary);
  padding: 2.5rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg), var(--shadow-neon);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--border-glow) 50%, 
    transparent 100%);
}

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

.login-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.login-card h1 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.form-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.form-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.form-control {
  padding-left: 2.5rem;
}

.footer-text {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* 빈 상태 메시지 */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state p {
  margin-bottom: 1rem;
}

.empty-state i {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* 토스트 메시지 */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.875rem 1.25rem;
  color: var(--text-primary);
  font-weight: 500;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  box-shadow: var(--shadow-lg);
  font-size: 0.9375rem;
  font-family: var(--font-display);
  border: 1px solid var(--border-dark);
  background-color: var(--bg-elevated);
  border-radius: var(--border-radius);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-info {
  border-left: 3px solid var(--info);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

/* 유틸리티 클래스 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }

.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.rounded { border-radius: var(--border-radius); }
.rounded-sm { border-radius: var(--border-radius-sm); }
.rounded-circle { border-radius: 50%; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }
.mw-100 { max-width: 100%; }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* 반응형 디자인 */
@media (max-width: 992px) {
  .sidebar {
    width: 220px;
  }

  .content {
    margin-left: 220px;
    max-width: calc(100% - 220px);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 100;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
    max-width: 100%;
    padding: 1rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row > .form-group {
    max-width: 100%;
  }

  .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .app-header {
    padding: 0 1rem;
  }

  .app-header h1 {
    font-size: 1.125rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-actions {
    width: 100%;
  }
}

/* 메뉴 토글 버튼 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.25rem;
  cursor: pointer;
  margin-right: 0.75rem;
  padding: 0.25rem;
  transition: all var(--transition-fast);
}

.menu-toggle:hover {
  color: var(--primary-hover);
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
}

/* 애니메이션 */
.animate-fade-in {
  animation: fadeIn 0.3s ease-in;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

/* 알림 박스 */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-info {
  background-color: rgba(33, 150, 243, 0.1);
  border-color: rgba(33, 150, 243, 0.2);
  color: var(--info);
}

.alert-success {
  background-color: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.2);
  color: var(--success);
}

.alert-warning {
  background-color: rgba(255, 152, 0, 0.1);
  border-color: rgba(255, 152, 0, 0.2);
  color: var(--warning);
}

.alert-danger {
  background-color: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.2);
  color: var(--danger);
}

.alert i {
  margin-right: 0.5rem;
}

/* 폼 텍스트 */
.form-text {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 오류 메시지 */
.error-message {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--danger);
  padding: 0.75rem;
  border: 1px solid rgba(244, 67, 54, 0.2);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  text-align: left;
  display: none;
}

.error-message.active {
  display: block;
}

.error-message i {
  margin-right: 0.5rem;
}
