:root {
  /* Primary Color - Deep Burgundy/Wine Red */
  --primary-color: #781015;
  --primary-light: #a01419;
  --primary-dark: #5a0c10;

  /* Secondary Color - Deep Navy Blue */
  --secondary-color: #0f0f5b;
  --secondary-light: #1a1a7f;
  --secondary-dark: #0a0a3d;

  /* Neutral Colors */
  --background-light: #f8f9fa;
  --border-color: #e0e0e0;
  --text-dark: #333;
  --text-light: #666;
  --text-lighter: #999;

  /* Success/Action Colors */
  --success-color: #28a745;
  --success-hover: #218838;
  --danger-color: #dc3545;
  --danger-hover: #c82333;
  --warning-color: #ffc107;
  --warning-bg: #fff3cd;
  --warning-text: #856404;

  /* Shadows & Effects */
  --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

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

/* order in which background-color appears matters?? */
body {
  background-image: url('assets/BackgroundWebAllCharsOrangeNewVerSmaller.png');
  background-attachment: fixed;
  background-repeat: repeat;
  background-color: #781015;
  animation: animatedBackground 12s linear infinite;
  z-index: -1;
}

@keyframes animatedBackground {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 1034px -611px;
  }
}

.calculator-container {
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-medium);
  max-width: 800px;
  width: 100%;
  overflow: hidden;
}

.calculator-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  color: white;
  padding: 30px;
  text-align: center;
}
.calculator-header h1 {
  font-size: 2em;
  margin-bottom: 10px;
}

.calculator-header p {
  opacity: 0.9;
  font-size: 1.1em;
}

.currency-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  flex-wrap: wrap;
}

.currency-toggle label {
  color: white;
  font-weight: 600;
  margin: 0;
  font-size: 0.95em;
}

.currency-selector {
  position: relative;
}

.currency-selector select {
  padding: 8px 35px 8px 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23781015' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
}

.currency-selector select:hover {
  background: white;
  border-color: rgba(255, 255, 255, 0.5);
}

.currency-selector select:focus {
  outline: none;
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.exchange-rate-info {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85em;
  margin-top: 5px;
  font-style: italic;
}

.loading-rates {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9em;
}

.calculator-body {
  padding: 40px;
}
.form-group {
  margin-bottom: 30px;
}

label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
  font-size: 1.1em;
}

select,
input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s;
  background: white;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--primary-color);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

.description-box {
  background: var(--background-light);
  border-left: 4px solid var(--primary-color);
  padding: 15px;
  margin-top: 15px;
  border-radius: 5px;
  font-style: italic;
  color: var(--text-light);
}
.commission-preview {
  margin-top: 15px;
  text-align: center;
}

.commission-preview img {
  max-width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-light);
}

.character-list {
  background: var(--background-light);
  padding: 20px;
  border-radius: 10px;
  margin-top: 15px;
}
.character-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 2px solid var(--border-color);
  gap: 15px;
}

.character-left {
  display: flex;
  align-items: center;
  flex: 1;
}
.character-item:last-child {
  margin-bottom: 0;
}

.character-info {
  flex: 1;
}

.character-type {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.character-preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 15px;
  border: 2px solid var(--border-color);
}

.character-price {
  color: var(--primary-color);
  font-size: 0.9em;
}
.character-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.quantity-btn:hover {
  background: var(--primary-dark);
}

.quantity-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.quantity-display {
  font-weight: 600;
  font-size: 1.1em;
  min-width: 30px;
  text-align: center;
}

.remove-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.3s;
}

.remove-btn:hover {
  background: var(--danger-hover);
}

.add-character-btn {
  background: var(--success-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  width: 100%;
  margin-top: 10px;
  transition: background 0.3s;
}

.add-character-btn:hover {
  background: var(--success-hover);
}
.background-selector {
  background: var(--background-light);
  padding: 20px;
  border-radius: 10px;
  margin-top: 15px;
}

.background-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.background-option {
  position: relative;
  cursor: pointer;
  border: 3px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s;
  background: white;
}

.background-option:hover {
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 15, 91, 0.2);
}

.background-option.selected {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(15, 15, 91, 0.2);
}

.background-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.background-option-content {
  padding: 10px;
  text-align: center;
}

.background-option img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 8px;
}

.background-option-name {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.background-option-price {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 0.95em;
}

.background-option-description {
  font-size: 0.8em;
  color: var(--text-light);
  margin-top: 4px;
  line-height: 1.3;
}

.selected-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--secondary-color);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  display: none;
}

.background-option.selected .selected-badge {
  display: block;
}

.price-summary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  color: white;
  padding: 30px;
  border-radius: 15px;
  margin-top: 30px;
}

.price-summary h2 {
  margin-bottom: 20px;
  font-size: 1.5em;
}

.price-breakdown {
  margin-bottom: 20px;
}

.price-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.price-item:last-child {
  border-bottom: none;
}

.total-price {
  display: flex;
  justify-content: space-between;
  font-size: 2em;
  font-weight: 700;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.note {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning-color);
  padding: 15px;
  margin-top: 20px;
  border-radius: 5px;
  color: var(--warning-text);
  font-size: 0.9em;
}

/* Animation Type Selector */
.animation-type-selector {
  margin-top: 10px;
}

#animationComplexity {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  border: 2px solid var(--secondary-color);
  border-radius: 8px;
  background-color: white;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s ease;
}

#animationComplexity:hover {
  border-color: var(--secondary-light);
  box-shadow: 0 2px 8px rgba(15, 15, 91, 0.2);
}

#animationComplexity:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(15, 15, 91, 0.1);
}

/* Contact Message Styling for Pixel Art */
.contact-message {
  background: linear-gradient(
    135deg,
    var(--secondary-color) 0%,
    var(--secondary-light) 100%
  );
  color: white;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  margin-top: 20px;
}

.contact-message h3 {
  font-size: 2em;
  margin-bottom: 15px;
}

.contact-message p {
  font-size: 1.1em;
  margin-bottom: 15px;
  line-height: 1.6;
}

.contact-message p:last-of-type {
  font-weight: 600;
}

.contact-btn {
  display: inline-block;
  background: white;
  color: var(--secondary-color);
  padding: 15px 40px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-light);
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: var(--background-light);
}

/* Animation Type Options - Reuse background selector styling */
.background-option.animation-option {
  background: linear-gradient(
    135deg,
    var(--secondary-color) 0%,
    var(--secondary-light) 100%
  );
  border: 3px solid transparent;
}

.background-option.animation-option:hover {
  border-color: var(--secondary-light);
  transform: translateY(-5px);
}

.background-option.animation-option.selected {
  border-color: var(--secondary-color);
  box-shadow: 0 10px 30px rgba(15, 15, 91, 0.4);
}

@media (max-width: 600px) {
  .calculator-body {
    padding: 20px;
  }

  .character-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .character-left {
    width: 100%;
  }

  .character-controls {
    width: 100%;
    justify-content: space-between;
  }

  .character-preview-img {
    width: 50px;
    height: 50px;
  }

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

  .background-option img {
    height: 80px;
  }
}
