/* AI Pet Theme - 전체적인 AI 키우기 게임 분위기 */

:root {
  /* AI Pet Color Palette */
  --primary-color: #6366f1; /* 인디고 블루 */
  --secondary-color: #8b5cf6; /* 보라색 */
  --accent-color: #f59e0b; /* 골드 */
  --success-color: #10b981; /* 에메랄드 */
  --warning-color: #f59e0b; /* 앰버 */
  --danger-color: #ef4444; /* 레드 */
  --info-color: #06b6d4; /* 시안 */
  
  /* Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  
  /* Background Colors */
  --bg-primary: #1a1b23;
  --bg-secondary: #2d2e3f;
  --bg-card: #373854;
  --bg-light: #f8fafc;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Border Radius */
  --border-radius-sm: 8px;
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 24px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.16);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
  z-index: -1;
  animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-10px, -10px) rotate(1deg); }
  66% { transform: translate(10px, -5px) rotate(-1deg); }
}

/* Card Styles */
.card {
  background: rgba(55, 56, 84, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
  background: var(--gradient-primary) !important;
  border: none !important;
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Button Styles */
.btn {
  border-radius: var(--border-radius);
  font-weight: 600;
  text-transform: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-success {
  background: var(--gradient-success);
}

.btn-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.btn-info {
  background: var(--gradient-accent);
}

.btn-lg {
  padding: 12px 32px;
  font-size: 1.1rem;
  border-radius: var(--border-radius-lg);
}

/* Form Styles */
.form-control {
  background: rgba(45, 46, 63, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.form-control:focus {
  background: rgba(45, 46, 63, 1);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

/* Navigation */
.navbar {
  background: rgba(26, 27, 35, 0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0; /* 기본 1rem에서 0.5rem으로 줄임 */
  min-height: 60px; /* 최소 높이 설정 */
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem; /* 1.5rem에서 1.3rem으로 줄임 */
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 0.25rem 0; /* 브랜드 패딩 줄임 */
}

.nav-link {
  color: var(--text-secondary) !important;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary) !important;
}

/* AI Pet Specific Elements */
.ai-pet-container {
  position: relative;
  display: inline-block;
}

.ai-pet-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: petGlow 2s ease-in-out infinite alternate;
}

@keyframes petGlow {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.ai-pet-emoji {
  font-size: 4rem;
  animation: petFloat 3s ease-in-out infinite;
  display: inline-block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes petFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Stats and Progress */
.stat-card {
  background: rgba(55, 56, 84, 0.6);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(55, 56, 84, 0.8);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  background: var(--gradient-success);
  transition: width 0.6s ease;
}

/* Alert Styles */
.alert {
  border: none;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
}

.alert-info {
  background: rgba(6, 182, 212, 0.1);
  color: #67e8f9;
  border-left: 4px solid var(--info-color);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border-left: 4px solid var(--success-color);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-left: 4px solid var(--warning-color);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border-left: 4px solid var(--danger-color);
}

/* Loading Animation */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Hover Effects */
.hover-glow:hover {
  box-shadow: var(--shadow-glow);
  transition: box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  transition: transform 0.3s ease;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

.slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Dropdown Menu */
.dropdown-menu {
  background: rgba(45, 46, 63, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.dropdown-item {
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-pet-emoji {
    font-size: 3rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-secondary);
}

/* Text Selection */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

/* Focus Styles */
*:focus {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}

/* ===== CHAT INTERFACE STYLES ===== */

/* Chat Container */
.chat-main-container {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-messages-wrapper {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: rgba(45, 46, 63, 0.1);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

/* Chat Header */
.chat-header {
  flex-shrink: 0;
}

.chat-header .card-body {
  background: var(--gradient-primary);
  border-radius: var(--border-radius);
}

/* Message Bubbles */
.message-bubble {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  animation: messageSlideIn 0.3s ease-out;
}

.message-bubble.user-message {
  flex-direction: row-reverse;
}

.message-content-wrapper {
  max-width: 70%;
  min-width: 100px;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.user-message .message-content {
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.agent-message .message-content {
  background: rgba(55, 56, 84, 0.8);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-align: center;
}

.user-message .message-time {
  text-align: right;
}

.agent-message .message-time {
  text-align: left;
}

/* Message Avatars */
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.25rem;
}

.user-avatar {
  background: var(--gradient-secondary);
  color: white;
  font-size: 0.9rem;
}

/* Empty Chat State */
.empty-chat-state {
  text-align: center;
  padding: 3rem 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.starter-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.suggestion-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-lg);
  transition: all 0.3s ease;
  cursor: pointer;
}

.suggestion-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Chat Input Area */
.chat-input-container {
  flex-shrink: 0;
  background: var(--bg-card);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.chat-input-wrapper {
  max-width: 100%;
}

/* Quick Suggestions */
.quick-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.suggestion-chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.suggestion-chip:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.suggestion-chip span {
  font-size: 0.9rem;
}

/* Message Input */
.message-input-area {
  position: relative;
}

.message-input {
  background: rgba(45, 46, 63, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: var(--text-primary) !important;
  border-radius: 25px !important;
  padding: 0.75rem 1rem !important;
  padding-right: 3.5rem !important;
  font-size: 0.95rem;
  resize: none;
  min-height: 45px;
  max-height: 120px;
}

.message-input:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
  background: rgba(45, 46, 63, 0.8) !important;
}

.send-button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary) !important;
  border: none !important;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.send-button:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: var(--shadow-glow);
}

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

/* Agent Sidebar */
.agent-sidebar {
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.agent-profile-card {
  background: rgba(55, 56, 84, 0.6);
}

/* Agent Stats */
.stat-mini {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Quick Actions */
.quick-actions-card {
  background: rgba(55, 56, 84, 0.6);
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: left;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-btn span {
  font-weight: 600;
  display: block;
}

.action-btn small {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: block;
  margin-top: 0.25rem;
}

.creative-btn:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.learning-btn:hover {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.game-btn:hover {
  border-color: #8b5cf6;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.story-btn:hover {
  border-color: #06b6d4;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* Floating Notification */
.floating-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 1050;
  transform: translateX(400px);
  transition: transform 0.3s ease;
}

.floating-notification.show {
  transform: translateX(0);
}

.notification-content {
  background: var(--gradient-success);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  min-width: 250px;
}

/* Animations */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States */
.loading-dots::after {
  content: '';
  animation: loadingDotsChat 1.5s steps(4, end) infinite;
}

@keyframes loadingDotsChat {
  0%, 20% { content: '🤔'; }
  40% { content: '💭'; }
  60% { content: '🤯'; }
  80%, 100% { content: '💡'; }
}

/* Responsive Design */
@media (max-width: 992px) {
  .chat-main-container {
    height: calc(100vh - 140px);
  }
  
  .agent-sidebar {
    height: auto;
    margin-top: 1rem;
  }
  
  .message-content-wrapper {
    max-width: 85%;
  }
  
  .quick-suggestions {
    display: none;
  }
  
  .chat-messages {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .suggestion-chip {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  
  .message-content {
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
  }
  
  .chat-input-container {
    padding: 0.75rem 1rem;
  }
  
  .ai-pet-emoji {
    font-size: 2rem !important;
  }
}