/* Singularity Game - Main Styles */

/* Game Information Section Styles */
.game-info {
  background: linear-gradient(135deg, #1a1d29 0%, #232837 100%);
  border-top: 1px solid var(--card-border);
}

.info-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  height: 100%;
  transition: all 0.3s ease;
}

.info-card:hover {
  border-color: var(--highlight-blue);
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.2);
  transform: translateY(-2px);
}

.info-card h4 {
  color: var(--highlight-purple);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-card h4 i {
  font-size: 1.2rem;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--main-fg);
  line-height: 1.5;
}

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

.info-list li strong {
  color: var(--highlight-cyan);
  font-weight: 600;
}

.game-description .lead {
  color: var(--main-fg);
  opacity: 0.9;
}

.game-description .text-muted {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  color: var(--main-fg);
  opacity: 0.8;
}

.game-description .text-muted i {
  color: var(--highlight-blue);
  margin-right: 0.5rem;
}

:root {
  --sidebar-bg: #181c24;
  --sidebar-fg: #fff;
  --main-bg: #232837;
  --main-fg: #e6eaf3;
  --accent: #8f5cff; /* Vibrant purple/blue */
  --accent-glow: 0 0 12px #8f5cffcc;
  --border-radius: 12px;
  --spacing: 1.5rem;
  --card-bg: #22263a;
  --card-border: #2e3350;
  --highlight-blue: #4f8cff;
  --highlight-purple: #a18fff;
  --highlight-pink: #ff5cf4;
  --highlight-cyan: #5cfff7;
  --highlight-green: #6ad29e;
  --highlight-red: #c44747;
  --rgb-gradient: linear-gradient(90deg, #8f5cff, #4f8cff, #5cfff7, #ff5cf4, #8f5cff);
}

body {
  background: var(--main-bg);
  color: var(--main-fg);
  font-family: 'Segoe UI', Arial, sans-serif;
}

.game-main-container {
  display: flex;
  min-height: 80vh;
  max-width: 1400px;
  margin: 1rem auto;
  gap: var(--spacing);
  padding: 0 1rem;
}

.resource-sidebar {
  position: sticky;
  top: 2rem;
  min-width: 220px;
  max-width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border-radius: var(--border-radius);
  padding: 1.2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  height: fit-content;
  z-index: 10;
  flex-shrink: 0;
}

.resource-sidebar h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--highlight-purple);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* New Resource Container Design */
.resource-container {
  position: relative;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem 1.2rem 1.2rem 1.2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.resource-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.resource-container:hover::before {
  opacity: 1;
}

.resource-container:hover {
  border-color: var(--highlight-blue);
  box-shadow: 0 4px 16px rgba(79,140,255,0.2);
  transform: translateY(-1px);
}

.resource-header {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sidebar-bg);
  color: var(--highlight-purple);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 2px solid var(--card-border);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.resource-container:hover .resource-header {
  color: var(--highlight-blue);
  border-color: var(--highlight-blue);
  box-shadow: 0 2px 8px rgba(79,140,255,0.3);
}

.resource-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.5rem;
}

.resource-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sidebar-fg);
  text-align: center;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.resource-rate {
  font-size: 0.8rem;
  color: var(--highlight-green);
  font-weight: 500;
  text-align: center;
  opacity: 0.9;
  letter-spacing: 0.3px;
  background: rgba(106, 210, 158, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(106, 210, 158, 0.2);
}

/* Compact Resource Display Styles */
.resource-main-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sidebar-fg);
  text-align: center;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  line-height: 1.2;
}

.resource-rate-value {
  font-size: 0.7rem;
  color: var(--highlight-green);
  font-weight: 500;
  text-align: center;
  opacity: 0.9;
  letter-spacing: 0.2px;
  background: rgba(106, 210, 158, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(106, 210, 158, 0.2);
  margin-top: 0.3rem;
  white-space: nowrap;
}

/* LLM Game Tab Navigation */
.tab-navigation {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--card-border);
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-button {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  color: var(--main-fg);
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.tab-button:hover {
  border-color: var(--highlight-blue);
  background: rgba(79, 140, 255, 0.1);
  transform: translateY(-1px);
}

.tab-button.active {
  background: var(--highlight-blue);
  border-color: var(--highlight-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 140, 255, 0.3);
}

.tab-content {
  min-height: 400px;
}

/* Data Collection Tab */
.data-collection-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.manual-collection, .auto-collection {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.manual-collection h3, .auto-collection h3 {
  color: var(--highlight-blue);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.action-button.large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.collection-stats, .auto-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.stat-label {
  color: var(--main-fg);
  opacity: 0.8;
}

.stat-value {
  color: var(--highlight-green);
  font-weight: 600;
}

/* Model Training Tab */
.model-training-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.current-training, .available-models {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.current-training h3, .available-models h3 {
  color: var(--highlight-purple);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.training-model-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--card-border);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--highlight-blue), var(--highlight-purple));
  transition: width 0.3s ease;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.model-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  transition: all 0.3s ease;
}

.model-card:hover {
  border-color: var(--highlight-purple);
  transform: translateY(-2px);
}

.model-card.locked {
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(46, 51, 80, 0.5);
  opacity: 0.7;
}

.model-card.locked:hover {
  border-color: var(--highlight-purple);
  box-shadow: 0 4px 16px rgba(161, 143, 255, 0.2);
  transform: translateY(-1px);
  opacity: 0.9;
}

.unlock-requirement {
  background: rgba(161, 143, 255, 0.1);
  border: 1px solid rgba(161, 143, 255, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  color: var(--highlight-purple);
  font-size: 0.9rem;
}

.locked-preview {
  opacity: 0.6;
}

/* Business Tab Styles (Phase 20) */
.business-section {
  padding: 1rem;
}

.business-metrics {
  margin-bottom: 2rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(46, 51, 80, 0.8);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--highlight-green);
}

.metric-sublabel {
  font-size: 0.85rem;
  color: var(--main-fg);
  opacity: 0.8;
  margin-top: 0.25rem;
  font-weight: 400;
}

.market-segments {
  margin-top: 2rem;
}

.segments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.segment-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(46, 51, 80, 0.8);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.segment-card:hover {
  border-color: var(--highlight-purple);
  transform: translateY(-2px);
}

.segment-card.locked {
  opacity: 0.7;
  border-color: rgba(46, 51, 80, 0.5);
}

.segment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

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

.segment-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-primary);
}

