/* Global Styles */
:root {
  /* Dark theme colors */
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --accent-color: #e67e22;
  --background-color: #1a1a1a;
  --card-bg: #2c2c2c;
  --text-color: #e0e0e0;
  --border-color: #444;
  --header-bg: #121212;
  --footer-bg: #121212;
  --success-color: #27ae60;
  --danger-color: #e74c3c;

  /* disables highlighting text */
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
   -khtml-user-select: none; /* Konqueror HTML */
     -moz-user-select: none; /* Old versions of Firefox */
      -ms-user-select: none; /* Internet Explorer/Edge */
          user-select: none; /* Non-prefixed version, currently
                                supported by Chrome, Edge, Opera and Firefox */
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

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

a:hover {
  text-decoration: underline;
}

button, .btn {
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.1s;
}

button:active, .btn:active {
  transform: scale(0.98);
}

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

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

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

/* Layout */
header {
  background-color: var(--header-bg);
  color: white;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
}

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

.user-info {
  display: flex;
  gap: 1rem;
}

main {
  flex: 1;
  width: 100%;
  height: calc(100vh - 50px); /* Adjust for header height */
  overflow: hidden;
  padding: 0;
  margin: 0;
  max-width: none;
}

footer {
  background-color: var(--footer-bg);
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* Home Page */
.home-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.home-hero {
  text-align: center;
  padding-top: 1rem;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

.feature {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* Auth Pages */
.auth-container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auth-container h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-container form {
  display: flex;
  flex-direction: column;
}

.auth-container form p {
  margin-bottom: 1rem;
}

.auth-container form input {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 4px;
}

.auth-container form button {
  background-color: var(--primary-color);
  color: white;
  padding: 10px;
  margin-top: 1rem;
}

/* Game Layout */
.game-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.main-columns {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.left-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-world-pane {
  flex: 2; /* Takes 2/3 of the left column */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.player-ui-pane {
  width: 480px;
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  overflow: hidden;
  border-left: 1px solid var(--border-color);
}

.chat-pane {
  flex: 1; /* Takes 1/3 of the left column */
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  overflow: hidden;
  max-height: none; /* Remove the previous max-height constraint */
}

.game-header {
  padding: 0.75rem;
  background-color: var(--primary-color);
  color: white;
}

.game-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
}

.zone-info {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
}

.zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.zone-actions button {
  background-color: var(--secondary-color);
  color: white;
}

.zone-content {
  /* background-color: rgba(255, 255, 255, 0.05); */
  padding: 1rem;
  border-radius: 8px;
  min-height: 200px;
}

.result-message {
  padding: 1rem;
  background-color: var(--accent-color);
  color: white;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Game Tabs */
.game-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8f9fa;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
}

.tab-button.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.tab-pane {
  display: none;
  height: 100%;
}

.tab-pane.active {
  display: block;
}

/* Inventory */
.inventory-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.inventory-list li {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-inventory {
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 1rem;
}

/* Zones List */
.zones-list ul {
  list-style: none;
}

.zones-list li {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  list-style-type: none;
}

.zones-list li.active {
  background-color: rgba(255, 255, 255, 0.05);
}

.zones-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  
}

/* Chat */
.chat-header {
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: white;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
}

.chat-message {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-user {
  font-weight: bold;
  color: var(--primary-color);
}

.chat-time {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.5rem;
}

.chat-container form {
  display: flex;
  gap: 0.5rem;
}

.chat-container input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

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

/* Player UI pane */
.player-header {
  padding: 0.75rem;
  background-color: var(--secondary-color);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-stats {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.stat-label {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.health-bar, .xp-bar {
  height: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background-color: var(--danger-color);
  border-radius: 10px;
}

.xp-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 10px;
}

.health-bar span, .xp-bar span {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem;
}

.player-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--header-bg);
}

.menu-tab {
  flex: 1;
  padding: 0.5rem;
  text-align: center;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-color);
}

.menu-tab.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

.menu-content {
  flex: 1;
  overflow: hidden;
}

.menu-pane {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 1rem;
  scroll-behavior: smooth; /* Smooth scrolling for tab content */
}

.menu-pane.active {
  display: block;
}

.menu-pane h4 {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .main-columns {
    flex-direction: column;
  }
  
  .player-ui-pane {
    width: 100%;
    height: 300px;
    border-top: 1px solid var(--border-color);
    border-left: none;
  }
  
  .left-column {
    height: calc(100vh - 350px); /* Adjust based on header and player UI height */
  }
  
  .game-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .player-stats {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .tab-button {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* iOS-specific fixes are already in the world.html template */

/* Zone-specific styling */
.zone-special-content {
    margin-top: 1rem;
}

.zone-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.zone-features .feature {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.zone-encounters, .zone-resources {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.zone-encounters h4, .zone-resources h4 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.zone-encounters ul, .zone-resources ul {
    list-style: none;
    padding-left: 0.5rem;
}

.zone-encounters li, .zone-resources li {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Interactive zone features */
.interactive-feature {
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.interactive-feature:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.interactive-feature:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.action-hint {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-style: italic;
}

.action-result {
    min-height: 2rem;
    margin: 1rem 0;
}

.success-message {
    padding: 0.75rem;
    background-color: rgba(46, 204, 113, 0.2);
    border-left: 4px solid #2ecc71;
    border-radius: 4px;
    animation: fadeOut 5s forwards;
    animation-delay: 3s;
}

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

.inventory-item {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.inventory-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.item-context-menu {
    position: fixed;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    z-index: 100;
    width: auto;
    min-width: 100px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.item-context-menu button {
    display: block;
    width: 100%;
    padding: 0.25rem 0.5rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

.item-context-menu button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none;
}

/* System messages in chat */
.system-message {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 0.5rem;
}

.chat-system {
    font-weight: bold;
    color: var(--accent-color);
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2980b9;
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.05);
}

