/* Modern BadAim App - CSS Styles */

/* Base styles and variables */
:root {
  /* Modern color palette */
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #f72585;
  --secondary-dark: #e91e78;
  --accent: #7209b7;
  --success: #4cc9f0;
  --warning: #fb8500;
  --danger: #e5383b;
  
  /* Neutral colors */
  --dark: #1f2641;
  --dark-blue: #293158;
  --medium: #4f5d75;
  --light: #f8f9fa;
  --white: #ffffff;
  
  /* Typography */
  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
}

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

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--dark);
  background-color: #f5f8ff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--dark);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

.hidden {
  display: none !important;
}

/* Header styles */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  padding: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
  margin-right: 0.5rem;
}

.logo h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.tagline {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.9;
}

/* Form styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--medium);
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.9rem;
  border: 1px solid rgba(79, 93, 117, 0.2);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-main);
  transition: all 0.2s;
  background-color: var(--white);
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

input[type="radio"] {
  margin-right: 0.5rem;
}

/* Button styles */
button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.secondary-button {
  background-color: var(--medium);
}

.secondary-button:hover {
  background-color: #424e64;
}

.secondary-button.editing {
  background-color: var(--danger);
}

.secondary-button.editing:hover {
  background-color: #d22f31;
}

/* Error message */
.error-message {
  background-color: rgba(229, 56, 59, 0.1);
  color: var(--danger);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--danger);
}

/* Section styles */
section {
  background-color: var(--white);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

section h2 {
  color: var(--dark);
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(79, 93, 117, 0.1);
}

main {
  flex: 1;
  padding: 2rem 0;
}

/* Share link styles */
#share-container {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(79, 93, 117, 0.1);
}

.share-options {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.share-link-container {
  display: flex;
  gap: 0.5rem;
}

#share-link, #game-share-link {
  flex: 1;
  font-size: 0.9rem;
  padding: 0.8rem;
  background-color: rgba(79, 93, 117, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(79, 93, 117, 0.1);
}

#copy-link, #copy-game-link {
  white-space: nowrap;
  background-color: var(--success);
}

#copy-link:hover, #copy-game-link:hover {
  background-color: #34b5dd;
}

.qr-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

#qrcode, #game-qrcode {
  background-color: var(--white);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(79, 93, 117, 0.1);
}

#qrcode img, #game-qrcode img {
  display: block;
  max-width: 100%;
}

.qr-code-container p {
  font-size: 0.9rem;
  color: var(--medium);
  margin: 0;
}

@media (min-width: 768px) {
  .share-options {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .share-link-container,
  .qr-code-container {
    flex: 1;
  }
}

/* Game board styles */
.game-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .game-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }
}

#current-game-name {
  font-size: 1.75rem;
  margin: 0;
  color: var(--dark);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(79, 93, 117, 0.1);
  flex: 1;
}

#turn-status {
  font-weight: 600;
  color: var(--secondary);
  background-color: rgba(247, 37, 133, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  display: inline-block;
  font-size: 0.95rem;
}

.game-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.game-actions button {
  flex: 1;
  min-width: 120px;
}

#start-game {
  background-color: var(--success);
}

#start-game:hover {
  background-color: #34b5dd;
}

.players-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .players-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .players-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

.player-card {
  border: 2px solid rgba(79, 93, 117, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  transition: all 0.3s;
  background-color: var(--white);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03);
}

.player-card.current-player {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
}

.player-card.current-turn {
  border-color: var(--secondary);
  box-shadow: 0 4px 12px rgba(247, 37, 133, 0.15);
}

.player-card.winner {
  border-color: gold;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 255, 255, 1) 100%);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.player-card.winner::before {
  content: "👑";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
}

.player-card h3 {
  font-size: 1.2rem;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.game-info {
  font-size: 0.9rem;
  color: var(--medium);
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.75rem;
  background-color: rgba(79, 93, 117, 0.05);
  border-radius: 50px;
  display: inline-block;
}

.score {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 1rem 0;
  color: var(--dark);
}

.turns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.turn {
  background-color: rgba(79, 93, 117, 0.08);
  padding: 0.35rem 0.7rem;
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--medium);
  transition: all 0.2s;
}

.turn:hover {
  background-color: rgba(79, 93, 117, 0.12);
}

.turn.bust {
  background-color: var(--danger);
  color: white;
}

.turn.bust:hover {
  background-color: #d32f2f;
}