.segment-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.unlock-requirement {
  background: rgba(161, 143, 255, 0.1);
  border: 1px solid rgba(161, 143, 255, 0.3);
  border-radius: 6px;
  padding: 0.5rem;
  margin-bottom: 1rem;
  color: var(--highlight-purple);
  font-size: 0.85rem;
  text-align: center;
}

.segment-stats {
  display: grid;
  gap: 0.3rem;
}

.segment-stats .stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.locked-stats .stat {
  opacity: 0.6;
}

/* Business Charts Styles */
.business-charts {
  margin-top: 2rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.chart-container {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(46, 51, 80, 0.8);
  border-radius: 12px;
  padding: 1rem;
  min-height: 200px;
}

.chart-title {
  font-size: 1rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.chart-area {
  height: 120px;
  position: relative;
  margin-bottom: 1rem;
}

.chart-bars {
  height: 100%;
  position: relative;
  background: linear-gradient(to top, rgba(46, 51, 80, 0.3) 0%, transparent 100%);
  border-radius: 4px;
}

.chart-bar {
  position: absolute;
  bottom: 0;
  background: linear-gradient(to top, var(--highlight-blue), var(--highlight-purple));
  border-radius: 2px 2px 0 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chart-bar:hover {
  background: linear-gradient(to top, var(--highlight-green), var(--highlight-blue));
  transform: scaleY(1.1);
}

.chart-current-value {
  text-align: center;
  font-size: 0.9rem;
  color: var(--highlight-green);
  font-weight: bold;
}

.chart-no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Market Share Chart */
.market-share-chart {
  display: grid;
  gap: 0.5rem;
}

.market-share-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.5rem;
  align-items: center;
}

.market-share-label {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.market-share-bar {
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.market-share-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.market-share-value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

/* Market Segment Selector */
.market-segment-selector {
  margin: 1rem 0;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.market-segment-selector label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.segment-select {
  width: 100%;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(46, 51, 80, 0.8);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.segment-select:focus {
  outline: none;
  border-color: var(--highlight-purple);
  box-shadow: 0 0 0 2px rgba(161, 143, 255, 0.2);
}

.segment-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.segment-select option:disabled {
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Segment Badge */
.segment-badge {
  background: rgba(161, 143, 255, 0.2);
  color: var(--highlight-purple);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.model-header {
  margin-bottom: 1rem;
}

.model-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--highlight-purple);
  margin-bottom: 0.5rem;
}

.model-description {
  color: var(--main-fg);
  opacity: 0.8;
  font-size: 0.9rem;
}

.model-stats {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.model-cost {
  color: var(--highlight-cyan);
  font-weight: 500;
  margin-bottom: 1rem;
}

.train-button {
  width: 100%;
  background: var(--highlight-purple);
  border: none;
  color: white;
  padding: 0.8rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.train-button:hover:not(:disabled) {
  background: var(--highlight-pink);
  transform: translateY(-1px);
}

.train-button:disabled {
  background: var(--card-border);
  color: var(--main-fg);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Infrastructure Tab */
.infrastructure-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.infrastructure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.infrastructure-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.infrastructure-card:hover {
  border-color: var(--highlight-green);
  transform: translateY(-2px);
}

.infra-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.infra-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--highlight-green);
}

.infra-count {
  color: var(--main-fg);
  opacity: 0.8;
}

.infra-description {
  color: var(--main-fg);
  opacity: 0.8;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.infra-cost, .infra-generation {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.infra-cost {
  color: var(--highlight-cyan);
}

.infra-generation {
  color: var(--highlight-green);
}

.buy-infrastructure-button {
  width: 100%;
  background: var(--highlight-green);
  border: none;
  color: white;
  padding: 0.8rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.buy-infrastructure-button:hover:not(:disabled) {
  background: var(--highlight-cyan);
  transform: translateY(-1px);
}

.buy-infrastructure-button:disabled {
  background: var(--card-border);
  color: var(--main-fg);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Deployment Tab */
.deployment-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.deployed-models, .available-deployments {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.deployed-models h4, .available-deployments h4 {
  color: var(--highlight-pink);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.deployment-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.deployment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.deployment-name {
  font-weight: 600;
  color: var(--highlight-pink);
}

.deployment-revenue {
  color: var(--highlight-green);
  font-weight: 600;
}

.deployment-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.utilization-bar {
  width: 100%;
  height: 6px;
  background: var(--card-border);
  border-radius: 3px;
  overflow: hidden;
}

.utilization-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--highlight-green), var(--highlight-cyan));
  transition: width 0.3s ease;
}

.deploy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.deploy-model-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  transition: all 0.3s ease;
}

.deploy-model-card:hover {
  border-color: var(--highlight-pink);
  transform: translateY(-2px);
}

.deploy-button {
  width: 100%;
  background: var(--highlight-pink);
  border: none;
  color: white;
  padding: 0.8rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.deploy-button:hover:not(:disabled) {
  background: var(--highlight-purple);
  transform: translateY(-1px);
}

.deploy-button:disabled {
  background: var(--card-border);
  color: var(--main-fg);
  opacity: 0.5;
  cursor: not-allowed;
}

.redeploy-button {
  width: 100%;
  background: var(--highlight-purple);
  border: 2px solid var(--highlight-purple);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.8rem;
}

.redeploy-button:hover {
  background: var(--highlight-pink);
  border-color: var(--highlight-pink);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 92, 244, 0.3);
}

/* Research Tab */
.research-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.upgrade-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.upgrade-card:hover {
  border-color: var(--highlight-cyan);
  transform: translateY(-2px);
}

.upgrade-card.purchased {
  border-color: var(--highlight-green);
  background: rgba(106, 210, 158, 0.1);
}

.upgrade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.upgrade-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--highlight-cyan);
}

.upgrade-status {
  color: var(--highlight-green);
  font-weight: 600;
  font-size: 0.9rem;
}

.upgrade-description {
  color: var(--main-fg);
  opacity: 0.8;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.upgrade-cost {
  color: var(--highlight-cyan);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.upgrade-requirements {
  font-size: 11px;
  color: var(--highlight-purple);
  margin-bottom: 1rem;
  font-weight: 500;
}

.upgrade-progress {
  margin-top: 1rem;
}

.upgrade-progress .progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.upgrade-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--highlight-purple), var(--highlight-pink));
  transition: width 0.3s ease;
}

.upgrade-progress .progress-text {
  font-size: 0.8rem;
  color: var(--highlight-purple);
  text-align: center;
}

.buy-upgrade-button {
  width: 100%;
  background: var(--highlight-cyan);
  border: none;
  color: white;
  padding: 0.8rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.buy-upgrade-button:hover:not(:disabled) {
  background: var(--highlight-blue);
  transform: translateY(-1px);
}

.buy-upgrade-button:disabled {
  background: var(--card-border);
  color: var(--main-fg);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Research Tree Styles */
.research-panel {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.research-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.research-item {
  position: relative;
  transition: all 0.3s ease;
}

.research-item.available {
  transform: scale(1);
}

.research-item.available:hover {
  transform: scale(1.02);
}

.research-item.purchased {
  opacity: 0.7;
}

.research-item.locked {
  opacity: 0.4;
}

.research-button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-family: inherit;
}

.research-button:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.research-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.research-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffffff;
}

.research-cost {
  font-size: 12px;
  color: #ffd700;
  margin-bottom: 8px;
  font-weight: 500;
}

.research-requirements {
  font-size: 11px;
  color: var(--highlight-orange);
  margin-bottom: 6px;
  font-weight: 500;
}

.research-desc {
  font-size: 13px;
  color: #cccccc;
  line-height: 1.4;
}

.research-progress {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(143, 92, 255, 0.1);
  border: 1px solid rgba(143, 92, 255, 0.3);
  border-radius: 8px;
}

.research-progress .progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.research-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--highlight-purple), var(--highlight-blue));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.research-progress .progress-text {
  font-size: 0.8rem;
  color: var(--highlight-purple);
  text-align: center;
  line-height: 1.3;
}

/* Era-specific research theming */
.research-item[data-era="handcrafted"] .research-button {
  border-left: 4px solid #8B4513;
}

.research-item[data-era="learning"] .research-button {
  border-left: 4px solid #4169E1;
}

.research-item[data-era="deep"] .research-button {
  border-left: 4px solid #9932CC;
}

.research-item[data-era="agi"] .research-button {
  border-left: 4px solid #FFD700;
}

.research-item.purchased .research-button {
  background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 0, 0.05));
  border-color: rgba(0, 255, 0, 0.3);
}

.research-item.purchased .research-name::after {
  content: " ✓";
  color: #00ff00;
  font-weight: bold;
}

/* Responsive research grid */
@media (max-width: 768px) {
  .research-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .research-button {
    padding: 12px;
  }
  
  .research-name {
    font-size: 15px;
  }
  
  .research-cost {
    font-size: 11px;
  }
  
  .research-desc {
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .research-panel {
    margin: 15px 0;
    padding: 15px;
  }
  
  .research-button {
    padding: 10px;
  }
  
  .research-name {
    font-size: 14px;
    margin-bottom: 6px;
  }
  
  .research-cost {
    font-size: 10px;
    margin-bottom: 6px;
  }
  
  .research-desc {
    font-size: 11px;
  }
}

/* Action Button Styles */
.actions-section {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
  justify-content: center;
  align-items: flex-start;
}

.secondary-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-button {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.action-button.primary {
  background: linear-gradient(135deg, var(--accent), var(--highlight-blue));
  color: white;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(143, 92, 255, 0.3);
}

.action-button.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--accent-glow), 0 6px 20px rgba(143, 92, 255, 0.4);
}

.action-button.secondary {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.2), rgba(79, 140, 255, 0.15));
  color: #ffffff;
  padding: 0.7rem 1.5rem;
  font-size: 0.8rem;
  border: 1px solid rgba(143, 92, 255, 0.3);
  box-shadow: 0 2px 8px rgba(143, 92, 255, 0.1);
  min-width: 120px;
}

.action-button.secondary:hover {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.3), rgba(79, 140, 255, 0.2));
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(143, 92, 255, 0.2);
}

