/**
 * Pain Avatar Component Styles for Migraine Aura Visualizer
 */

/* Main container */
.pain-avatar-component {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.8rem;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  background-color: #ffffff;
  transition: all 0.3s ease;
}

/* Header and instructions */
.pain-avatar-header {
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-weight: 600;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.pain-avatar-instructions {
  color: #505a67;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  text-align: center;
  background: #f7f9ff;
  padding: 12px 15px;
  border-radius: 10px;
  border-left: 4px solid #4f89ff;
  line-height: 1.5;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Controls section */
.pain-avatar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: #f9fafc;
  border-radius: 12px;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Control groups */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 250px;
  flex: 0 1 45%;
}

.control-group-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  padding-left: 0.3rem;
  border-left: 3px solid #4f89ff;
}

/* View selector */
.pain-avatar-view-selector,
.pain-avatar-intensity-selector,
.pain-avatar-tool-selector,
.pain-avatar-brush-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Button styling */
.pain-avatar-view-btn,
.pain-avatar-tool-btn {
  padding: 0.7rem 1rem;
  border: 1px solid #e8e8e8;
  background-color: #fff;
  color: #555;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  flex: 1;
  min-width: 80px;
}

.pain-avatar-view-btn:hover,
.pain-avatar-tool-btn:hover {
  background-color: #f5f8ff;
  border-color: #b3d4fc;
  box-shadow: 0 3px 8px rgba(79, 137, 255, 0.15);
  transform: translateY(-1px);
  color: #0b5cbe;
}

.pain-avatar-view-btn.active,
.pain-avatar-tool-btn.active {
  background-color: #3498db;
  color: white;
  border-color: #2980b9;
  box-shadow: 0 2px 8px rgba(41, 128, 185, 0.25);
  transform: translateY(-1px);
}

/* Intensity selector */
.pain-avatar-intensity-btn {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  color: #000000;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  text-shadow: 0px 0px 3px rgba(255, 255, 255, 1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pain-avatar-intensity-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.pain-avatar-intensity-btn.active {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

/* Brush size selector */
.brush-size-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.pain-avatar-brush-btn {
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  width: 2.8rem;
  height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pain-avatar-brush-btn:hover {
  background-color: #f0f4f9;
  border-color: #c0d0e0;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
  transform: scale(1.05);
}

.pain-avatar-brush-btn.active {
  background-color: #f0f4f9;
  border-color: #0b5cbe;
  box-shadow: 0 2px 6px rgba(11, 92, 190, 0.2);
}

.brush-size-circle {
  background-color: #333;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.pain-avatar-brush-btn:hover .brush-size-circle {
  transform: scale(1.1);
}

.pain-avatar-brush-btn.active .brush-size-circle {
  background-color: #0b5cbe;
}

/* Canvas container */
.pain-avatar-canvas-container {
  position: relative;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  background: #fff;
  padding: 1.5rem;
  transition: all 0.3s ease;
  max-width: 650px;
}

/* View container */
.pain-avatar-view {
  display: none;
  position: relative;
  background-color: #f9f9f9;
  border-radius: 10px;
  overflow: hidden;
  width: 580px;
  height: 400px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(5px);
}

.pain-avatar-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* View label */
.pain-avatar-view-label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: #0b5cbe;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 5;
}

/* SVG background */
.pain-avatar-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pain-avatar-background svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

/* Canvas element */
.pain-avatar-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: crosshair;
  touch-action: none;
  background-color: transparent;
  box-sizing: border-box;
}

/* Drawing feedback indicator */
.pain-avatar-drawing-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pain-avatar-drawing-indicator.active {
  opacity: 1;
}

/* Action buttons container */
.pain-avatar-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-bottom: 1.5rem;
}

/* Action buttons */
.pain-avatar-save-btn,
.pain-avatar-clear-btn {
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pain-avatar-save-btn {
  background-color: #4f89ff;
  color: white;
}

.pain-avatar-save-btn:hover {
  background-color: #3a70e0;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(79, 137, 255, 0.4);
}

.pain-avatar-clear-btn {
  background-color: #ff4f4f;
  color: white;
}

.pain-avatar-clear-btn:hover {
  background-color: #e03a3a;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 79, 79, 0.4);
}

.pain-avatar-save-btn:active,
.pain-avatar-clear-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .pain-avatar-component {
    padding: 1.2rem;
    border-radius: 12px;
  }
  
  .pain-avatar-controls {
    padding: 1.2rem;
    gap: 1rem;
  }
  
  .control-group {
    flex: 1 1 100%;
    min-width: 100%;
  }
  
  .pain-avatar-canvas-container {
    padding: 1rem;
  }
  
  .pain-avatar-view {
    width: 100%;
    height: auto;
    aspect-ratio: 1.45 / 1;
  }
  
  .pain-avatar-view-label {
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
  }
}

@media (max-width: 480px) {
  .pain-avatar-component {
    padding: 1rem;
  }
  
  .pain-avatar-controls {
    padding: 1rem;
  }
  
  .button-group {
    flex-direction: column;
    width: 100%;
  }
  
  .pain-avatar-view-btn,
  .pain-avatar-intensity-btn,
  .pain-avatar-tool-btn {
    width: 100%;
  }
  
  .pain-avatar-actions {
    flex-direction: column;
  }
  
  .pain-avatar-view-label {
    top: 0.35rem;
    left: 0.35rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 4px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .pain-avatar-component {
    background-color: #1a1a1a;
    color: #f5f5f5;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  }
  
  .pain-avatar-controls {
    background-color: #242424;
  }
  
  .pain-avatar-header {
    color: #ffffff;
  }
  
  .pain-avatar-instructions {
    color: #e0e0e0;
    background-color: #2a2a2a;
  }
  
  .control-group-label {
    color: #e0e0e0;
  }
  
  .pain-avatar-view-btn,
  .pain-avatar-tool-btn {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #444444;
  }
  
  .pain-avatar-view-btn:hover,
  .pain-avatar-tool-btn:hover {
    background-color: #333;
    border-color: #555;
    color: #ffffff;
  }
  
  .pain-avatar-view-btn.active,
  .pain-avatar-tool-btn.active {
    background-color: #0b5cbe;
    color: #ffffff;
  }
  
  .pain-avatar-intensity-btn {
    border-color: #444;
    text-shadow: 0px 0px 3px rgba(0, 0, 0, 1);
  }
  
  .pain-avatar-brush-btn {
    background-color: #2a2a2a;
    border-color: #444444;
  }
  
  .brush-size-circle {
    background-color: #e0e0e0;
  }
  
  .pain-avatar-view {
    background-color: #242424;
  }
  
  .pain-avatar-canvas-container {
    background-color: #242424;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  }
}

/* Accessibility focus styles */
.pain-avatar-view-btn:focus,
.pain-avatar-intensity-btn:focus,
.pain-avatar-tool-btn:focus,
.pain-avatar-brush-btn:focus,
.pain-avatar-save-btn:focus,
.pain-avatar-clear-btn:focus {
  outline: 2px solid #4f89ff;
  outline-offset: 2px;
} 