:root {
  color-scheme: light;
}

body {
  margin: 0;
  background-color: #f4f5f7;
  color: #333;
  font-family: sans-serif;
}

#app-container {
  padding-top: 60px;
  /* 톱바 높이 */
}

#main-wrapper {
  display: flex;
}

.main {
  margin-left: 200px;
  /* 사이드바 너비 */
  padding: 24px;
  width: 100%;
  transition: margin-left 0.3s ease-in-out;
}

.main-container {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem;
}

body.sidebar-collapsed .main {
  margin-left: 0;
}

/* --- 탭 스타일 --- */
.tabs-nav-container {
  margin-bottom: 2rem;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid #E5E7EB;
}

.tab-link {
  padding-bottom: 15px;
  margin-right: 2rem;
  text-decoration: none;
  font-size: 1rem;
  color: #6B7280;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease-in-out, border-color 0.15s ease-in-out;
  white-space: nowrap;
}

.tab-link:hover {
  color: #374151;
}

.tab-link.active-tab {
  color: #2563EB;
  border-bottom-color: #2563EB;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.order-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Space between cards */
}

.order-item-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.order-item-card:hover {
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.order-number-group .order-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2e66ff;
  /* Blue color for order number */
  margin: 0;
}

.order-number-group .order-date {
  font-size: 0.85rem;
  color: #9ca3af;
  margin: 4px 0 0 0;
}

.order-meta .order-status {
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
  margin-bottom: 4px;
}

/* Status colors */
.order-status.pending {
  color: #fe2020;
}

/* Orange for pending */
.order-status.paid {
  color: #10b981;
}

/* Green for paid */
.order-status.other {
  color: #6b7280;
}

/* Gray for others */

.order-meta .order-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  text-align: right;
  white-space: nowrap;
}

.order-body {
  display: flex;
  gap: 16px;
  /* Space between image and details */
}

.order-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #f0f0f0;
  /* Placeholder color */
  flex-shrink: 0;
}

.order-details {
  flex-grow: 1;
}

.order-details .vehicle-name-display {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px dashed #373737;
}

.order-details .parts-list {
  list-style: none;
  /* Remove default bullet points */
  padding: 0;
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  color: #374151;
}

.order-details .parts-list li {
  margin-bottom: 4px;
}

.order-details .parts-list li:last-child {
  margin-bottom: 0;
}

.depositor-info {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 4px 0 4px 0;
}

.depositor-info strong {
  color: #2e66ff;
  font-weight: 600;
  font-size: 1rem;
}

/* Status specific borders */
.order-item-card.status-pending {
  border-left: 4px solid #fe2020;
}

.order-item-card.status-paid {
  border-left: 4px solid #10b981;
}

.order-item-card.status-other {
  border-left: 4px solid #6b7280;
}


.no-orders-message {
  text-align: center;
  padding: 60px;
  color: #6b7280;
  background-color: #f3f4f6;
  border-radius: 12px;
  margin-top: 1rem;
}

/* Scroll Top Button (Keep existing styles) */
#scrollTopBtn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1000;
  background-color: #2563EB;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#scrollTopBtn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scrollTopBtn:hover {
  background-color: #1d4ed8;
}

/* 로딩 스피너 */
#loadingOverlay {
  position: fixed;
  /* 화면 전체를 기준으로 위치를 잡음 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(71 71 71 / 70%);
  /* 살짝 반투명한 흰색 배경 */
  display: flex;
  /* 내부 스피너를 중앙 정렬하기 위함 */
  justify-content: center;
  align-items: center;
  z-index: 999999999999;
  /* 다른 모든 요소들보다 위에 보이도록 설정 (가장 중요!) */
}

/* 스피너 애니메이션 (기존에 없다면 추가) */
.spinner {
  border: 5px solid #ffffff;
  /* Light grey */
  border-top: 5px solid #005ccd;
  /* Blue */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.4s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


/* 섬네일 스켈레톤 */
.order-item-image.skeleton {
  background-color: #e0e4e9;
  background-image: none !important;
  position: relative;
  overflow: hidden;
  display: block;
  visibility: hidden;
}

/* 스켈레톤 반짝이는 효과를 위한 가상 요소 */
.order-item-image.skeleton::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  z-index: 1;
  visibility: visible;
  background: linear-gradient(90deg,
      transparent,
      rgba(184, 184, 184, 0.8),
      transparent);
  animation: shimmer 0.5s infinite;
}

/* 반짝이는 효과 애니메이션 정의 */
@keyframes shimmer {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(200%);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #app-container {
    padding-top: 45px;
  }

  .main {
    margin-left: 0;
    padding: 0;
  }

  .main-container {
    padding: 1.2rem;
  }

  .tabs-nav-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 1rem;
  }

  .tabs-nav-container::-webkit-scrollbar {
    display: none;
  }

  .tab-link {
    margin-right: 1.5rem;
    font-size: 0.95rem;
  }

  .order-item-card {
    padding: 15px;
  }

  .order-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .order-number-group .order-number {
    font-size: 1rem;
  }

  .order-meta .order-total {
    font-size: 1rem;
  }

  .order-body {
    gap: 12px;
  }

  .order-item-image {
    width: 60px;
    height: 60px;
  }

  .order-details .parts-list {
    font-size: 0.9rem;
  }

  .depositor-info {
    font-size: 0.85rem;
    margin: 0;
  }

  #scrollTopBtn {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }

  #scrollTopBtn svg {
    width: 20px;
    height: 20px;
  }

  .order-details .vehicle-name-display {
    font-size: 0.80rem;
  }

  .order-details .parts-list {
    margin: 0 0 2px 0;
  }
}