.action-button:active {
  transform: translateY(0);
}

/* Auto-clicking accessibility styles */
.action-button.auto-clicking {
  background: linear-gradient(135deg, var(--highlight-green), var(--highlight-cyan));
  box-shadow: 0 0 20px rgba(106, 210, 158, 0.4);
  animation: auto-click-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes auto-click-pulse {
  0% {
    box-shadow: 0 0 20px rgba(106, 210, 158, 0.4);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 30px rgba(106, 210, 158, 0.6);
    transform: scale(1.02);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Purchased Upgrade Compact Styles */
.upgrade-item.purchased {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.1), rgba(79, 140, 255, 0.05));
  border: 1px solid rgba(143, 92, 255, 0.2);
  border-radius: 6px;
  margin-bottom: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upgrade-item.purchased.compact {
  padding: 0.5rem;
}

.upgrade-item.purchased.expanded {
  padding: 1rem;
  margin-bottom: 8px;
}

.upgrade-item.purchased:hover {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.15), rgba(79, 140, 255, 0.08));
  border-color: rgba(143, 92, 255, 0.3);
}

.upgrade-compact-view {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upgrade-compact-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.9rem;
}

.upgrade-compact-status {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(143, 92, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
}

.upgrade-expanded-view {
  display: none;
}

.upgrade-item.purchased.expanded .upgrade-compact-view {
  margin-bottom: 0.5rem;
}

.upgrade-item.purchased.expanded .upgrade-expanded-view {
  display: block;
}

.upgrade-expanded-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.upgrade-expanded-effect {
  color: rgba(143, 92, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Worker Management Styles - Inline Flexbox Layout */
.worker-section {
  margin-top: 2rem;
}

.worker-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.worker-item {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.1), rgba(79, 140, 255, 0.05));
  border: 1px solid rgba(143, 92, 255, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
  flex: 0 1 auto;
}

.worker-item:hover {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.15), rgba(79, 140, 255, 0.08));
  border-color: rgba(143, 92, 255, 0.3);
  transform: translateY(-2px);
}

