/* VISUAL ENHANCEMENTS */

/* Dark mode variables */
:root {
  /* Light theme (default) */
  --color-correct: #6aaa64;
  --color-correct-rgb: 106, 170, 100;
  --color-present: #c9b458;
  --color-present-rgb: 201, 180, 88;
  --color-absent: #787c7e;
  --color-absent-rgb: 120, 124, 126;
  --color-background: #dadada;
  --color-side-background: #7c7c7c;
  --board-background: #e9e9e9;
  --color-text: #1a1a1b;
  --keyboard-text: #1a1a1b;
  --keyboard-bg: #d3d6da;
  --tile-border: #d3d6da;
  --keyboard-tile-border: #8b8b8b;
  --header-border-bottom: #a7a7a7;
}

/* Dark theme */
[data-theme="dark"] {
  --color-correct: #538d4e;
  --color-correct-rgb: 83, 141, 78;
  --color-present: #b59f3b;
  --color-present-rgb: 181, 159, 59;
  --color-absent: #3a3a3c;
  --color-absent-rgb: 58, 58, 60;
  --color-background: #121213;
  --color-side-background: #3a3a3c;
  --board-background: #1a1a1b;
  --color-text: #d7dadc;
  --keyboard-text: #d7dadc;
  --keyboard-bg: #818384;
  --tile-border: #3a3a3c;
  --keyboard-tile-border: #565758;
  --header-border-bottom: #3a3a3c;
}

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 30px;
  border-radius: 15px;
  background-color: var(--keyboard-bg);
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.theme-toggle-slider {
  position: absolute;
  left: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--color-text);
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

[data-theme="dark"] .theme-toggle-slider {
  left: 35px;
}

.theme-toggle-slider::before {
  content: "☀️";
  font-size: 12px;
}

[data-theme="dark"] .theme-toggle-slider::before {
  content: "🌙";
}

/* Enhanced Round & Score Info */
#round-info, #score-info {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] #round-info, 
[data-theme="dark"] #score-info {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#round-info:hover, #score-info:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#round-info::before, #score-info::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: 0.5s;
}

#round-info:hover::before, #score-info:hover::before {
  left: 100%;
}

#round-info h2, #score-info h2 {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.05em;
}

#round-number, #score-number, #word-info {
  display: inline-block;
  font-weight: bold;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  margin: 0 3px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#score-number {
  background-color: rgba(var(--color-correct-rgb, 106, 170, 100), 0.3);
  padding: 3px 10px;
  font-size: 1.2em;
  animation: pulse-subtle 2s infinite;
}

@keyframes pulse-subtle {
  0% { box-shadow: 0 0 0 0 rgba(106, 170, 100, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(106, 170, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(106, 170, 100, 0); }
}

/* Animated Background */
body {
  background: linear-gradient(135deg, var(--color-background) 0%, #b8b8b8 100%);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  transition: background 0.3s ease;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, var(--color-background) 0%, #2a2a2a 100%);
}

@keyframes gradientBG {
  0% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
  100% { background-position: 0% 50% }
}

/* Enhanced Board Appearance */
#board {
  background: var(--board-background);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.tile {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
  transform-style: preserve-3d;
  color: var(--color-text);
}

/* Fix for dark mode text visibility - only for non-colored tiles */
[data-theme="dark"] .tile:not(.correct):not(.present):not(.absent) {
  color: white;
  background-color: #333;
  border-color: #555;
}

/* Make sure colored tiles show properly in dark mode */
.tile.correct {
  background-color: var(--color-correct);
  color: white;
  border-color: var(--color-correct);
}

.tile.present {
  background-color: var(--color-present);
  color: white;
  border-color: var(--color-present);
}

.tile.absent {
  background-color: var(--color-absent);
  color: white;
  border-color: var(--color-absent);
}

.tile:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* REMOVE all animation conflicts with the original flip animation */
/* Let the game's built-in animations work without interference */

@keyframes tileReveal {
  0% { 
    opacity: 0;
    transform: translateY(10px);
  }
  100% { 
    opacity: 1;
    transform: translateY(0);
  }
}

.row {
  animation: rowFadeIn 0.5s ease-out;
}

@keyframes rowFadeIn {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Progress Bar */
#game-progress {
  width: 90%;
  max-width: 400px;
  height: 8px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  margin: 10px auto;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

#progress-fill {
  height: 100%;
  background-color: var(--color-correct);
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(106, 170, 100, 0.5);
  position: relative;
  overflow: hidden;
}

#progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Enhanced Header */
h1 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  background: linear-gradient(45deg, #444, #222);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 5px 15px;
  border-radius: 8px;
  position: relative;
  transition: all 0.3s ease;
}

[data-theme="dark"] h1 {
  background: linear-gradient(45deg, #ddd, #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-correct), transparent);
}

/* Enhanced Keyboard */
.keyboard-row button {
  transition: all 0.15s ease;
  border-radius: 8px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.keyboard-row button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.15);
}

.keyboard-row button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.keyboard-row button.correct, 
.keyboard-row button.present, 
.keyboard-row button.absent {
  animation: keyReveal 0.2s ease-out;
}

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

/* Side Container Enhancement */
.side-container {
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  transition: all 0.3s ease;
}

/* Current Upgrades Enhancement */
#current-upgrades {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
}

.cur-upgrade {
  animation: upgradeAppear 0.3s ease-out;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: scale(1);
  transition: transform 0.2s ease;
}

.cur-upgrade:hover {
  transform: scale(1.05);
}

@keyframes upgradeAppear {
  0% { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Message Animation */
.message-container {
  transform: translate(-50%, 0);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.message-container.message-hidden {
  opacity: 0;
  transform: translate(-50%, -20px);
  pointer-events: none;
}

.message-container.message-error,
.message-container.message-warning {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate(calc(-50% - 1px), 0); }
  20%, 80% { transform: translate(calc(-50% + 2px), 0); }
  30%, 50%, 70% { transform: translate(calc(-50% - 2px), 0); }
  40%, 60% { transform: translate(calc(-50% + 2px), 0); }
}

/* Game Container Enhancement */
#game-container {
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

[data-theme="dark"] #game-container {
  background: linear-gradient(to bottom, rgba(30,30,30,0.2), rgba(10,10,10,0.1));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Abilities Grid Enhancement */
#abilities-grid {
  background: linear-gradient(135deg, rgba(0,0,0,0.1), rgba(0,0,0,0.2));
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.ability-square {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.ability-square:hover:not(.disabled) {
  transform: scale(1.15) translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Info Blocks Enhancement */
#active-hints, #repeats-info, #accept-non-words-info {
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Win Animation Effects */
@keyframes celebrate {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

/* Adding confetti effect when winning */
.winning-animation {
  animation: celebrate 0.5s ease-in-out;
}

/* Add some pulsing effect to active hints */
.hint-word, #num-repeats {
  animation: pulse 2s infinite;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Show desktop controls on devices larger than mobile */
@media (min-width: 769px) {
  .desktop-control {
    display: inline !important; /* Force override */
    
  }
} 