* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* 헤더 */
.header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile-image {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.role-badge {
  background: #3498db;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 네비게이션 */
.navigation {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navigation a {
  display: inline-block;
  padding: 1rem 1.5rem;
  color: #666;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.navigation a:hover {
  color: #2c3e50;
  background: #f9f9f9;
}

.navigation a.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

/* 컨테이너 */
.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

h2 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
  font-size: 1.75rem;
}

/* 키오스크 그리드 */
.kiosks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.kiosk-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid rgba(0,0,0,0.05);
}

.kiosk-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: rgba(52, 152, 219, 0.2);
}

/* 카드 헤더 */
.kiosk-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.kiosk-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.kiosk-status.online {
  background: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(39, 174, 96, 0.1); }
}

.kiosk-status.offline {
  background: #bdc3c7;
}

.kiosk-status.busy {
  background: #f39c12;
  animation: pulse-orange 1.5s infinite;
}

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

/* 상태 텍스트 인라인 점 */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.online { background: #27ae60; }
.status-dot.offline { background: #bdc3c7; }
.status-dot.busy { background: #f39c12; }

/* 마지막 통화 정보 */
.kiosk-last-call {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.85rem;
}

.last-call-label {
  display: block;
  color: #666;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.last-call-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.last-call-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.last-call-time {
  color: #888;
  font-size: 0.75rem;
}

/* 드롭다운 메뉴 */
.kiosk-menu {
  position: relative;
}

.kiosk-menu-btn {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.kiosk-menu-btn:hover {
  background: rgba(0,0,0,0.05);
}

.menu-dots {
  display: block;
  width: 4px;
  height: 4px;
  background: #7f8c8d;
  border-radius: 50%;
  position: relative;
}

.menu-dots::before,
.menu-dots::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: #7f8c8d;
  border-radius: 50%;
}

.menu-dots::before { top: -7px; }
.menu-dots::after { top: 7px; }

.kiosk-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
  overflow: hidden;
}

.kiosk-menu-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.kiosk-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  color: #2c3e50;
  transition: background 0.2s;
}

.kiosk-menu-dropdown button:hover {
  background: #f8f9fa;
}

.kiosk-menu-dropdown button.menu-danger {
  color: #e74c3c;
}

.kiosk-menu-dropdown button.menu-danger:hover {
  background: #fef2f2;
}

.kiosk-card h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
  font-size: 1.25rem;
}

.kiosk-id {
  color: #7f8c8d;
  font-size: 0.75rem;
  font-family: monospace;
  margin-bottom: 0.5rem;
}

.kiosk-status-text {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.kiosk-last-seen {
  color: #95a5a6;
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

/* 버튼 */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
  background: #f1f2f6;
  color: #555;
}

.btn-secondary:hover {
  background: #e8e9ed;
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  width: auto;
  margin-right: 0.25rem;
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 통화 오버레이 */
.call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.call-panel {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  text-align: center;
  min-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.call-panel h2 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.call-panel .kiosk-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #3498db;
  margin-bottom: 0.5rem;
}

.call-duration {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 2rem;
  font-variant-numeric: tabular-nums;
}

/* 비디오 통화 패널 */
.call-panel-with-video {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  min-width: auto;
  text-align: left;
}

/* 웹캠 없을 때 레이아웃 */
.call-panel-with-video.no-video {
  max-width: 500px;
  justify-content: center;
}

.video-container {
  flex: 0 0 auto;
  width: 960px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

#remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  background: #1a1a1a;
}

.video-placeholder.hidden {
  display: none;
}

.call-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.call-controls h2 {
  margin-bottom: 1rem;
}

/* 키오스크 버튼 그룹 */
.kiosk-buttons {
  display: flex;
  gap: 0.5rem;
}

.kiosk-buttons .btn-primary,
.kiosk-buttons .btn-webcam {
  flex: 1;
  padding: 0.75rem 0.5rem;
}

.btn-webcam {
  background: #9b59b6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-webcam:hover {
  background: #8e44ad;
}

/* 웹캠 미리보기 패널 */
.webcam-panel {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 1100px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.webcam-video-container {
  background: #000;
  border-radius: 8px;
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

#preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.webcam-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.webcam-controls h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.25rem;
}

.webcam-buttons {
  display: flex;
  gap: 0.75rem;
}

.webcam-buttons button {
  padding: 0.75rem 1.5rem;
  width: auto;
}

/* PTT 버튼 */
.ptt-container {
  margin: 2rem 0;
}

.ptt-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 150px;
  height: 150px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.ptt-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.ptt-button.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.6);
}

.ptt-icon {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  position: relative;
}

.ptt-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: #667eea;
  border-radius: 50%;
}