.worker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.worker-info {
  flex: 1;
}

.worker-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.worker-count {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(143, 92, 255, 0.2);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  display: inline-block;
}

.worker-controls {
  display: flex;
  gap: 0.2rem;
}

.worker-button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.worker-button.hire {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
}

.worker-button.hire:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-1px);
}

.worker-button.fire {
  background: linear-gradient(135deg, #f44336, #da190b);
  color: white;
}

.worker-button.fire:hover:not(:disabled) {
  background: linear-gradient(135deg, #da190b, #c62828);
  transform: translateY(-1px);
}

.worker-button:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  transform: none;
}

.worker-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(143, 92, 255, 0.2);
}

.worker-output {
  color: #4CAF50;
  font-weight: 500;
}

.worker-cost {
  color: #ff6b6b;
  font-weight: 500;
}

/* Purchased Upgrade Compact Grid Styles */
.purchased-upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.upgrade-item.purchased {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.1), rgba(79, 140, 255, 0.05));
  border: 1px solid rgba(143, 92, 255, 0.2);
  border-radius: 6px;
  margin-bottom: 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upgrade-item.purchased.compact {
  padding: 0.4rem;
}

.upgrade-item.purchased.expanded {
  padding: 1rem;
  grid-column: 1 / -1; /* Take full width when expanded */
  margin-bottom: 0.5rem;
}

.upgrade-item.purchased:hover {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.15), rgba(79, 140, 255, 0.08));
  border-color: rgba(143, 92, 255, 0.3);
  transform: translateY(-1px);
}

.upgrade-compact-view {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.upgrade-compact-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.8rem;
  flex: 1;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-compact-status {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(143, 92, 255, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.upgrade-expanded-view {
  display: none;
}

.upgrade-item.purchased.expanded .upgrade-compact-view {
  margin-bottom: 0.5rem;
}

.upgrade-item.purchased.expanded .upgrade-expanded-view {
  display: block;
}

.upgrade-expanded-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.upgrade-expanded-effect {
  color: rgba(143, 92, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Available upgrades container */
.available-upgrades-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Inline Funding Warning */
.funding-warning-inline {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  text-align: center;
  animation: pulse 2s infinite;
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Event Modal System Styles */
.event-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.event-modal {
  background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(30, 30, 45, 0.95));
  border: 2px solid rgba(143, 92, 255, 0.3);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.event-header {
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(143, 92, 255, 0.2);
  padding-bottom: 1rem;
}

.event-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.event-era {
  font-size: 0.9rem;
  color: rgba(143, 92, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.event-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #e0e0e0;
  margin-bottom: 2rem;
  text-align: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 4px solid rgba(143, 92, 255, 0.5);
}

.event-choices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-choice-button {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.1), rgba(79, 140, 255, 0.05));
  border: 2px solid rgba(143, 92, 255, 0.3);
  border-radius: 8px;
  padding: 1rem;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-choice-button:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(143, 92, 255, 0.2), rgba(79, 140, 255, 0.1));
  border-color: rgba(143, 92, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(143, 92, 255, 0.2);
}

.event-choice-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.1), rgba(80, 80, 80, 0.05));
  border-color: rgba(100, 100, 100, 0.3);
}

.event-choice-button.unaffordable {
  border-color: rgba(255, 100, 100, 0.3);
  background: linear-gradient(135deg, rgba(255, 100, 100, 0.1), rgba(200, 80, 80, 0.05));
}

.choice-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.choice-description {
  font-size: 0.95rem;
  color: #c0c0c0;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.choice-effects {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.choice-cost {
  color: #ff6b6b;
  font-weight: 500;
}

.choice-reward {
  color: #51cf66;
  font-weight: 500;
}

.choice-effect {
  color: #74c0fc;
  font-weight: 500;
}

/* Era-specific event modal theming */
[data-era="handcrafted"] .event-modal {
  border-color: rgba(255, 193, 7, 0.3);
}

[data-era="handcrafted"] .event-era {
  color: rgba(255, 193, 7, 0.8);
}

[data-era="handcrafted"] .event-description {
  border-left-color: rgba(255, 193, 7, 0.5);
}

[data-era="handcrafted"] .event-choice-button {
  border-color: rgba(255, 193, 7, 0.3);
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 235, 59, 0.05));
}

[data-era="handcrafted"] .event-choice-button:hover:not(:disabled) {
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

[data-era="learning"] .event-modal {
  border-color: rgba(76, 175, 80, 0.3);
}

[data-era="learning"] .event-era {
  color: rgba(76, 175, 80, 0.8);
}

[data-era="learning"] .event-description {
  border-left-color: rgba(76, 175, 80, 0.5);
}

[data-era="learning"] .event-choice-button {
  border-color: rgba(76, 175, 80, 0.3);
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(129, 199, 132, 0.05));
}

[data-era="learning"] .event-choice-button:hover:not(:disabled) {
  border-color: rgba(76, 175, 80, 0.5);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

[data-era="deep"] .event-modal {
  border-color: rgba(33, 150, 243, 0.3);
}

[data-era="deep"] .event-era {
  color: rgba(33, 150, 243, 0.8);
}

[data-era="deep"] .event-description {
  border-left-color: rgba(33, 150, 243, 0.5);
}

[data-era="deep"] .event-choice-button {
  border-color: rgba(33, 150, 243, 0.3);
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(100, 181, 246, 0.05));
}

[data-era="deep"] .event-choice-button:hover:not(:disabled) {
  border-color: rgba(33, 150, 243, 0.5);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

[data-era="agi"] .event-modal {
  border-color: rgba(156, 39, 176, 0.3);
}

[data-era="agi"] .event-era {
  color: rgba(156, 39, 176, 0.8);
}

[data-era="agi"] .event-description {
  border-left-color: rgba(156, 39, 176, 0.5);
}

[data-era="agi"] .event-choice-button {
  border-color: rgba(156, 39, 176, 0.3);
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(186, 104, 200, 0.05));
}

[data-era="agi"] .event-choice-button:hover:not(:disabled) {
  border-color: rgba(156, 39, 176, 0.5);
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.2);
}

