@import url(https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@2.0/nanumsquare.css);

body {
  font-family: 'NanumSquare', sans-serif !important;
  font-size: 0.9rem !important;
}

/* Toastr 커스텀 스타일 - 화이트 테마 */
.toast-success,
.toast-error,
.toast-info,
.toast-warning {
  background-color: white !important;
  color: #333 !important;
  border-left: 4px solid !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  border-radius: 12px !important;
  padding: 16px !important;
}

.toast-success {
  border-color: #00b894 !important;
}

.toast-error {
  border-color: #ff7675 !important;
}

.toast-info {
  border-color: #74b9ff !important;
}

.toast-warning {
  border-color: #fdcb6e !important;
}

/* 토스트 메시지 컨테이너 스타일 */
#toast-container>div {
  padding: 15px 15px 15px 50px !important;
  width: 300px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #333 !important;
  margin: 0 12px 12px !important;
}

/* 아이콘 색상 조정 */
.toast-success .toast-message:before {
  color: #00b894 !important;
}

.toast-error .toast-message:before {
  color: #ff7675 !important;
}

.toast-info .toast-message:before {
  color: #74b9ff !important;
}

.toast-warning .toast-message:before {
  color: #fdcb6e !important;
}

/* 프로그레스 바 스타일 */
.toast-progress {
  height: 3px !important;
  bottom: 0 !important;
  opacity: 0.8 !important;
}

.toast-success .toast-progress {
  background-color: #00b894 !important;
}

.toast-error .toast-progress {
  background-color: #ff7675 !important;
}

.toast-info .toast-progress {
  background-color: #74b9ff !important;
}

.toast-warning .toast-progress {
  background-color: #fdcb6e !important;
}

/* 애니메이션 효과 */
.toast {
  transition: all 0.3s ease-in-out !important;
}

/* SweetAlert2 모바일 친화적 스타일 */
.swal2-popup {
  font-size: 0.9rem !important;
  border-radius: 15px !important;
}

.swal2-title {
  font-size: 1.3rem !important;
  font-weight: 600 !important;
}

.swal2-content {
  font-size: 1rem !important;
}

.swal2-confirm,
.swal2-cancel {
  font-size: 0.9rem !important;
  padding: 0.5rem 1.5rem !important;
  border-radius: 25px !important;
  font-weight: 500 !important;
}

/* 모바일에서의 추가 조정 */
@media (max-width: 768px) {
  .swal2-popup {
    width: 85% !important;
    font-size: 0.8rem !important;
  }

  .swal2-title {
    font-size: 1.1rem !important;
  }

  .swal2-content {
    font-size: 0.9rem !important;
  }

  .swal2-confirm,
  .swal2-cancel {
    font-size: 0.8rem !important;
    padding: 0.4rem 1.2rem !important;
  }
}

/* SweetAlert2 버튼 색상 커스터마이징 */
.swal2-confirm {
  background-color: #4CAF50 !important;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3) !important;
}

.swal2-confirm:hover {
  background-color: #43A047 !important;
}

.swal2-cancel {
  background-color: #f44336 !important;
  box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3) !important;
}

.swal2-cancel:hover {
  background-color: #e53935 !important;
}

/* 버튼 호버 효과 */
.swal2-confirm,
.swal2-cancel {
  transition: all 0.2s ease-in-out !important;
}

.swal2-confirm:hover,
.swal2-cancel:hover {
  transform: translateY(-1px) !important;
}

