/* Buttons */
.create-game-button, .join-game-button {
  padding: 16px 0;
  width: 85%;
  text-align: center;
  font-size: 18px;
  color: var(--light-color);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  margin-bottom: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.create-game-button {
  background-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(211, 84, 0, 0.3);
}

.join-game-button {
  background-color: var(--secondary-color);
  box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.button-icon {
  margin-right: 10px;
  font-size: 18px;
}

.create-game-button:before, .join-game-button: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: all 0.6s;
}

.create-game-button:hover:before, .join-game-button:hover:before {
  left: 100%;
}

.create-game-button:hover, .join-game-button:hover {
  transform: translateY(-3px);
}

.create-game-button:active, .join-game-button:active {
  transform: scale(0.98);
}

/* Back button */
.back-button {
  position: absolute;
  background: none;
  border: none;
  color: var(--light-color);
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-button::before {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--light-color);
  border-left: 2px solid var(--light-color);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.back-button:hover::before {
  transform: rotate(-45deg) scale(1.2);
}





/* Forms */
.join-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
  margin-right: -10px;
  padding-right: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  font-size: 14px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}

.form-label::before {
  content: "▶";
  color: #e74c3c;
  font-size: 10px;
  margin-right: 8px;
}

.form-control {
  padding: 10px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--light-color);
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.2);
}

/* Duration slider styling */
.duration-control {
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.duration-control input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #2980b9, #e74c3c);
  outline: none;
  transition: opacity .2s;
}

.duration-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ecf0f1;
  cursor: pointer;
  border: 2px solid #e74c3c;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.duration-control input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ecf0f1;
  cursor: pointer;
  border: 2px solid #e74c3c;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.duration-value {
  min-width: 60px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: #ecf0f1;
  font-family: 'Orbitron', sans-serif;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Submit button */
.submit-button, .join-button {
  padding: 15px 15px calc(15px + var(--sab));
  background-color: #e74c3c;
  color: #ecf0f1;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  transition: all 0.3s;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2010;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
}

.join-button {
  background-color: #2980b9;
  box-shadow: 0 4px 15px rgba(41, 128, 185, 0.3);
}

.submit-button:before, .join-button: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: all 0.6s;
}

.submit-button:hover:before, .join-button:hover:before {
  left: 100%;
}

.submit-button:hover, .join-button:hover {
  background-color: #c0392b;
  transform: none;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
}

.join-button:hover {
  background-color: #1c638b;
  box-shadow: 0 -6px 20px rgba(41, 128, 185, 0.4);
}

.submit-button:active, .join-button:active {
  transform: none;
  opacity: 0.9;
}

.submit-button:disabled, .join-button:disabled {
  background-color: #555;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Game share elements */
.share-container {
  margin-top: 20px;
  background-color: rgba(20, 20, 20, 0.8);
  padding: 15px;
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-title {
  font-size: 16px;
  margin-bottom: 15px;
  color: #FFD700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.copy-button, .telegram-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  min-width: 120px;
}

.telegram-button {
  background-color: #0088cc;
}

.copy-button:hover, .telegram-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.copy-button:active, .telegram-button:active {
  transform: translateY(0);
}

.copy-success {
  color: #4CAF50;
  font-size: 14px;
  margin-top: 5px;
  display: none;
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  margin-right: -10px;
  padding-right: 10px;
}

.no-games-message, .error-message {
  text-align: center;
  padding: 20px;
  color: #aaa;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  margin: 10px 0;
}

.error-message {
  color: #ff3333;
  border: 1px solid rgba(255, 0, 0, 0.2);
}

/* Spinner Component Styles */
.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.spinner.small {
  padding: 5px;
}

.spinner.large {
  padding: 15px;
}

.spinner-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; /* Ensure enough width for animation */
  overflow: hidden; /* Keep dots contained */
  position: relative; /* Important for absolute positioning within */
  height: 10px;
}

.spinner-dot {
  border-radius: 50%;
  position: absolute; /* Allows dots to overlap during animation */
}

.spinner-message {
  margin-top: 10px;
  color: var(--light-color);
  font-size: 14px;
  text-align: center;
}


/* Refresh spinner specific styles */
.refresh-spinner {
  position: absolute;
  top: 13px;
  right: 45px;
  background-color: rgba(20, 20, 20, 0.7); /* Darker background for contrast */
  border-radius: 12px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2); /* More visible border */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); /* Add shadow for depth */
}

/* Game list spinner */
.game-list-spinner {
  width: 100%;
  height: 100px;
  background-color: rgba(20, 20, 20, 0.5);
  border-radius: var(--border-radius);
  margin: 10px 0;
}

/* Make sure the game list has a minimum height for consistency */
#gameList {
  min-height: 150px;
  position: relative;
}

/* Joining state for game card */
.game-card.joining .spinner-overlay {
  backdrop-filter: blur(2px);
  border-radius: 6px;
}