/* Responsive event modal design */
@media (max-width: 768px) {
  .event-modal {
    padding: 1.5rem;
    margin: 1rem;
    max-height: 90vh;
  }
  
  .event-title {
    font-size: 1.3rem;
  }
  
  .event-description {
    font-size: 1rem;
    padding: 0.75rem;
  }
  
  .event-choice-button {
    padding: 0.75rem;
  }
  
  .choice-title {
    font-size: 1rem;
  }
}

.worker-efficiency {
  font-size: 0.8rem;
  color: #74c0fc;
  font-weight: 500;
  text-align: center;
  margin-top: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: rgba(116, 192, 252, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(116, 192, 252, 0.2);
}

/* Era Advancement System */
.era-advancement-section {
  margin: 1rem 0;
  padding: 0;
}

.era-advancement-card {
  background: linear-gradient(135deg, #4c6ef5 0%, #364fc7 100%);
  border: 2px solid #4c6ef5;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  color: white;
  box-shadow: 0 4px 12px rgba(76, 111, 245, 0.3);
  animation: pulse-glow 2s ease-in-out infinite alternate;
}

.era-advancement-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  color: #fff;
}

.era-advancement-card h4 {
  margin: 0.5rem 0;
  font-size: 1.2rem;
  color: #c5d2ff;
}

.era-advancement-card .warning {
  color: #ffd43b;
  font-weight: 600;
  margin: 0.5rem 0;
}

.advance-era-button {
  background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 2px 8px rgba(55, 178, 77, 0.3);
}

.advance-era-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(55, 178, 77, 0.4);
}

.era-progress-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
}

.era-progress-card h3 {
  margin: 0 0 1rem 0;
  color: #74c0fc;
  text-align: center;
}

.progress-item {
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  border-left: 3px solid #74c0fc;
}

.progress-item strong {
  color: #74c0fc;
}

/* Era Confirmation Modal */
.era-confirmation {
  z-index: 10000;
}

.era-confirmation-modal {
  max-width: 500px;
  background: linear-gradient(135deg, #1a1b23 0%, #2d3748 100%);
  border: 2px solid #4c6ef5;
}

.era-confirmation-modal h2 {
  color: #4c6ef5;
  text-align: center;
  margin-bottom: 1rem;
}

.confirmation-details {
  margin: 1rem 0;
}

.confirmation-details p {
  margin: 0.5rem 0;
}

.confirmation-details ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.confirmation-details li {
  margin: 0.3rem 0;
}

.confirmation-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.confirm-button {
  background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirm-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(55, 178, 77, 0.4);
}

.cancel-button {
  background: linear-gradient(135deg, #f03e3e 0%, #c92a2a 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 42, 42, 0.4);
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 4px 12px rgba(76, 111, 245, 0.3);
  }
  100% {
    box-shadow: 0 6px 20px rgba(76, 111, 245, 0.5);
  }
}

/* Fixed Settings Button */
.settings-button.fixed-settings {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  z-index: 1000 !important;
  background: linear-gradient(135deg, #4c6ef5 0%, #364fc7 100%) !important;
  color: white !important;
  border: 2px solid #4c6ef5 !important;
  font-size: 1.2rem !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(76, 111, 245, 0.3) !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.settings-button.fixed-settings:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(76, 111, 245, 0.5) !important;
}

/* Sidebar Settings Button */
.settings-button.sidebar-settings {
  margin-top: 1rem !important;
  width: 100% !important;
  padding: 0.75rem !important;
  background: linear-gradient(135deg, #4c6ef5 0%, #364fc7 100%) !important;
  color: white !important;
  border: 2px solid #4c6ef5 !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.settings-button.sidebar-settings:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(76, 111, 245, 0.4) !important;
}

/* Settings Menu Styles */
.settings-menu {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  min-width: 300px;
  max-width: 400px;
  z-index: 1001;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.settings-menu.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.settings-menu h3 {
  color: var(--highlight-blue);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h4 {
  color: var(--main-fg);
  margin-bottom: 0.8rem;
  font-size: 1rem;
  opacity: 0.9;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.settings-button {
  padding: 0.8rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.settings-button.save {
  background: var(--highlight-green);
  color: white;
}

.settings-button.save:hover {
  background: var(--highlight-cyan);
  transform: translateY(-1px);
}

.settings-button.load {
  background: var(--highlight-blue);
  color: white;
}

.settings-button.load:hover {
  background: var(--highlight-purple);
  transform: translateY(-1px);
}

.settings-button.export {
  background: var(--highlight-cyan);
  color: white;
}

.settings-button.export:hover {
  background: var(--highlight-green);
  transform: translateY(-1px);
}

.settings-button.import {
  background: var(--highlight-purple);
  color: white;
}

.settings-button.import:hover {
  background: var(--highlight-pink);
  transform: translateY(-1px);
}

.settings-button.delete {
  background: var(--highlight-pink);
  color: white;
}

.settings-button.delete:hover {
  background: #ff4757;
  transform: translateY(-1px);
}

/* Cheat Menu Styles */
.cheat-menu {
  position: fixed;
  top: 60px;
  right: 60px;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid var(--highlight-purple);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  z-index: 10000;
  color: white;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(143, 92, 255, 0.3);
  backdrop-filter: blur(10px);
}

.cheat-menu h4 {
  text-align: center;
  margin-bottom: 1rem;
  font-weight: bold;
  color: var(--highlight-purple);
  font-size: 14px;
}

.cheat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cheat-grid.single-column {
  grid-template-columns: 1fr;
}

.cheat-button {
  padding: 0.5rem;
  font-size: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.cheat-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cheat-button.resource {
  background: rgba(79, 140, 255, 0.3);
  color: var(--highlight-cyan);
  border: 1px solid var(--highlight-cyan);
}

.cheat-button.power {
  background: rgba(255, 105, 180, 0.3);
  color: var(--highlight-pink);
  border: 1px solid var(--highlight-pink);
}

.cheat-button.debug {
  background: rgba(255, 165, 0, 0.3);
  color: var(--highlight-orange);
  border: 1px solid var(--highlight-orange);
}

.cheat-button.close {
  background: rgba(60, 60, 40, 0.8);
  border-color: rgba(120, 120, 80, 0.6);
  color: white;
  margin-top: 0.5rem;
}

/* Hardware Infrastructure Styles */
.capacity-overview {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.capacity-section h4 {
  margin: 0 0 1rem 0;
  color: var(--highlight-blue);
  font-size: 1.1rem;
  font-weight: 600;
}

.capacity-bar {
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  margin-bottom: 0.5rem;
}

.capacity-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--highlight-green), var(--highlight-blue));
  transition: width 0.3s ease;
  border-radius: 10px;
}

.capacity-text {
  font-size: 0.9rem;
  color: var(--main-fg);
  text-align: center;
  font-weight: 500;
}

.hardware-section {
  margin-bottom: 2rem;
}

.hardware-section h4 {
  color: var(--highlight-purple);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.hardware-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.hardware-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.hardware-card:hover {
  border-color: var(--highlight-blue);
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.2);
  transform: translateY(-2px);
}

.hardware-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.hardware-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--highlight-blue);
}

.hardware-count {
  font-size: 0.9rem;
  color: var(--highlight-green);
  font-weight: 500;
  background: rgba(106, 210, 158, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(106, 210, 158, 0.2);
}

.hardware-description {
  color: var(--main-fg);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.hardware-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hardware-stats .stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--main-fg);
}

.hardware-cost {
  font-size: 0.9rem;
  color: var(--highlight-cyan);
  font-weight: 500;
  margin-bottom: 1rem;
}

.hardware-controls {
  display: flex;
  gap: 0.5rem;
}

.buy-hardware-button, .sell-hardware-button {
  flex: 1;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.buy-hardware-button {
  background: var(--highlight-green);
  color: white;
}

.buy-hardware-button:hover:not(:disabled) {
  background: #5cb85c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(106, 210, 158, 0.3);
}

.buy-hardware-button:disabled {
  background: rgba(106, 210, 158, 0.3);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

.sell-hardware-button {
  background: var(--highlight-red);
  color: white;
}

.sell-hardware-button:hover:not(:disabled) {
  background: #d9534f;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(196, 71, 71, 0.3);
}

.sell-hardware-button:disabled {
  background: rgba(196, 71, 71, 0.3);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

/* Data Selection Slider */
.data-selection {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.data-selection label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--highlight-blue);
}

.data-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--card-border);
  outline: none;
  -webkit-appearance: none;
  margin: 0.5rem 0;
}

.data-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--highlight-blue);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 140, 255, 0.4);
  transition: all 0.2s ease;
}

.data-slider::-webkit-slider-thumb:hover {
  background: var(--highlight-purple);
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(161, 143, 255, 0.5);
}

.data-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--highlight-blue);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(79, 140, 255, 0.4);
  transition: all 0.2s ease;
}