/* Score input section */
#score-input-container {
  margin-top: 2rem;
  padding: 1.75rem;
  background-color: var(--white);
  border-radius: 12px;
  border-left: 4px solid var(--secondary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.dart-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 600px) {
  .dart-inputs {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dart-input {
  width: 100%;
}

.dart-input label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.dart-input input {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
}

.total-score {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1rem 0 1.5rem;
  color: var(--secondary);
  padding: 0.75rem 1rem;
  background-color: rgba(247, 37, 133, 0.08);
  border-radius: 8px;
  display: inline-block;
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-actions button {
  flex: 1;
  min-width: 140px;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(31, 38, 65, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal.visible {
  display: flex;
}

.modal-content {
  background-color: var(--white);
  border-radius: 12px;
  max-width: 90%;
  width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  overflow-x: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(79, 93, 117, 0.1);
  background-color: rgba(79, 93, 117, 0.03);
}

.modal-header h3 {
  margin: 0;
  color: var(--dark);
  font-size: 1.3rem;
}

.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--medium);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-button:hover {
  background-color: rgba(79, 93, 117, 0.1);
  color: var(--dark);
  box-shadow: none;
  transform: none;
}

.modal-body {
  padding: 1.5rem;
}

/* Game Over Modal */
.game-over-content {
  max-width: 600px;
}

.winner-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.trophy-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  animation: bounce 1s ease infinite alternate;
}

@media (max-width: 600px) {
  .trophy-icon {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
  }
}

@keyframes bounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-10px);
  }
}

.winner-section h2 {
  margin: 0;
  font-size: 2.2rem;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.winner-subtitle {
  color: var(--medium);
  font-size: 1.2rem;
  margin: 0;
}

@media (max-width: 600px) {
  .winner-section h2 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
  }
  
  .winner-subtitle {
    font-size: 1rem;
  }
}

.game-stats {
  background-color: rgba(79, 93, 117, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.game-stats h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--dark);
  text-align: center;
}

@media (max-width: 600px) {
  .game-stats {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .game-stats h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background-color: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--medium);
}

@media (max-width: 600px) {
  .stat-card {
    padding: 0.75rem 0.5rem;
  }
  
  .stat-value {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .stats-grid {
    gap: 0.5rem;
  }
}

.player-rankings {
  margin-bottom: 1.5rem;
}

.player-rankings h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--dark);
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background-color: white;
  margin-bottom: 0.8rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

@media (max-width: 600px) {
  .player-rankings {
    margin-bottom: 1rem;
  }
  
  .player-rankings h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .ranking-item {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
  }
}

.ranking-position {
  font-weight: 700;
  font-size: 1.2rem;
  margin-right: 1rem;
  color: var(--medium);
  width: 30px;
  text-align: center;
}

.ranking-position.first {
  color: #ffd700; /* Gold */
}

.ranking-position.second {
  color: #c0c0c0; /* Silver */
}

.ranking-position.third {
  color: #cd7f32; /* Bronze */
}

.ranking-name {
  font-weight: 600;
  flex: 1;
}

.ranking-score {
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  background-color: rgba(79, 93, 117, 0.1);
  color: var(--dark);
}

@media (max-width: 600px) {
  .ranking-position {
    font-size: 1rem;
    margin-right: 0.5rem;
    width: 25px;
  }
  
  .ranking-name {
    font-size: 0.9rem;
  }
  
  .ranking-score {
    font-size: 0.9rem;
    padding: 0.2rem 0.6rem;
  }
}

.more-players-msg {
  text-align: center;
  color: var(--medium);
  font-size: 0.9rem;
  padding: 0.5rem;
  font-style: italic;
}

.game-over-actions {
  display: flex;
  gap: 1rem;
}

.game-over-actions button {
  flex: 1;
}

.primary-button {
  background-color: var(--primary);
}

.primary-button:hover {
  background-color: var(--primary-dark);
}

@media (max-width: 600px) {
  .game-over-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .game-over-actions button {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-header h3 {
    font-size: 1.1rem;
  }
}

/* Footer styles */
footer {
  background-color: var(--dark-blue);
  color: var(--white);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.footer-brand {
  font-size: 1.4rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.footer-domain {
  color: var(--success);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  section {
    padding: 1.5rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .modal-content {
    width: 95%;
  }
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(247, 37, 133, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(247, 37, 133, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(247, 37, 133, 0);
  }
}

.current-turn {
  animation: pulse 2s infinite;
}