/* 모달 공통 스타일 */
/*
.modal {
  z-index: 9999999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  overflow-y: auto !important;
}

.modal-dialog {
  position: relative !important;
  width: 90% !important;
  max-width: 800px !important;
  margin: 1.75rem auto !important;
  z-index: 10000000 !important;
  max-height: 90vh !important;
}

.modal-content {
  position: relative !important;
  width: 100% !important;
  background: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2) !important;
  z-index: 10000001 !important;
  resize: both !important;
  overflow: auto !important;
  min-width: 300px !important;
  min-height: 200px !important;
  max-height: calc(90vh - 3.5rem) !important;
}

.modal-body {
  overflow-y: auto !important;
  max-height: calc(90vh - 12rem) !important;
}

.modal.show {
  display: flex !important;
}

body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

.modal-backdrop {
  display: none !important;
}

.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.modal .btn,
.modal input,
.modal select,
.modal textarea {
  pointer-events: auto !important;
}

.modal {
  pointer-events: all !important;
}

.modal .form-control {
  font-size: 1.2rem;
  height: auto;
  padding: 0.8rem;
}

.modal label {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.modal .modal-title {
  font-size: 1.8rem;
  font-weight: bold;
}

.modal .form-group {
  margin-bottom: 1.5rem;
}

.modal .modal-body {
  padding: 2rem;
}

.modal .row {
  margin-bottom: 1rem;
}

.modal .form-control[readonly] {
  background-color: #f8f9fa;
  border: 2px solid #dee2e6;
}

.editable {
  background-color: #fff !important;
  border: 1px solid #80bdff !important;
}

.editable:focus {
  border-color: #80bdff !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25) !important;
}

@media screen and (display-mode: standalone) {
  .modal-dialog {
    margin-bottom: calc(56px + 48px) !important;
  }

  .modal-content {
    max-height: calc(90vh - 56px - 48px) !important;
  }

  .modal-body {
    max-height: calc(90vh - 12rem - 56px - 48px) !important;
  }
}

@supports (-webkit-appearance:none) and (not (overflow:-webkit-marquee)) and (not (-ms-ime-align:auto)) {
  .modal-dialog {
    margin-bottom: 48px !important;
  }

  .modal-content {
    max-height: calc(90vh - 48px) !important;
  }

  .modal-body {
    max-height: calc(90vh - 12rem - 48px) !important;
  }
}

@supports (-webkit-touch-callout: none) {
  .modal-dialog {
    margin-top: calc(1.75rem + env(safe-area-inset-top)) !important;
    margin-bottom: env(safe-area-inset-bottom) !important;
  }

  .modal-content {
    max-height: calc(90vh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 768px) {
  .modal-dialog {
    width: 95% !important;
    margin: 10px auto !important;
  }

  .modal-body {
    padding: 1rem !important;
  }

  .modal .form-control {
    font-size: 1rem;
    padding: 0.6rem;
  }

  .modal label {
    font-size: 1.1rem;
  }

  .modal .modal-title {
    font-size: 1.4rem;
  }
}

.modal-content::after {
  content: '';
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 15px !important;
  height: 15px !important;
  cursor: se-resize !important;
  background: linear-gradient(135deg, transparent 50%, #ccc 50%) !important;
}

.modal-content.resizing {
  user-select: none !important;
}
*/

/* 모바일 네비게이션 크기 조정 */
.mobile-nav {
  font-size: 0.9rem !important;
}

/* 아이폰 Safe Area 대응 - 모바일 네비게이션 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: calc(0px + env(safe-area-inset-bottom)) !important;
  }
}

.mobile-nav .row {
  height: 100% !important;
}

.mobile-nav .col {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 4px 0 !important;
}

.mobile-nav .mdi {
  font-size: 1.2rem !important;
  line-height: 1 !important;
  margin-bottom: 2px !important;
}

.mobile-nav .small {
  font-size: 0.65rem !important;
  line-height: 1 !important;
}

/* 스크롤바 스타일만 커스텀 */
.tui-grid-body-area::-webkit-scrollbar {
  display: block !important;
  width: 10px !important;
}

/* 로딩 오버레이 스타일 */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* 아이폰 Safe Area 대응 - 로딩 오버레이 */
@supports (padding-top: env(safe-area-inset-top)) {
  .loading-overlay {
    top: env(safe-area-inset-top);
    bottom: env(safe-area-inset-bottom);
    left: env(safe-area-inset-left);
    right: env(safe-area-inset-right);
    width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right));
    height: calc(100% - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3a8ffe;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 10px;
  color: #333;
  font-size: 14px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* PWA 설치 버튼 */
.pwa-install-button.hidden {
  display: none;
}

#installPWA {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  padding: 12px 24px 12px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: #2c3e50;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: bounce 2s infinite;
}

/* 아이폰 Safe Area 대응 - PWA 설치 버튼 */
@supports (padding-top: env(safe-area-inset-top)) {
  #installPWA {
    top: calc(20px + env(safe-area-inset-top));
  }
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  40% {
    transform: translateX(-50%) translateY(-10px);
  }

  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