.data-slider::-moz-range-thumb:hover {
  background: var(--highlight-purple);
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(161, 143, 255, 0.5);
}

.data-percentage {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.3rem;
}

/* Model Preview Section */
.model-preview {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(143, 92, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(143, 92, 255, 0.3);
}

.model-preview h5 {
  margin: 0 0 0.5rem 0;
  color: var(--highlight-purple);
  font-size: 0.9rem;
  font-weight: 600;
}

.model-requirements {
  margin: 1rem 0;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid var(--card-border);
}

/* Hardware Utilization in Sidebar */
.hardware-item {
  transition: all 0.3s ease;
}

.hardware-item:hover {
  transform: translateX(2px);
}

/* Enhanced Resource Value for Hardware */
.resource-container[data-resource="hardware"] .resource-value {
  font-size: 1.1rem;
}

.resource-container[data-resource="hardware"] .hardware-item {
  margin: 0.2rem 0;
  transition: all 0.3s ease;
}

.resource-container[data-resource="hardware"] .hardware-item:hover {
  transform: translateX(3px);
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Hardware Split Display */
.hardware-split-container {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  width: 100%;
  padding: 0.05rem;
  line-height: 1.2;
}

.hardware-section-split {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  background: transparent;
  border: none;
  transition: all 0.3s ease;
  min-height: auto;
}

.hardware-section-split:hover {
  transform: translateY(-1px);
}

.hardware-section-header {
  font-weight: 600;
  color: var(--highlight-blue);
  font-size: 0.8rem;
  text-align: left;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hardware-capacity {
  font-weight: 700;
  color: var(--sidebar-fg);
  font-size: 0.9rem;
  margin-left: auto;
}

.hardware-utilization-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  margin-bottom: 0.2rem;
}

.hardware-utilization-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.cpu-fill {
  background: linear-gradient(90deg, var(--highlight-blue), var(--highlight-cyan));
  box-shadow: 0 0 6px rgba(79, 140, 255, 0.2);
}

.gpu-fill {
  background: linear-gradient(90deg, var(--highlight-purple), var(--highlight-pink));
  box-shadow: 0 0 6px rgba(161, 143, 255, 0.2);
}

.power-fill {
  background: linear-gradient(90deg, var(--highlight-cyan), var(--highlight-blue));
  box-shadow: 0 0 6px rgba(79, 140, 255, 0.2);
}

.hardware-usage-text {
  font-size: 0.7rem;
  color: var(--main-fg);
  opacity: 0.8;
  text-align: right;
  font-weight: 500;
}

/* Enhanced hardware container */
.resource-container.hardware-split {
  min-height: 75px;
}

.resource-container.hardware-split .resource-content {
  padding: 0.4rem;
  flex: 1;
}

@media (max-width: 768px) {
  .capacity-overview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .hardware-grid {
    grid-template-columns: 1fr;
  }
  
  .hardware-controls {
    flex-direction: column;
  }
  
  .data-selection {
    padding: 0.8rem;
  }
  
  .data-slider {
    height: 8px;
  }
  
  .data-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }
  
  .data-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
  
  /* Hardware split responsive */
  .hardware-split-container {
    gap: 0.4rem;
  }
  
  .resource-container.hardware-split {
    min-height: 80px;
  }
}

/* Deployment Management Controls */
.deployment-card.paused {
  opacity: 0.7;
  border-color: var(--highlight-red);
  background: rgba(196, 71, 71, 0.05);
}

.priority-badge {
  background: var(--highlight-purple);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.status-indicators {
  color: var(--highlight-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.deployment-controls {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cpu-limit-control, .priority-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cpu-limit-control label, .priority-control label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--highlight-blue);
  min-width: 100px;
}

.cpu-limit-input, .priority-input {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  color: var(--main-fg);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100px;
  transition: all 0.3s ease;
}

.cpu-limit-input:focus, .priority-input:focus {
  outline: none;
  border-color: var(--highlight-blue);
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.2);
}

.set-cpu-limit-btn, .set-priority-btn {
  background: var(--highlight-blue);
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.set-cpu-limit-btn:hover, .set-priority-btn:hover {
  background: var(--highlight-purple);
  transform: translateY(-1px);
}

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

.pause-button, .resume-button, .delete-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pause-button {
  background: var(--highlight-red);
  color: white;
}

.pause-button:hover {
  background: #d63447;
  transform: translateY(-1px);
}

.resume-button {
  background: var(--highlight-green);
  color: white;
}

.resume-button:hover {
  background: #5cb85c;
  transform: translateY(-1px);
}

.delete-button {
  background: #6c757d;
  color: white;
}

.delete-button:hover {
  background: var(--highlight-red);
  transform: translateY(-1px);
}

.redeploy-button {
  background: linear-gradient(135deg, var(--highlight-purple), var(--highlight-pink));
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.redeploy-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(161, 143, 255, 0.3);
}

@media (max-width: 768px) {
  .deployment-controls {
    gap: 0.8rem;
  }
  
  .cpu-limit-control, .priority-control {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  
  .cpu-limit-control label, .priority-control label {
    min-width: auto;
  }
  
  .deployment-actions {
    flex-direction: column;
  }
  
  .pause-button, .resume-button, .delete-button, .redeploy-button {
    width: 100%;
    justify-content: center;
  }
}

/* Achievement System Styles */
.achievements-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--card-border);
}

.achievements-section h4 {
  color: var(--highlight-purple);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.achievements-section h4::before {
  content: '🏆';
  font-size: 1.4rem;
}

.achievements-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.achievement-item {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.achievement-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.achievement-item:hover::before {
  opacity: 1;
}

.achievement-item.unlocked {
  border-color: var(--highlight-green);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(106, 210, 158, 0.05) 100%);
}

.achievement-item.unlocked:hover {
  border-color: var(--highlight-green);
  box-shadow: 0 4px 16px rgba(106, 210, 158, 0.2);
  transform: translateY(-2px);
}

.achievement-item.locked {
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.1);
}

.achievement-item.locked:hover {
  border-color: var(--highlight-blue);
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.1);
  transform: translateY(-1px);
}

.achievement-icon {
  font-size: 2rem;
  min-width: 2.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--card-border);
  transition: all 0.3s ease;
}

