/* Base styles */
:root {
  --primary-color: #6d78ff;
  --primary-hover: #4d5eff;
  --background-dark: #2c303c;
  --background-card: #3f4150;
  --text-light: #ffffff;
  --text-dim: #cccccc;
  --success-color: #28a745;
  --error-color: #dc3545;
  --marker-color: #2A5C8D;
  --border-radius: 0.75rem;
  --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

html, body {
  height: 100%;
}

body {
  background-color: var(--background-dark);
  font-family: Verdana, sans-serif;
  color: var(--text-light);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Selection styling */
::selection {
  background: var(--primary-color);
  color: var(--text-light);
  text-shadow: none;
}

/* Layout components */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--background-card);
  padding: 1rem 2rem;
  margin: 1rem;
  border-radius: var(--border-radius);
  height: auto;
  min-height: 4rem;
}

.logo-link {
  text-decoration: none;
  color: var(--text-light);
}

.logo {
  display: flex;
  flex-direction: column;
}

.header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.motto {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.2rem;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.header-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.language-switcher {
  display: flex;
  gap: 0.5rem;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-light);
}

main {
  padding: 0 1rem 1rem;
}

.container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  height: calc(100vh - 8rem);
  max-height: calc(100vh - 8rem);
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.control-panel, .info-panel {
  background-color: var(--background-card);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.control-panel {
  flex-shrink: 0;
}

.info-panel {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.map {
  height: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* Form elements */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

input {
  width: 65%;
  padding: 0.75rem;
  border: 2px solid #555;
  border-radius: 0.5rem;
  background-color: var(--background-dark);
  color: var(--text-light);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(109, 120, 255, 0.3);
}

/* Number input */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Range input */
.range-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
}

input[type="range"] {
  -webkit-appearance: none;
  height: 8px;
  background: var(--background-dark);
  border-radius: 4px;
  border: 1px solid #555;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.range-value {
  position: absolute;
  top: 0;
  left: 70%;
  background-color: var(--primary-color);
  padding: 0.2rem 0.6rem;
  border-radius: 0.3rem;
  min-width: 5rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  border-radius: 0.5rem;
  color: var(--text-light);
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #3d4eff);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Info panel content */
.info-panel h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.info-panel h4 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #8f95ff;
}

.info-panel p {
  margin-bottom: 0.75rem;
}

.city-target {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-align: center;
}

.progress-stats {
  background-color: var(--background-dark);
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.stat {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.stat-correct {
  color: var(--success-color);
}

.stat-incorrect {
  color: var(--error-color);
}

.stat-done {
  font-weight: bold;
  margin-bottom: 1rem;
}

.city-list-wrapper {
  max-height: 150px;
  overflow-y: auto;
  margin-top: 0.5rem;
  border-radius: 0.3rem;
  background-color: rgba(44, 48, 60, 0.7);
}

.city-list {
  list-style-type: none;
  padding: 0.5rem;
}

.city-list li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #4d4f5c;
}

.city-list li:last-child {
  border-bottom: none;
}

.play-again {
  margin-top: 1rem;
  color: var(--primary-color);
  font-weight: bold;
}

/* Notification system */
.notification {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: bold;
  z-index: 1000;
  display: none;
  max-width: 80%;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-in-out;
}

.notification-success {
  background-color: var(--success-color);
}

.notification-error {
  background-color: var(--error-color);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow-y: auto;
  }

  .sidebar {
    display: contents;
  }

  .control-panel {
    order: 1;
    margin-bottom: 1rem;
  }

  .map {
    order: 2;
    height: 50vh;
    margin-bottom: 1rem;
  }

  .info-panel {
    order: 3;
  }

  .header {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
  }

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

  .header-right {
    align-items: center;
  }

  .language-switcher {
    margin-top: 0.5rem;
  }
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn-secondary {
  background-color: #6c757d;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  color: var(--text-light);
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.popup-content {
  background-color: var(--background-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--box-shadow);
  animation: popupAppear 0.3s ease-out;
}

@keyframes popupAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.popup-content h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.8rem;
}

.popup-stats {
  background-color: var(--background-dark);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.popup-cities {
  margin-bottom: 1.5rem;
}

.popup-cities h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.popup-cities .city-list-wrapper {
  max-height: 200px;
}

.popup-content .btn-primary {
  display: block;
  margin: 0 auto;
}
