/**
 * 고객센터 솔루션 공통 CSS
 * AdminLTE 커스터마이징 및 추가 스타일
 * 작성일: 2025-09-04
 */

/* 한글 폰트 설정 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

body {
  font-family: 'Noto Sans KR', 'Source Sans Pro', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* 사이드바 스타일 커스터마이징 */
.main-sidebar {
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
  color: #c2c7d0;
  font-weight: 400;
  transition: all 0.3s ease;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background-color: #007bff;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* 브랜드 로고 영역 */
.brand-link {
  background: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-text {
  color: #ffffff !important;
  font-weight: 500;
}

/* 콘텐츠 래퍼 스타일 */
.content-wrapper {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: calc(100vh - 57px);
}

/* 테이블 스타일 */
.table {
  background: white;
  /* border-radius: 8px; */
  overflow: hidden;
}

.table thead th {
  /* background: #f8f9fa; */
  /* border: none; */
  font-weight: 600;
  color: #495057;
  padding: 0.5rem 0.75rem;
}

.table tbody td {
  border-top: 1px solid #f1f3f4;
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* IVR 에디터 전용 스타일 */
.ivr-component {
  margin: 8px;
  padding: 12px;
  border-radius: 10px;
  cursor: grab;
  transition: all 0.3s ease;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
}

.ivr-component:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.ivr-component:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.ivr-component-placed {
  background: white;
  border: 2px solid #007bff;
  border-radius: 12px;
  padding: 15px;
  min-width: 100px;
  min-height: 80px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.ivr-component-placed:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.ivr-component-placed.selected {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

#ivr-canvas {
  background: linear-gradient(45deg, #f0f2f5 25%, transparent 25%), 
              linear-gradient(-45deg, #f0f2f5 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f0f2f5 75%), 
              linear-gradient(-45deg, transparent 75%, #f0f2f5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  position: relative;
}

/* 모니터링 위젯 스타일 */
.monitor-widget {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.monitor-widget:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 진행률 바 스타일 */
.progress {
  height: 8px;
  border-radius: 10px;
  background-color: #e9ecef;
  overflow: hidden;
}

.progress-bar {
  border-radius: 10px;
  transition: width 0.6s ease;
}

/* 알림 및 토스트 스타일 */
.alert {
  border: none;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
}

.alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #74b9ff 100%);
  color: #0c5460;
}

.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #00b894 100%);
  color: #155724;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #e17055 100%);
  color: #721c24;
}

/* 모달 스타일 - 심플한 기본 스타일 */
.modal-content {
  border: none;
  box-shadow: none;
}

.modal-header {
  background: none;
  color: inherit;
  border-bottom: 1px solid #e9ecef;
  border-radius: 0;
}

.modal-title {
  color: inherit;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  border-radius: 0;
}

/* 로딩 오버레이 */
#global-loading {
  backdrop-filter: blur(5px);
}

.loading-message {
  font-size: 1.1rem;
  font-weight: 500;
}

/* 네비게이션 바 스타일 */
.main-header.navbar {
  background: white;
  border-bottom: 1px solid #e3e6f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.navbar-badge {
  font-size: 0.7rem;
  font-weight: 600;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
  .content-wrapper {
    margin-left: 0;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .small-box .icon {
    font-size: 50px;
    top: 10px;
    right: 10px;
  }
  
  .table-responsive {
    border-radius: 8px;
  }
  
  .ivr-component {
    margin: 5px;
    padding: 8px;
    font-size: 12px;
  }
}

@media (max-width: 576px) {
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }
  
  .table th, .table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
}

/* 다크모드 지원 (추후 구현용) */
@media (prefers-color-scheme: dark) {
  /* 다크모드 스타일은 추후 구현 예정 */
}

/* 애니메이션 효과 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

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

.updating {
  animation: pulse 1s ease-in-out infinite;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 상태 표시 아이콘 */
.status-online {
  color: #28a745;
}

.status-busy {
  color: #ffc107;
}

.status-offline {
  color: #6c757d;
}

.status-away {
  color: #fd7e14;
}

/* 우선순위 표시 */
.priority-high {
  color: #dc3545;
  font-weight: 600;
}

.priority-medium {
  color: #ffc107;
  font-weight: 500;
}

.priority-low {
  color: #28a745;
  font-weight: 400;
}

/* ============================
   통화 컨트롤 시스템 스타일 
   (index_ie.php에서 이동) - 2025-09-11
   ============================ */

/* 통화 컨트롤 및 상담원 상태 버튼 스타일 */
.btn-control {
  font-size: 12px;
  padding: 5px 10px;
  height: 30px;
  line-height: 1.2;
  border-radius: 4px !important;
  border-width: 1px;
  font-weight: 500;
  min-width: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* btn-group 내 모든 버튼 모서리 동일하게 */
.btn-group .btn-control:first-child,
.btn-group .btn-control:last-child,
.btn-group .btn-control:not(:first-child):not(:last-child) {
  border-radius: 4px !important;
}

.btn-control i {
  font-size: 11px;
  margin-right: 3px;
}

.btn-control:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}

.btn-control:active {
  transform: translateY(0);
}

/* 상담원 상태 버튼 특별 스타일 */
.agent-status-btn.active {
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 상담중 버튼 배경색을 더 밝게 조정 */
.btn-control.btn-warning.active {
  background-color: #ffeb3b !important;
  border-color: #ffc107 !important;
  color: #212529 !important;
}

/* 네비게이션 바 버튼 컨테이너 중앙 정렬 */
.navbar-nav.mr-auto {
  display: flex;
  align-items: center;
  height: 100%;
}

.navbar-nav.mr-auto .btn-group {
  display: flex;
  align-items: center;
}

/* ============================
   착신 및 통화 애니메이션
   ============================ */

/* 착신 팝업 애니메이션 */
@keyframes ring {
  0%, 20%, 50%, 80%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-10deg); }
  30% { transform: rotate(10deg); }
  60% { transform: rotate(-5deg); }
  90% { transform: rotate(5deg); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.fa-bounce {
  animation: bounce 2s infinite;
}

/* 통화 상태 펄스 애니메이션 (기존 pulse와 다른 용도) */
@keyframes call-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================
   IE 모드 전용 스타일
   ============================ */

.call-status-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.call-control-btn {
  padding: 12px 24px;
  margin: 5px;
  border-radius: 25px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  min-width: 120px;
}

.call-control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.status-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
  animation: call-pulse 2s infinite;
}

.activex-info {
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 15px;
  margin: 15px 0;
}

/* ============================
   통화 로그 시스템
   ============================ */

.call-log {
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
}

.log-entry {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: #6c757d;
  margin-right: 10px;
}

.log-event {
  font-weight: bold;
  margin-right: 10px;
}

.log-ring { color: #ffc107; }
.log-connect { color: #28a745; }
.log-disconnect { color: #dc3545; }
.log-system { color: #6f42c1; }

/* git commit을 위한 주석 - 2025-09-11 */
/* 통화 시스템 및 IE 모드 스타일 통합 완료 */ 