.achievement-item.unlocked .achievement-icon {
  background: linear-gradient(135deg, var(--highlight-green), var(--highlight-cyan));
  border-color: var(--highlight-green);
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.achievement-item.locked .achievement-icon {
  background: var(--main-bg);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.4);
}

.achievement-info {
  flex: 1;
  min-width: 0;
}

.achievement-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--main-fg);
  line-height: 1.2;
}

.achievement-item.unlocked .achievement-name {
  color: var(--highlight-green);
}

.achievement-item.locked .achievement-name {
  color: rgba(255, 255, 255, 0.6);
}

.achievement-desc {
  font-size: 0.85rem;
  color: var(--main-fg);
  opacity: 0.8;
  line-height: 1.4;
}

.achievement-item.locked .achievement-desc {
  color: rgba(255, 255, 255, 0.5);
}

/* Achievement unlock animation */
@keyframes achievement-unlock {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(106, 210, 158, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(106, 210, 158, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(106, 210, 158, 0.2);
  }
}

.achievement-item.just-unlocked {
  animation: achievement-unlock 0.6s ease-out;
}

/* Responsive design for achievements */
@media (max-width: 768px) {
  .achievements-list {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .achievement-item {
    padding: 0.8rem;
    gap: 0.8rem;
  }
  
  .achievement-icon {
    font-size: 1.5rem;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
  }
  
  .achievement-name {
    font-size: 0.9rem;
  }
  
  .achievement-desc {
    font-size: 0.8rem;
  }
}

/* Settings Menu */
#settings-menu {
  display: none;
  position: fixed;
  top: 80px;
  right: 20px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1001;
  min-width: 280px;
  max-width: 350px;
}

#settings-menu.open {
  display: block;
}

#settings-menu button {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background: #4c6ef5;
  color: white;
  cursor: pointer;
  font-size: 14px;
}

#settings-menu button:hover {
  background: #364fc7;
}

#settings-menu button.delete {
  background: #e03131;
}

#settings-menu button.delete:hover {
  background: #c92a2a;
}

/* Version Information Styling */
.version-info, .compatibility-info {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 6px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.version-info h3, .compatibility-info h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 5px;
}

.version-details div, .compatibility-status div {
  margin: 5px 0;
  font-size: 13px;
  color: #6c757d;
}

.compatibility-status.compatible {
  background: #d1e7dd;
  border: 1px solid #badbcc;
  padding: 10px;
  border-radius: 4px;
}

.compatibility-status.incompatible {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 4px;
}

.compatibility-status.compatible div {
  color: #0f5132;
}

.compatibility-status.incompatible div {
  color: #721c24;
}

/* Bulk Buy Button Styling */
.bulk-buy-button {
  background: var(--highlight-blue);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
}

.bulk-buy-button:hover:not(:disabled) {
  background: #364fc7;
  transform: translateY(-1px);
}

.bulk-buy-button:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* Hardware Controls Layout Update */
.hardware-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Bulk Purchase Modal Enhancements */
.bulk-purchase-modal-overlay {
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease-out;
}

.bulk-purchase-modal {
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
}

.bulk-purchase-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
  border-radius: var(--border-radius);
  pointer-events: none;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Input focus glow effect */
.bulk-purchase-modal input:focus {
  outline: none;
  border-color: var(--highlight-blue) !important;
  box-shadow: 0 0 12px rgba(79, 140, 255, 0.4) !important;
}

