/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4a6fa5;
  --primary-dark: #345a8a;
  --secondary-color: #ff9900;
  --danger-color: #e74c3c;
  --text-color: #333;
  --light-text: #fafafa;
  --background-color: #f5f7fa;
  --card-background: #ffffff;
  --border-color: #e1e5eb;
  --success-color: #2ecc71;
  --commercial-zone: rgba(74, 111, 165, 0.3);
  --industrial-zone: rgba(231, 76, 60, 0.3);
  --residential-zone: rgba(46, 204, 113, 0.3);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Game Container */
#game-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: #f0f0f0;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: #e0e0e0;
}

.primary-btn {
  background-color: var(--primary-color);
  color: var(--light-text);
}

.primary-btn:hover {
  background-color: var(--primary-dark);
}

.danger-btn {
  background-color: var(--danger-color);
  color: var(--light-text);
}

.danger-btn:hover {
  background-color: #c0392b;
}

/* Screens */
.screen {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--background-color);
  transition: opacity 0.5s ease;
}

/* Loading Screen */
#loading-screen {
  z-index: 10;
  background-color: var(--primary-color);
}

.logo-container {
  margin-bottom: 40px;
}

.logo-container img {
  width: 200px;
  height: 200px;
}

.loading-bar {
  width: 300px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background-color: var(--secondary-color);
  width: 0%;
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* Login Screen */
.login-container {
  background-color: var(--card-background);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 400px;
  max-width: 90%;
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
}

.avatar-selector {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.avatar-option {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-option:hover, .avatar-option.selected {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-container button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  font-size: 16px;
}

/* Game Screen */
#game-screen {
  display: flex;
  flex-direction: column;
}

/* Top Bar */
#top-bar {
  height: 60px;
  background-color: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 5;
}

.player-info {
  display: flex;
  align-items: center;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 10px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-details {
  display: flex;
  flex-direction: column;
}

#player-name {
  font-weight: 600;
}

#player-money {
  color: var(--success-color);
  font-weight: 500;
}

.game-controls {
  display: flex;
  gap: 10px;
}

/* Map Container */
#map-container {
  flex: 1;
  overflow: auto;
  position: relative;
}

#virtual-land {
  display: grid;
  grid-template-columns: repeat(50, 40px);
  grid-template-rows: repeat(50, 40px);
  gap: 1px;
  background-color: #ddd;
  transform-origin: 0 0;
}

.land-cell {
  width: 40px;
  height: 40px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.land-cell:hover {
  transform: scale(1.1);
  z-index: 2;
}

.land-cell.commercial {
  background-color: var(--commercial-zone);
}

.land-cell.industrial {
  background-color: var(--industrial-zone);
}

.land-cell.residential {
  background-color: var(--residential-zone);
}

.land-cell.occupied {
  border: 1px solid #999;
}

.business-icon {
  width: 30px;
  height: 30px;
  pointer-events: none;
}

/* Popup */
.popup {
  position: absolute;
  background-color: var(--card-background);
  width: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
}

.popup-header h3 {
  margin: 0;
  font-size: 18px;
}

.popup-content {
  padding: 15px;
}

.business-details p {
  margin-bottom: 8px;
}

.business-actions {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demand-indicators {
  margin-top: 10px;
}

.demand-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.demand-item img {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

.demand-bar {
  flex: 1;
  height: 10px;
  background-color: #eee;
  border-radius: 5px;
  overflow: hidden;
}

.demand-level {
  height: 100%;
  background-color: var(--primary-color);
}

/* Bottom Controls */
#bottom-controls {
  height: 80px;
  background-color: var(--card-background);
  border-top: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  z-index: 5;
}

.business-selector {
  display: flex;
  gap: 15px;
  align-items: center;
}

.business-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.business-option:hover, .business-option.selected {
  background-color: rgba(74, 111, 165, 0.1);
}

.business-option img {
  width: 30px;
  height: 30px;
  margin-bottom: 5px;
}

.business-option .cost {
  font-size: 12px;
  color: #666;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.modal-content {
  background-color: var(--card-background);
  border-radius: 8px;
  width: 600px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  padding: 20px;
}

/* Leaderboard */
#leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

#leaderboard-table th, #leaderboard-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

#leaderboard-table th {
  font-weight: 600;
  background-color: #f5f5f5;
}

/* Build Modal */
.business-type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.business-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  height: 100px;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.business-type-option.selected {
  border-color: var(--primary-color);
  background-color: rgba(74, 111, 165, 0.1);
}

.business-type-option img {
  width: 40px;
  height: 40px;
  margin-bottom: 5px;
}

.business-type-option .cost {
  font-size: 12px;
  color: #666;
}

#confirm-build {
  width: 100%;
  margin-top: 20px;
}

/* Notification system */
#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
}

.notification {
  background-color: var(--card-background);
  border-left: 4px solid var(--primary-color);
  padding: 12px 15px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

.notification.error {
  border-left-color: var(--danger-color);
}

.notification.success {
  border-left-color: var(--success-color);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
  .avatar-selector {
    justify-content: center;
    gap: 15px;
  }
  
  .business-selector {
    overflow-x: auto;
    padding-bottom: 5px;
  }
  
  .business-type-selector {
    justify-content: center;
  }
}

/* Zoom controls */
.zoom-controls {
  position: absolute;
  bottom: 100px;
  right: 20px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.zoom-btn {
  padding: 8px;
  font-size: 18px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-color);
}

.zoom-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.zoom-level {
  text-align: center;
  padding: 5px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
} 