/* ===================================
   EMOTION FACE MATCHER - STYLES
   =================================== */

/* CSS Variables */
:root {
  --primary-color: #ff6b9d;
  --secondary-color: #c44569;
  --success-color: #4caf50;
  --error-color: #ff5252;
  --warning-color: #ffc107;
  --info-color: #2196f3;

  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-bg: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --border-radius: 16px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: var(--text-primary);
}

/* Game Container */
.game-container {
  width: 100%;
  max-width: 900px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

/* Header */
.game-header {
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

.header-left,
.header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.score-display {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
}

/* Main Game Area */
.game-main {
  padding: 40px;
  min-height: 500px;
  position: relative;
}

/* Screen Management */
.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block;
}

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

/* Welcome Screen */
.welcome-content {
  text-align: center;
}

.emoji-large {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

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

.welcome-content h2 {
  font-size: 32px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.welcome-content p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* Mode Selection */
.mode-selection,
.difficulty-selection {
  margin-top: 40px;
}

.mode-selection h3,
.difficulty-selection h3 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.mode-buttons,
.difficulty-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.mode-btn,
.difficulty-btn {
  background: white;
  border: 3px solid #e0e0e0;
  border-radius: var(--border-radius);
  padding: 30px 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mode-btn:hover,
.difficulty-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 107, 157, 0.2);
}

.mode-icon,
.diff-icon {
  font-size: 48px;
}

.mode-name,
.diff-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.mode-desc,
.diff-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Learning Mode */
.emotion-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.emotion-image-container {
  width: 300px;
  height: 300px;
  margin: 0 auto 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--primary-color);
  box-shadow: 0 10px 30px rgba(255, 107, 157, 0.3);
}

.emotion-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.emotion-name {
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 16px;
  font-weight: 700;
}

.emotion-description {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.6;
}

.emotion-examples {
  background: #f5f5f5;
  padding: 30px;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  text-align: left;
}

.emotion-examples h3 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.examples-list {
  list-style: none;
  padding-left: 0;
}

.examples-list li {
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 16px;
}

.examples-list li:last-child {
  border-bottom: none;
}

.examples-list li::before {
  content: "✓ ";
  color: var(--success-color);
  font-weight: bold;
  margin-right: 10px;
}

/* Learning Navigation */
.learning-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
}

.nav-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

.nav-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
}

.emotion-progress {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Quiz Screen */
.quiz-content {
  max-width: 700px;
  margin: 0 auto;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 30px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transition: width 0.5s ease;
  border-radius: 6px;
}

.question-counter {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Timer */
.timer-container {
  text-align: center;
  margin-bottom: 20px;
  font-size: 32px;
  font-weight: 700;
  color: var(--warning-color);
}

.timer-container.urgent {
  color: var(--error-color);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Question */
.question-container {
  text-align: center;
}

.question-text {
  font-size: 28px;
  margin-bottom: 30px;
  color: var(--text-primary);
}

.quiz-image {
  width: 250px;
  height: 250px;
  margin-bottom: 40px;
}

/* Answer Options */
.answer-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.answer-btn {
  background: white;
  border: 3px solid #e0e0e0;
  border-radius: var(--border-radius);
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 107, 157, 0.2);
}

.answer-btn.correct {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.answer-btn.wrong {
  background: var(--error-color);
  border-color: var(--error-color);
  color: white;
}

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

/* Feedback */
.feedback-container {
  margin: 30px 0;
  padding: 20px;
  border-radius: var(--border-radius);
  text-align: center;
}

.feedback-container.correct {
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid var(--success-color);
}

.feedback-container.wrong {
  background: rgba(255, 82, 82, 0.1);
  border: 2px solid var(--error-color);
}

.feedback-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
}

.feedback-text {
  font-size: 18px;
  font-weight: 600;
}

/* Results Screen */
.results-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.results-emoji {
  font-size: 100px;
  margin-bottom: 20px;
  animation: celebrate 1s ease;
}

@keyframes celebrate {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-10deg);
  }
  75% {
    transform: scale(1.2) rotate(10deg);
  }
}

.results-title {
  font-size: 36px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.results-message {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-item {
  background: #f5f5f5;
  padding: 20px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  font-size: 32px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
}

/* Results Actions */
.results-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 40px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  border: none;
  padding: 16px 32px;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-large {
  padding: 20px 40px;
  font-size: 20px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(255, 107, 157, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 3px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
}

/* Share Section */
.share-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
}

.share-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.share-btn {
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.share-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: var(--text-secondary);
}

.help-section {
  margin-bottom: 30px;
}

.help-section h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.help-section p,
.help-section ul {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.help-section ul {
  margin-left: 20px;
  margin-top: 10px;
}

.emotions-reference {
  background: #f5f5f5;
  padding: 20px;
  border-radius: var(--border-radius);
  margin-top: 30px;
}

.emotions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.emotion-ref {
  background: white;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-main {
    padding: 20px;
  }

  .game-title {
    font-size: 20px;
  }

  .emoji-large {
    font-size: 60px;
  }

  .mode-buttons,
  .difficulty-buttons {
    grid-template-columns: 1fr;
  }

  .emotion-image-container {
    width: 200px;
    height: 200px;
  }

  .emotion-name {
    font-size: 28px;
  }

  .answer-options {
    grid-template-columns: 1fr;
  }

  .results-actions {
    flex-direction: column;
  }

  .emotions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .game-header {
    padding: 15px;
  }

  .btn-icon {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .score-display {
    padding: 6px 12px;
    font-size: 14px;
  }
}

/* ===================================
   SVG EMOTION FACES
   =================================== */

/* Emotion Face Containers */
.emotion-face-large,
.emotion-face-quiz {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: emotionAppear 0.5s ease;
}

@keyframes emotionAppear {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* SVG Styling */
.emotion-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.15));
  transition: transform 0.3s ease;
}

.emotion-face-large:hover .emotion-svg,
.emotion-face-quiz:hover .emotion-svg {
  transform: scale(1.05);
}

/* Emoji Fallback */
.emoji-fallback {
  font-size: 200px;
  line-height: 1;
  animation: emojiPulse 2s ease-in-out infinite;
}

@keyframes emojiPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Responsive SVG sizes */
@media (max-width: 768px) {
  .emoji-fallback {
    font-size: 150px;
  }
}

@media (max-width: 480px) {
  .emoji-fallback {
    font-size: 120px;
  }
}