/* Market Saturation Indicators */
.market-saturation {
  background: linear-gradient(135deg, #c44747, #ff5c5c);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  margin: 0.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(196, 71, 71, 0.3);
  animation: saturation-pulse 2s ease-in-out infinite;
}

.market-warning {
  background: linear-gradient(135deg, #ff8c00, #ffa500);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  margin: 0.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

@keyframes saturation-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

/* Enhanced hardware cost display */
.hardware-cost {
  margin: 0.8rem 0;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border-left: 3px solid var(--highlight-cyan);
}

.hardware-cost strong {
  color: var(--highlight-red);
  font-size: 1.1em;
}

/* Power and Trust Resource Styling */
.power-overlimit {
  color: var(--highlight-red) !important;
  font-weight: bold;
  animation: power-warning 1s ease-in-out infinite;
}

.power-normal {
  color: var(--highlight-green) !important;
}

.trust-positive {
  color: var(--highlight-green) !important;
}

.trust-negative {
  color: var(--highlight-red) !important;
}

@keyframes power-warning {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Power Grid Infrastructure Styling */
.power-grid-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
}

.power-grid-section h4 {
  color: var(--highlight-purple);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.power-grid-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.power-stat-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--highlight-cyan);
  text-align: center;
}

.power-stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--highlight-cyan);
  margin-bottom: 0.5rem;
}

.power-stat-label {
  font-size: 0.9rem;
  color: var(--main-fg);
  opacity: 0.8;
}

.power-plants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.power-plant-card {
  background: var(--main-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.power-plant-card:hover {
  border-color: var(--highlight-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.2);
}

.power-plant-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.power-plant-icon {
  font-size: 2rem;
}

.power-plant-info h5 {
  color: var(--highlight-purple);
  margin: 0 0 0.3rem 0;
  font-size: 1.1rem;
}

.power-plant-info .owned-count {
  color: var(--highlight-cyan);
  font-weight: bold;
  font-size: 0.9rem;
}

.power-plant-description {
  color: var(--main-fg);
  opacity: 0.8;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.power-plant-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.power-plant-stat {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem;
  border-radius: 6px;
  text-align: center;
}

.power-plant-stat-value {
  font-weight: bold;
  color: var(--highlight-green);
}

.power-plant-stat-label {
  font-size: 0.8rem;
  color: var(--main-fg);
  opacity: 0.7;
}

.trust-impact-positive {
  color: var(--highlight-green);
}

.trust-impact-negative {
  color: var(--highlight-red);
}

.trust-impact-neutral {
  color: var(--main-fg);
}

.build-power-plant-button {
  width: 100%;
  padding: 0.8rem;
  background: var(--highlight-green);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.build-power-plant-button:hover:not(:disabled) {
  background: #5cb85c;
  transform: translateY(-1px);
}

.build-power-plant-button:disabled {
  background: var(--card-border);
  color: var(--main-fg);
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* AI Automation System Styling */
.automation-section {
  margin-top: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 12px;
  border: 1px solid #333;
}

.automation-section h4 {
  color: #00d4ff;
  margin-bottom: 20px;
  font-size: 20px;
  text-align: center;
}

.automation-locked {
  text-align: center;
  padding: 40px 20px;
}

.locked-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 8px;
  border: 1px dashed #666;
}

.locked-icon {
  font-size: 32px;
}

.locked-text h5 {
  margin: 0 0 5px 0;
  color: #ff6b6b;
}

.locked-text p {
  margin: 0;
  color: #ccc;
  font-size: 14px;
}

.automation-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.automation-stat-card {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.automation-stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #00d4ff;
  margin-bottom: 5px;
}

.automation-stat-label {
  font-size: 12px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.automation-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 20px;
  transition: all 0.3s ease;
}

.automation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-color: #00d4ff;
}

.automation-card.locked {
  opacity: 0.6;
  border-color: #666;
}

.automation-card.owned {
  background: rgba(76, 175, 80, 0.1);
  border-color: #4CAF50;
}

.automation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.automation-icon {
  font-size: 32px;
  margin-right: 15px;
}

.automation-info {
  flex: 1;
}

.automation-info h5 {
  margin: 0 0 5px 0;
  color: #fff;
  font-size: 16px;
}

.automation-category {
  font-size: 12px;
  color: #00d4ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.automation-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.automation-status.active {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid #4CAF50;
}

.automation-status.locked {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
}

.automation-status.unavailable {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid #ffc107;
}

.automation-status.available {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  border: 1px solid #00d4ff;
}

.automation-description {
  color: #ccc;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 15px;
}

.automation-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.automation-stat {
  text-align: center;
}

.automation-stat-value {
  font-size: 16px;
  font-weight: bold;
  color: #00d4ff;
  margin-bottom: 3px;
}

.automation-stat-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
}

.purchase-automation-button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #00d4ff, #0099cc);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.purchase-automation-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #00b8e6, #0088bb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.purchase-automation-button:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

.automation-settings {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.automation-settings h5 {
  color: #00d4ff;
  margin-bottom: 15px;
  font-size: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  color: #ccc;
  font-size: 14px;
  font-weight: 500;
}

.setting-item input[type="range"] {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #00d4ff;
  border-radius: 50%;
  cursor: pointer;
}

.setting-item input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #00d4ff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.setting-item input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.2);
  accent-color: #00d4ff;
}

.setting-item label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  cursor: pointer;
}

/* Research Tab Redesign */
.research-sub-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--card-border);
  padding-bottom: 0.5rem;
}

.research-nav-button {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  color: var(--main-fg);
  padding: 0.75rem 1.5rem;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.research-nav-button:hover {
  background: var(--highlight-blue);
  color: white;
  transform: translateY(-2px);
}

.research-nav-button.active {
  background: var(--highlight-cyan);
  color: white;
  border-color: var(--highlight-cyan);
  transform: translateY(-2px);
}

.research-progress-overview {
  background: linear-gradient(135deg, var(--card-bg), rgba(79, 140, 255, 0.05));
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-header h4 {
  margin: 0;
  color: var(--highlight-cyan);
  font-size: 1.2rem;
  font-weight: 700;
}

.progress-stats {
  background: var(--highlight-blue);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar-container .progress-bar {
  flex: 1;
  height: 12px;
  background: var(--card-border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-container .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--highlight-cyan), var(--highlight-blue));
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(79, 140, 255, 0.3);
}

.progress-percentage {
  font-weight: 700;
  color: var(--highlight-cyan);
  font-size: 0.9rem;
  min-width: 50px;
  text-align: right;
}