.ptt-button.active .ptt-icon::before {
  background: #f5576c;
}

.ptt-button span {
  font-size: 0.875rem;
  font-weight: 600;
}

.ptt-hint {
  margin-top: 1rem;
  color: #7f8c8d;
  font-size: 0.875rem;
}

/* 로딩 및 메시지 */
.loading {
  text-align: center;
  padding: 2rem;
  color: #7f8c8d;
}

.error-message, .success-message {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.error-message {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.success-message {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}

.no-data {
  text-align: center;
  padding: 2rem;
  color: #95a5a6;
}

/* 필터 */
.filters {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
}

.filter-group select,
.filter-group input {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #3498db;
}

/* 테이블 */
.recordings-list, .users-list {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f8f9fa;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #e0e0e0;
}

td {
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
  background: #f8f9fa;
}

.role-select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.875rem;
}

.text-muted {
  color: #95a5a6;
  font-style: italic;
}

/* 사용자 목록 아바타 */
.user-list-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.no-avatar {
  display: inline-block;
  width: 36px;
  text-align: center;
  color: #bdc3c7;
}

/* 닉네임 입력 필드 */
.display-name-input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.875rem;
  width: 120px;
}

.display-name-input:focus {
  border-color: #3498db;
  outline: none;
}

/* 녹취 목록 상담원 */
.recording-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 오디오 플레이어 */
.audio-player {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 100;
  min-width: 400px;
}

.audio-player-content {
  position: relative;
}

.close-btn {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.audio-player h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
  font-size: 1.125rem;
}

audio {
  width: 100%;
}

/* 로그인 페이지 */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.login-box {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  text-align: center;
}

.login-box h1 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
  font-size: 2rem;
}

.subtitle {
  color: #7f8c8d;
  margin-bottom: 2rem;
}

.kakao-login-btn {
  background: #FEE500;
  color: #000000;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s;
}

.kakao-login-btn:hover {
  background: #FDD835;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.info-text {
  margin-top: 2rem;
  color: #7f8c8d;
  font-size: 0.875rem;
}

.info-text p {
  margin-bottom: 0.5rem;
}

.info-text .small {
  font-size: 0.75rem;
  color: #95a5a6;
}

/* 확인 모달 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-panel {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  width: 90%;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-panel h3 {
  margin: 0 0 1rem;
  color: #2c3e50;
  font-size: 1.25rem;
}

.modal-panel p {
  color: #555;
  margin-bottom: 1rem;
}

.confirm-extra {
  margin-bottom: 1rem;
}

.warning-text {
  color: #c0392b;
  font-size: 0.875rem;
  background: #fef2f2;
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 3px solid #e74c3c;
  margin: 0;
}

.modal-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal-buttons button {
  padding: 0.75rem 1.5rem;
  width: auto;
}

/* 플로팅 메시지 */
.floating-message {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1100;
  animation: floatIn 0.3s ease, floatOut 0.3s ease 2.7s forwards;
  font-weight: 500;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes floatOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.floating-message.success-message {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
}

.floating-message.error-message {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
}

/* 반응형 */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .navigation a {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .kiosks-grid {
    grid-template-columns: 1fr;
  }

  .call-panel {
    min-width: auto;
    width: 90%;
    padding: 2rem;
  }

  .call-panel-with-video {
    flex-direction: column;
    max-width: 95%;
  }

  .video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .webcam-video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .webcam-controls {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .kiosk-buttons {
    flex-direction: column;
  }

  .filters {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .audio-player {
    left: 1rem;
    right: 1rem;
    min-width: auto;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }
}
