/* 어드민 페이지 스타일 */

:root {
  --primary-color: #dc3545;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
}

/* 네비게이션 */
.navbar-brand {
  font-weight: bold;
  font-size: 1.3rem;
}

.navbar-brand i {
  margin-right: 0.5rem;
}

/* 컨텐츠 섹션 */
.content-section {
  animation: fadeIn 0.3s ease-in;
}

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

/* 카드 스타일 */
.card {
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

/* 통계 카드 */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info {
  background: linear-gradient(135deg, var(--primary-color) 0%, #c82333 100%);
}

.card.bg-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
}

.card.bg-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
}

.card.bg-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
}

/* 시스템 상태 */
.system-status .status-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

.system-status .status-item:last-child {
  border-bottom: none;
}

/* 활동 로그 */
.activity-item {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.activity-item:hover {
  background-color: #f8f9fa;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.2rem;
}

.activity-icon.create {
  background-color: #d4edda;
  color: #155724;
}

.activity-icon.update {
  background-color: #d1ecf1;
  color: #0c5460;
}

.activity-icon.delete {
  background-color: #f8d7da;
  color: #721c24;
}

.activity-icon.login {
  background-color: #fff3cd;
  color: #856404;
}

/* 테이블 스타일 */
.table {
  margin-bottom: 0;
}

.table th {
  border-top: none;
  font-weight: 600;
  color: var(--dark-color);
  background-color: #f8f9fa;
}

.table td {
  vertical-align: middle;
}

.table-responsive {
  border-radius: 8px;
}

/* 상태 배지 */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}

.status-active {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-inactive {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-pending {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* 권한 체크박스 */
.form-check {
  margin-bottom: 0.5rem;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* 버튼 스타일 */
.btn-sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.btn-group .btn {
  margin-right: 0.25rem;
}

.btn-group .btn:last-child {
  margin-right: 0;
}

/* 모달 스타일 */
.modal-header {
  background-color: var(--primary-color);
  color: white;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* 차트 컨테이너 */
.chart-container {
  position: relative;
  height: 300px;
}

/* 로딩 상태 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--secondary-color);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* 액션 버튼 */
.action-buttons {
  display: flex;
  gap: 0.25rem;
}

.action-buttons .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* 필터 섹션 */
.filter-section {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 통계 아이콘 */
.stat-icon {
  opacity: 0.8;
}

/* 로그 레벨 배지 */
.log-level {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.log-level.info {
  background-color: #d1ecf1;
  color: #0c5460;
}

.log-level.warning {
  background-color: #fff3cd;
  color: #856404;
}

.log-level.error {
  background-color: #f8d7da;
  color: #721c24;
}

.log-level.success {
  background-color: #d4edda;
  color: #155724;
}

/* 리포트 카드 */
.report-card {
  border-left: 4px solid var(--primary-color);
}

.report-card .card-header {
  background-color: rgba(220, 53, 69, 0.1);
}

/* 인기 상품 순위 */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: bold;
  color: white;
}

.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
}

.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: #333;
}

.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #daa520);
}

.rank-other {
  background-color: var(--secondary-color);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons .btn {
    margin-bottom: 0.25rem;
  }
  
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .filter-section {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .table-responsive {
    font-size: 0.8rem;
  }
  
  .btn-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .activity-item {
    padding: 0.75rem;
  }
  
  .activity-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
}

/* 프린트 스타일 */
@media print {
  .navbar,
  .modal-footer,
  .btn,
  .action-buttons,
  .filter-section {
    display: none !important;
  }
  
  .container-fluid {
    padding: 0;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
    break-inside: avoid;
  }
  
  .table {
    font-size: 12px;
  }
  
  .content-section {
    page-break-inside: avoid;
  }
}

/* 다크 모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #e9ecef;
  }
  
  .card {
    background-color: #2d3748;
    color: #e9ecef;
  }
  
  .card-header {
    background-color: #374151;
    border-bottom-color: #4a5568;
  }
  
  .table {
    color: #e9ecef;
  }
  
  .table th {
    background-color: #374151;
    color: #e9ecef;
  }
  
  .modal-content {
    background-color: #2d3748;
    color: #e9ecef;
  }
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 애니메이션 */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

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

/* 포커스 스타일 */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 툴팁 스타일 */
.tooltip {
  font-size: 0.8rem;
}

.tooltip-inner {
  background-color: var(--dark-color);
  border-radius: 4px;
}

/* Office 스타일 상품 카드 */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

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

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}

.product-header.expanded {
    border-bottom: 1px solid #f1f3f5;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f3f5;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #191f28;
}

.product-category {
    font-size: 13px;
    color: #8b95a1;
}

.product-price {
    background: #e7f5ff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #1c7ed6;
}

.component-count {
    background: #f1f3f5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-actions .btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.product-details {
    display: none;
    padding: 16px 20px;
    background: #f8f9fa;
}

.product-details.show {
    display: block;
}

.component-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
}

.component-row:last-child {
    margin-bottom: 0;
}

.component-name {
    font-weight: 500;
    color: #191f28;
}

.component-qty {
    font-size: 13px;
    color: #6b7684;
}

.component-free {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #e8f5e9;
    color: #2e7d32;
}

.search-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #191f28;
    margin-bottom: 0;
}

.status-active { 
    color: #2e7d32; 
    font-weight: 500;
}

.status-inactive { 
    color: #c62828;
    font-weight: 500;
}