#installPWA:hover {
  animation: none;
  transform: translateX(-50%) scale(1.05);
}

@media (max-width: 768px) {
  #installPWA {
    top: 15px;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 12px;
  }

  #installPWA img {
    width: 20px;
    height: 20px;
  }

  /* 아이폰 Safe Area 대응 - 모바일 PWA 설치 버튼 */
  @supports (padding-top: env(safe-area-inset-top)) {
    #installPWA {
      top: calc(15px + env(safe-area-inset-top));
    }
  }
}

/* 우측 플로팅 배너 */
.floating-banner {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1040;
  padding: 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #2c3e50;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.85;
  cursor: move;
  user-select: none;
  touch-action: none;
  width: fit-content;
  height: fit-content;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 아이폰 Safe Area 대응 - 플로팅 배너 */
@supports (padding-right: env(safe-area-inset-right)) {
  .floating-banner {
    right: calc(20px + env(safe-area-inset-right));
  }
}

.floating-banner.dragging {
  opacity: 0.95;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  cursor: grabbing;
}

.banner-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.banner-item.image-only {
  width: 48px;
  height: 48px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.banner-item.image-only img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-item .tooltip {
  visibility: hidden;
  width: 120px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.banner-item:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.mobile-menu-toggle {
  display: flex !important;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  z-index: 1;
  margin-bottom: 0;
  /* 마지막 아이템이므로 마진 제거 */
}

.mobile-menu-toggle i {
  font-size: 24px;
  color: #2c3e50;
}

.floating-banner .banner-item.image-only:not(.mobile-menu-toggle) {
  height: 0;
  width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.floating-banner.active .banner-item.image-only:not(.mobile-menu-toggle) {
  height: 40px;
  width: 40px;
  margin-bottom: 8px;
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .floating-banner {
    right: 15px;
    bottom: 75px;
    /* 모바일 네비게이션 위에 위치 */
    top: auto;
    transform: none;
    /* transform 초기화 */
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    cursor: default;
    /* 모바일에서는 드래그 기능 사용 안함 */
  }

  .mobile-menu-toggle {
    margin-bottom: 0;
  }

  /* 아이폰 Safe Area 대응 - 모바일 플로팅 배너 */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .floating-banner {
      right: calc(15px + env(safe-area-inset-right));
      bottom: calc(75px + env(safe-area-inset-bottom));
    }
  }
}

/* Sidebar User Profile */
.sidebar .nav .user-profile-item a.nav-link {
  padding: 10px 15px;
}

.sidebar .user-profile {
  display: flex;
  align-items: center;
  width: 100%;
  margin-left: -4px;
}

.sidebar .user-profile .profile-image {
  flex-shrink: 0;
  margin-right: 15px;
}

.sidebar .user-profile .profile-image img,
.sidebar .user-profile .profile-image .initials {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar .user-profile .profile-image .initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e14eca;
  color: #fff;
  font-weight: bold;
}

.sidebar .user-profile .profile-info {
  flex-grow: 1;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar .user-profile .user-name {
  font-size: 14px;
  font-weight: 500;
}

.sidebar .user-profile .user-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Minimized sidebar styles */
.sidebar-mini .sidebar .user-profile .profile-info {
  display: none;
}

.sidebar-mini .sidebar .user-profile .profile-image {
  margin-right: 0;
}

.sidebar-mini .sidebar:hover .user-profile .profile-info {
  display: block;
}

.sidebar-mini .sidebar:hover .user-profile .profile-image {
  margin-right: 15px;
}

/* 하위 메뉴 리스트 마커 제거 */
.sidebar .nav .submenu {
  list-style: none !important;
  padding-left: 0 !important;
}

/* sidebar-mini 호버 시 하위 메뉴 아이콘 표시 */
.sidebar-mini .sidebar:hover .nav .submenu .sidebar-mini-icon {
  opacity: 1;
  transform: translateZ(0);
}

.tui-grid-cell.bg-total-count {
  background-color: #9ebadd !important;
  color: #000 !important;
  font-weight: bold;
}

.tui-grid-content-area {
  font-family: 'NanumSquare', sans-serif !important;
}