/**
 * Mumbler Virtual Pet Widget Styles
 */

/* Floating Toggle Button - Always Visible */
.mumbler-toggle-fab {
  position: fixed !important;
  bottom: 20px !important;
  left: 20px !important;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  border: none;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
  cursor: pointer;
  z-index: 99999 !important;
  font-size: 30px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.mumbler-toggle-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.8);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
  }
  50% {
    box-shadow: 0 4px 30px rgba(102, 126, 234, 1);
  }
}

.mumbler-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  min-width: 300px;
  max-width: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  z-index: 9999;
  overflow: hidden;
  user-select: none;
}

.mumbler-header {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mumbler-header:active {
  cursor: grabbing;
}

.mumbler-title {
  color: white;
  font-weight: bold;
  font-size: 16px;
}

.mumbler-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s;
}

.mumbler-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mumbler-content {
  padding: 16px;
  background: rgba(255, 255, 255, 0.95);
  max-height: 600px;
  overflow-y: auto;
}

.mumbler-sprite-container {
  text-align: center;
  margin-bottom: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
}

#mumblerCanvas {
  display: block;
  margin: 0 auto 12px;
  border-radius: 8px;
  background: white;
}

.mumbler-info {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
}

.mumbler-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.mumbler-level {
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.mumbler-stage {
  background: #764ba2;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.mumbler-stats {
  margin-bottom: 16px;
}

.stat-row {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.stat-row.exp-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}

.stat-label {
  font-size: 12px;
  font-weight: bold;
  color: #555;
}

.stat-bar {
  height: 16px;
  background: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 8px;
}

.stat-health { background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%); }
.stat-hunger { background: linear-gradient(90deg, #fa709a 0%, #fee140 100%); }
.stat-happiness { background: linear-gradient(90deg, #ffd89b 0%, #19547b 100%); }
.stat-energy { background: linear-gradient(90deg, #a8edea 0%, #fed6e3 100%); }
.stat-cleanliness { background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%); }
.stat-exp { background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); }

.stat-value {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  text-align: right;
}

.mumbler-status {
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 13px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-icon {
  font-size: 18px;
}

.mumbler-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.action-btn {
  background: white;
  border: 2px solid #667eea;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 24px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

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

.mumbler-create,
.mumbler-restart {
  text-align: center;
  padding: 16px;
}

.mumbler-create input {
  width: 100%;
  padding: 12px;
  border: 2px solid #667eea;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.create-btn,
.restart-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.create-btn:hover,
.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.create-btn:active,
.restart-btn:active {
  transform: translateY(0);
}

.mumbler-restart p {
  color: #666;
  margin-bottom: 16px;
  font-size: 14px;
}

.mumbler-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 0%, transparent 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2) 100%);
}

/* Scrollbar styling */
.mumbler-content::-webkit-scrollbar {
  width: 6px;
}

.mumbler-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.mumbler-content::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

.mumbler-content::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.mumbler-status.alert {
  animation: pulse 1.5s infinite;
}

/* Social Features */
.mumbler-social {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 16px;
  z-index: 10;
  overflow-y: auto;
}

.social-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e0e0;
}

.social-header h3 {
  margin: 0;
  font-size: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.social-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.social-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

.social-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.social-tab {
  flex: 1;
  padding: 10px 12px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
}

.social-tab:hover {
  background: #e8e8e8;
  color: #333;
}

.social-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.social-tab-content {
  animation: fadeIn 0.3s ease;
}

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

.social-tab-content input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
  transition: border-color 0.3s ease;
}

.social-tab-content input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
}

.social-action-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.social-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.social-toggle-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  z-index: 5;
}

.social-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.other-mumbler-card {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.other-mumbler-card h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.other-mumbler-card .mumbler-visual {
  width: 100px;
  height: 100px;
  margin: 12px auto;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mini-stat {
  padding: 8px;
  background: white;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}

.mini-stat strong {
  display: block;
  font-size: 16px;
  color: #667eea;
  margin-top: 4px;
}

.battle-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.battle-result.victory {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(56, 142, 60, 0.1) 100%);
  border: 2px solid #4caf50;
}

.battle-result.defeat {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(211, 47, 47, 0.1) 100%);
  border: 2px solid #f44336;
}

.battle-result h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
}

.battle-result.victory h4 {
  color: #4caf50;
}

.battle-result.defeat h4 {
  color: #f44336;
}

.battle-result p {
  margin: 8px 0;
  font-size: 14px;
  color: #666;
}

.breed-result {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.1) 0%, rgba(156, 39, 176, 0.1) 100%);
  border: 2px solid #e91e63;
  border-radius: 12px;
  text-align: center;
  animation: bounceIn 0.5s ease;
}

.breed-result h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #e91e63;
}

.breed-result p {
  margin: 8px 0;
  font-size: 14px;
  color: #666;
}

.offspring-preview {
  width: 60px;
  height: 60px;
  margin: 12px auto;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 3px solid white;
}

/* Responsive */
@media (max-width: 768px) {
  .mumbler-widget {
    bottom: 10px;
    right: 10px;
    width: 300px;
  }

  .mumbler-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .action-btn {
    padding: 8px;
    font-size: 20px;
  }
}
