/**
 * Kibble Clicker Styles
 */

:root {
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --background: #f7f7f7;
  --text-color: #2d3436;
  --card-background: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: var(--text-color);
}

.container {
  max-width: 600px;
  width: 100%;
  background: var(--card-background);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 3em;
  color: var(--primary-color);
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 1.1em;
  color: #636e72;
}

.game-area {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Kibble Display */
.kibble-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.kibble-count-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.kibble-label {
  font-size: 1.2em;
  color: white;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.kibble-count {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  width: 100%;
  transition: all 0.2s ease;
}

.kibble-count.updated {
  transform: scale(1.05);
}

.treat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  min-width: 80px;
  justify-content: center;
}

.treat-item:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.treat-amount {
  font-size: 1.8em;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.treat-emoji {
  font-size: 1.8em;
  animation: float 3s ease-in-out infinite;
  animation-delay: calc(var(--item-index, 0) * 0.2s);
}

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

/* Button Area */
.button-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.trick-button {
  font-size: 1.5em;
  padding: 20px 50px;
  background: linear-gradient(135deg, var(--primary-color), #ee5a6f);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.trick-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: linear-gradient(135deg, #ee5a6f, var(--primary-color));
}

.trick-button:active,
.trick-button.clicked {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hint {
  font-size: 0.9em;
  color: #b2bec3;
  font-style: italic;
}

/* Current Trick Display */
.current-trick {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border-radius: 15px;
  padding: 25px;
  box-shadow: var(--shadow);
  text-align: center;
}

.current-trick h3 {
  color: #2d3436;
  font-size: 1.2em;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.trick-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.trick-name {
  font-size: 2em;
  font-weight: bold;
  color: #2d3436;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.trick-level {
  font-size: 1.2em;
  padding: 5px 15px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  color: #2d3436;
  font-weight: bold;
}

.trick-reward {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.reward-label {
  font-size: 0.9em;
  color: #2d3436;
  opacity: 0.8;
}

.reward-value {
  font-size: 1.3em;
  font-weight: bold;
  color: #2d3436;
}

/* Training School */
.training-school {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  border-radius: 15px;
  padding: 25px;
  box-shadow: var(--shadow);
}

.training-school h3 {
  color: white;
  font-size: 1.3em;
  margin-bottom: 20px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.next-trick-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.next-trick-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.next-label {
  font-size: 0.9em;
  color: #636e72;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.next-trick-name {
  font-size: 1.5em;
  font-weight: bold;
  color: #6c5ce7;
}

.next-trick-description {
  font-size: 0.95em;
  color: #636e72;
  line-height: 1.5;
  font-style: italic;
}

.next-trick-reward {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f7f7f7;
  border-radius: 8px;
}

.upgrade-button {
  font-size: 1.2em;
  padding: 15px 30px;
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  font-weight: bold;
  margin-top: 10px;
}

.upgrade-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: linear-gradient(135deg, #00cec9, #00b894);
}

.upgrade-button:active:not(:disabled),
.upgrade-button.clicked:not(:disabled) {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.upgrade-button:disabled {
  background: #b2bec3;
  cursor: not-allowed;
  opacity: 0.6;
}

.upgrade-button .button-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.max-level-message {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  font-size: 1.3em;
  color: #fdcb6e;
  font-weight: bold;
}

/* Stats */
.stats {
  background: var(--background);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 0.9em;
  color: #636e72;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--secondary-color);
}

/* Footer */
footer {
  margin-top: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.bug-report-button {
  padding: 10px 20px;
  background: #ff9f43;
  color: white;
  border: 2px solid #ff9f43;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9em;
  font-weight: bold;
}

.bug-report-button:hover {
  background: #ffa94d;
  border-color: #ffa94d;
  transform: translateY(-2px);
}

.reset-button {
  padding: 10px 20px;
  background: transparent;
  color: #636e72;
  border: 2px solid #dfe6e9;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9em;
}

.reset-button:hover {
  background: #dfe6e9;
  color: var(--text-color);
}

.debug-info {
  font-size: 0.8em;
  color: #b2bec3;
  font-style: italic;
}

/* Bug Report Modal */
.bug-report-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
  color: var(--primary-color);
  margin: 0;
  font-size: 1.8em;
}

.modal-message {
  color: #2d3436;
  font-size: 1.1em;
  margin: 0;
}

.bug-report-json {
  width: 100%;
  height: 300px;
  padding: 15px;
  border: 2px solid #dfe6e9;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  resize: vertical;
  background: #f7f7f7;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: all 0.2s ease;
}

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

.modal-btn.primary:hover {
  background: #ee5a6f;
  transform: translateY(-2px);
}

.modal-btn.copy-btn {
  background: var(--secondary-color);
  color: white;
}

.modal-btn.copy-btn:hover {
  background: #6edcc0;
  transform: translateY(-2px);
}

.modal-help {
  font-size: 0.9em;
  color: #636e72;
  font-style: italic;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 600px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 2em;
  }

  .kibble-count {
    font-size: 3em;
  }

  .trick-button {
    font-size: 1.2em;
    padding: 15px 40px;
  }

  .modal-content {
    padding: 20px;
  }

  .bug-report-json {
    height: 200px;
    font-size: 0.75em;
  }
}
