/* 
 * Climate Game - Main CSS file
 * Some styles may be overridden by inline styles on specific pages 
 * for optimal layout on different screen sizes.
 */

:root {
  --primary-color: #4CAF50;
  --primary-dark: #388E3C;
  --primary-light: #C8E6C9;
  --secondary-color: #2196F3;
  --secondary-dark: #1976D2;
  --accent-color: #FF9800;
  --text-color: #333333;
  --text-light: #FFFFFF;
  --background-color: #E8F5E9;
  --card-color: #FFFFFF;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --success-color: #4CAF50;
  --warning-color: #FFC107;
  --danger-color: #F44336;
  --info-color: #2196F3;
}

/* Base Styles */
body {
  font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('images/climate-main-4.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: 1;
  z-index: -1;
}

/* Game Header */
.game-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-light);
  padding: 1rem 2rem;
  border-radius: 0 0 10px 10px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 10px var(--shadow-color);
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

/* Main Game Container */
.game-container {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.game-content {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Map Container */
.map-section {
  flex: 1;
  position: relative;
}

#mapContainer {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 16px var(--shadow-color);
  transition: transform 0.2s;
}

#mapContainer:hover {
  transform: scale(1.01);
}

/* Dashboard Panel */
.dashboard-panel {
  width: 350px;
  background-color: var(--card-color);
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--shadow-color);
  padding: 1.5rem;
}

.player-info {
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 1rem;
}

.player-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
}

.difficulty-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

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

.intermediate {
  background-color: var(--warning-color);
  color: var(--text-color);
}

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

/* Resource Indicators */
.resource-section {
  margin-bottom: 1.5rem;
}

.resource-title {
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.resource-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.resource-item {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  cursor: default;
  position: relative;
}

.resource-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.resource-icon {
  width: 32px;
  height: 32px;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.resource-details {
  flex: 1;
}

.resource-name {
  font-size: 0.9rem;
  margin: 0;
  color: #666;
}

.resource-value {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-color);
}

/* Resource Change Animation Effects */
.resource-change {
  transition: color 0.3s, transform 0.3s;
}

.resource-increase {
  color: var(--success-color);
  animation: pulseGrow 0.5s ease-in-out;
}

.resource-decrease {
  color: var(--danger-color);
  animation: pulseShrink 0.5s ease-in-out;
}

@keyframes pulseGrow {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulseShrink {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

/* Impact Score */
.impact-score {
  margin-bottom: 1.5rem;
}

.impact-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.impact-title {
  font-weight: 600;
  color: var(--primary-dark);
}

.impact-value {
  font-weight: 700;
}

.impact-score-container.pulse-highlight {
  animation: impactPulse 1.5s ease-in-out;
}

@keyframes impactPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

.progress {
  height: 12px;
  background-color: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 6px;
  transition: width 0.6s ease;
}

/* Game Time */
.game-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--primary-dark);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.term, .year {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-label {
  font-size: 0.8rem;
  opacity: 0.8;
}

.time-value {
  font-size: 1.3rem;
  font-weight: 700;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-button {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(33, 150, 243, 0.4);
}

.action-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.action-button-secondary {
  background: linear-gradient(135deg, var(--accent-color), #E65100);
  box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.action-button-secondary:hover {
  box-shadow: 0 6px 12px rgba(255, 152, 0, 0.4);
}

.action-button-secondary:active {
  box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

/* Status Area */
.status-area {
  background-color: var(--card-color);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 8px var(--shadow-color);
}

.status-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.status-content {
  font-size: 1rem;
  color: #555;
}

/* Event Ticker */
.event-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(33, 33, 33, 0.9);
  color: white;
  padding: 0.75rem 0;
  z-index: 1000;
  overflow: hidden;
}

.ticker-text {
  white-space: nowrap;
  display: inline-block;
  animation: ticker 15s linear infinite;
  padding-left: 100%;
  font-size: 1rem;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Modals */
.game-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: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.game-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card-color);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.game-modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 1.2rem 1.5rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 1.5rem;
}

.decision-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.decision-item {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid transparent;
}

.decision-item:hover {
  background-color: #eef7ee;
  border-left-color: var(--primary-color);
  transform: translateX(5px);
}

.decision-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 8px;
  flex-shrink: 0;
}

.decision-content {
  flex: 1;
}

.decision-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.decision-description {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

.decision-costs {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cost-item {
  font-size: 0.85rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.cost-icon {
  width: 18px;
  height: 18px;
}

.modal-footer {
  background-color: #f5f5f5;
  padding: 1rem 1.5rem;
  border-radius: 0 0 12px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.modal-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn-cancel {
  background-color: #e0e0e0;
  color: #555;
}

.modal-btn-cancel:hover {
  background-color: #d5d5d5;
}

.modal-btn-confirm {
  background-color: var(--primary-color);
  color: white;
}

.modal-btn-confirm:hover {
  background-color: var(--primary-dark);
}

/* Education Portal Styles */
.education-portal {
  background-color: var(--card-color);
  border-radius: 12px;
  box-shadow: 0 8px 16px var(--shadow-color);
  overflow: hidden;
  max-width: 900px;
  margin: 2rem auto;
}

.portal-header {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.portal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.portal-content {
  padding: 2rem;
}

.quiz-card {
  background-color: #f9f9f9;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.quiz-question {
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.quiz-options {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.option-item {
  background-color: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  border-color: var(--secondary-color);
  transform: translateX(5px);
}

.option-item.selected {
  border-color: var(--secondary-color);
  background-color: rgba(33, 150, 243, 0.1);
}

.quiz-footer {
  display: flex;
  justify-content: center;
}

.submit-btn {
  padding: 0.8rem 2rem;
  background-color: var(--secondary-color);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .game-content {
    flex-direction: column;
  }
  
  .dashboard-panel {
    width: 100%;
  }
  
  .resource-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .game-header {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .game-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }
  
  .modal-content {
    width: 95%;
  }
}

@media (max-width: 480px) {
  .resource-grid {
    grid-template-columns: 1fr;
  }
  
  .game-time {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .decision-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Animation Effects */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

.slide-up {
  animation: slideUp 0.4s ease forwards;
}

/* Icon Pulse Animation */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--primary-dark);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notification-icon {
  font-size: 1.5rem;
}

.notification-message {
  font-weight: 500;
} 