/* RXAI Admin - TailAdmin 스타일 커스텀 CSS */

/* ============================================
   전역 스타일
   ============================================ */

/* 폰트 설정 */
body {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Content Area 첫 번째 요소(header)를 상단에 붙이기 */
.relative.flex.flex-1.flex-col {
  margin: 0;
  padding: 0;
}

.relative.flex.flex-1.flex-col > *:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* Navbar - 사이드바 로고 영역과 정확히 같은 높이 */
header.sticky {
  margin: 0;
  padding: 0;
}

/* Navbar 내부 div - 사이드바 sidebar-logo의 py-8과 정확히 동일 */
header.sticky > div {
  padding-top: 2rem; /* py-8 = 2rem = 32px */
  padding-bottom: 1rem;
  display: flex;
  align-items: center;
  min-height: 0;
}

/* Navbar 제목 - 사이드바 로고 텍스트와 같은 높이 */
header.sticky h1 {
  line-height: 1.5;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

/* 사이드바 로고 영역의 첫 번째 div와 같은 높이 */
.sidebar-logo > div:first-child {
  display: flex;
  align-items: center;
}

/* lg 이상에서 사이드바 py-10과 정확히 동일 */
@media (min-width: 1024px) {
  header.sticky > div {
    padding-top: 2.5rem; /* lg:py-10 = 2.5rem = 40px */
  }
}

/* ============================================
   사이드바 스타일
   ============================================ */
.sidebar {
  background: linear-gradient(180deg, #1c2434 0%, #24303f 100%);
}

.sidebar-logo {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav a {
  transition: background 0.2s ease;
  box-shadow: none !important;
}

.sidebar-nav a:hover {
  background: rgba(124, 150, 255, 0.12);
  color: #8fa3ff;
  box-shadow: none !important;
}

.sidebar-nav a.active {
  background: rgba(124, 150, 255, 0.2);
  color: #8fa3ff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  box-shadow: none !important;
}

.sidebar-nav a.active:hover {
  background: rgba(124, 150, 255, 0.25);
  color: #8fa3ff;
  box-shadow: none !important;
}

.sidebar-nav svg {
  transition: none;
}

.sidebar-nav a:hover svg {
  color: #8fa3ff;
}

.sidebar-nav a.active svg {
  color: #8fa3ff;
}

.sidebar-nav a.active:hover svg {
  color: #8fa3ff;
}

/* ============================================
   헤더 스타일
   ============================================ */
.header {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
}

/* ============================================
   카드 스타일
   ============================================ */
.card {
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.card-body {
  padding: 1.5rem;
}

/* ============================================
   버튼 스타일
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #7c96ff 0%, #6a87ff 100%);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(124, 150, 255, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6a87ff 0%, #5875ff 100%);
  box-shadow: 0 4px 12px rgba(124, 150, 255, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #64748b;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.25);
}

.btn-secondary:hover {
  background: #334155;
  box-shadow: 0 4px 10px rgba(100, 116, 139, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #047857;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
}

.btn-outline:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

/* ============================================
   폼 스타일
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: #8fa3ff;
  box-shadow: 0 0 0 4px rgba(143, 163, 255, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* ============================================
   테이블 스타일
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.table thead {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.table thead th {
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.05em;
}

.table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s ease;
}

.table tbody tr:hover {
  background: #f9fafb;
}

.table tbody td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #1f2937;
}

/* ============================================
   뱃지 스타일
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  border-radius: 9999px;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* 검색 노출 배지 및 토글 세부 스타일링 (우선순위 높음) */
.search-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: 0.5rem !important;
  padding: 0.15rem 0.5rem !important;
  font-size: 0.75rem !important;
  line-height: 1 !important;
  border-radius: 0.5rem !important;
}
.search-badge span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  flex: 0 0 auto;
}
.board-search-toggle + div {
  /* ensure toggle knob is vertically centered */
  vertical-align: middle;
}
.table tbody td .flex.items-center { align-items: center; }


/* ============================================
   알림 스타일
   ============================================ */
.alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
}

.alert-success {
  background: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-error {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* 전역 알림(#globalAlert) 닫기버튼과 텍스트 겹침 방지 */
#globalAlert {
  padding-right: 3.5rem !important; /* 닫기 버튼 영역 확보 */
  min-width: 260px;
}
#globalAlert button {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  background: transparent !important;
  border: none !important;
  padding: 0.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#globalAlert svg { width: 1rem; height: 1rem; }

/* ============================================
   페이지네이션 스타일
   ============================================ */
.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  transition: all 0.2s ease;
}

.pagination a:hover {
  background: #f8f9ff;
  border-color: #8fa3ff;
  color: #8fa3ff;
}

.pagination .active {
  background: linear-gradient(135deg, #8fa3ff 0%, #7c96ff 100%);
  border-color: #8fa3ff;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(143, 163, 255, 0.3);
}

/* ============================================
   모달 스타일
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ============================================
   통계 카드 스타일
   ============================================ */
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.success {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.warning {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.info {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-card-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ============================================
   차트 컨테이너
   ============================================ */
.chart-container {
  position: relative;
  height: 350px;
  padding: 1rem;
}

/* ============================================
   반응형
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .table-container {
    border: none;
  }
  
  .table thead {
    display: none;
  }
  
  .table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
  }
  
  .table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .table tbody td:last-child {
    border-bottom: none;
  }
  
  .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #6b7280;
  }
}

/* ============================================
   유틸리티 클래스
   ============================================ */
.text-primary {
  color: #8fa3ff;
}

.text-success {
  color: #10b981;
}

.text-warning {
  color: #f59e0b;
}

.text-danger {
  color: #ef4444;
}

.bg-primary {
  background: linear-gradient(135deg, #7c96ff 0%, #6a87ff 100%);
  box-shadow: 0 2px 6px rgba(124, 150, 255, 0.3);
  transition: all 0.3s ease;
}

.bg-primary:hover {
  background: linear-gradient(135deg, #6a87ff 0%, #5875ff 100%);
  box-shadow: 0 4px 10px rgba(124, 150, 255, 0.4);
  transform: translateY(-1px);
}

.hover\:bg-opacity-90:hover {
  opacity: 1 !important;
}

.bg-success {
  background-color: #10b981;
}

.bg-warning {
  background-color: #f59e0b;
}

.bg-danger {
  background-color: #ef4444;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(168, 185, 255, 0.08);
}

.shadow {
  box-shadow: 0 3px 8px rgba(168, 185, 255, 0.12);
}

/* 여백 개선 */
.rounded-lg {
  border-radius: 12px !important;
}

.rounded-md {
  border-radius: 8px !important;
}

/* 버튼 여백 */
button, .btn, a.btn {
  padding: 0.625rem 1.25rem !important;
  margin: 0.25rem !important;
}

/* 카드 여백 */
.bg-white {
  padding: 1.5rem !important;
}

/* 테이블 셀 여백 */
td, th {
  padding: 1rem 1.25rem !important;
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
