/* Galaxy Strike Online - Component Styles */

/* Health Bars */
.health-bar {
  margin: 1rem 0;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.health-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ship-health .health-label {
  color: #4a9eff;
}

.player-health .health-label {
  color: #4ade80;
}

.ship-health-fill {
  background: linear-gradient(90deg, #4a9eff, #00d4ff);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.player-health-fill {
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.health-bar span {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Progress bars */
.progress-bar {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  min-width: 2px;
}

/* Ship Stats Display */
.current-ship-stats {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: #4a9eff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
}

.stat-value {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  background: var(--hover-bg);
}

.btn-success {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ffaa00, #ff8800);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(255, 170, 0, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #ff3366, #ff0033);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: var(--primary-color);
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5rem;
}

.modal-close:hover {
  color: var(--error-color);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
}

/* Alert Modal Styles */
.alert-modal .modal-header h3 {
  color: var(--primary-color);
}

.alert-modal .modal-body {
  text-align: center;
  padding: 2rem 1.5rem;
}

.alert-modal .alert-message {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.alert-modal .modal-footer {
  padding: 0 1.5rem 1.5rem;
  text-align: center;
}

.alert-modal .btn-alert {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.alert-modal .btn-alert:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

/* Success Alert */
.alert-modal.success .modal-header h3 {
  color: var(--success-color);
}

.alert-modal.success .btn-alert {
  background: var(--success-color);
}

/* Error Alert */
.alert-modal.error .modal-header h3 {
  color: var(--error-color);
}

.alert-modal.error .btn-alert {
  background: var(--error-color);
}

/* Warning Alert */
.alert-modal.warning .modal-header h3 {
  color: var(--warning-color);
}

.alert-modal.warning .btn-alert {
  background: var(--warning-color);
}

/* Confirmation Modal Styles */
.confirmation-modal .modal-body {
  text-align: center;
  padding: 2rem 1.5rem;
}

.confirmation-modal .confirm-message {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.confirmation-modal .modal-footer {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirmation-modal .btn-confirm {
  background: var(--error-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.confirmation-modal .btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 51, 102, 0.3);
}

.confirmation-modal .btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.confirmation-modal .btn-cancel:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
}

/* Settings Menu Styles */
.settings-menu {
  max-width: 600px;
  margin: 0 auto;
}

.settings-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.settings-section h3 {
  color: var(--primary-color);
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.settings-section h4 {
  color: var(--text-primary);
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.settings-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group label {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.setting-select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.setting-select:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.setting-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.setting-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.settings-description {
  margin-bottom: 1rem;
}

.reset-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reset-option {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.reset-option h4 {
  color: var(--warning-color);
  margin-bottom: 0.5rem;
}

.reset-option p {
  margin-bottom: 0.5rem;
}

.reset-option ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.reset-option li {
  margin-bottom: 0.25rem;
}

/* Progress Bars */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progressShine 2s infinite;
}

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

/* Tooltips */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--border-color);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  animation: notificationSlideIn 0.3s ease;
  max-width: 300px;
}

@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.success {
  border-color: var(--success-color);
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.1),
    rgba(0, 204, 102, 0.1)
  );
}

.notification.warning {
  border-color: var(--warning-color);
  background: linear-gradient(
    135deg,
    rgba(255, 170, 0, 0.1),
    rgba(255, 136, 0, 0.1)
  );
}

.notification.error {
  border-color: var(--error-color);
  background: linear-gradient(
    135deg,
    rgba(255, 51, 102, 0.1),
    rgba(255, 0, 51, 0.1)
  );
}

.notification.info {
  border-color: var(--primary-color);
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.1),
    rgba(0, 153, 204, 0.1)
  );
}

/* Base Navigation Buttons - Match Quest Tab Style */
.base-navigation {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.base-nav-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.base-nav-btn:hover {
  border-color: var(--primary-color);
  color: var(--text-primary);
}

.base-nav-btn.active {
  background: var(--gradient-primary);
  color: var(--bg-primary);
  border-color: transparent;
}

/* Base Rooms Grid - Smaller to prevent scrolling */
.base-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  padding: 0.5rem;
}

.room-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.room-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.room-item i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.room-item h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.room-item p {
  margin: 0.25rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

/* Base Visualization */
.base-visualization-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  height: calc(100vh - 280px);
}

#baseCanvas {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  height: 100%;
}

.base-info-overlay {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.base-stats-overlay {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 320px);
}

.base-stats-overlay h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

#baseInfoDisplay {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Loading Progress Indicator */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color) 0%,
    rgba(0, 212, 255, 0.3) 50%,
    var(--primary-color) 100%
  );
  background-size: 200% 100%;
  animation: loading-gradient 2s ease-in-out infinite;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.loading-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-indicator.complete {
  background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
  animation: none;
}

.loading-indicator.error {
  background: linear-gradient(90deg, #f44336 0%, #d32f2f 100%);
  animation: none;
}

@keyframes loading-gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Loading Status Text */
.loading-status {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10001;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.loading-status.error {
  background: linear-gradient(90deg, #f44336 0%, #d32f2f 100%);
  color: white;
  border-color: #d32f2f;
}

.loading-status.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

/* Starbase Bonus Inventory Slots */
.inventory-slot.starbase-bonus-slot {
  border: 2px solid var(--primary-color);
  background: rgba(0, 212, 255, 0.1);
  position: relative;
}

.inventory-slot.starbase-bonus-slot::before {
  content: "+";
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--primary-color);
  color: white;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Starbases Container - Side-by-Side Box Layout */
.starbases-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  height: calc(100vh - 320px); /* Adjusted for titles outside boxes */
  max-height: calc(100vh - 320px);
  overflow: hidden; /* Prevent container from scrolling */
}

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

.starbase-section h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0; /* Prevent title from shrinking */
}

.starbase-list {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  overflow-y: scroll; /* Always show scrollbar */
  flex: 1;
  min-height: 0; /* Allow flex item to shrink */
}

.starbase-shop {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  overflow-y: scroll; /* Always show scrollbar */
  flex: 1;
  min-height: 0; /* Allow flex item to shrink */
}

.starbase-purchase-list {
  overflow-y: scroll; /* Always show scrollbar */
  max-height: calc(100vh - 400px); /* Fixed height to ensure scrolling */
  min-height: 200px; /* Minimum height to show scrollbar */
}

/* Add scrollbar styling for purchase list */
.starbase-purchase-list::-webkit-scrollbar {
  width: 8px;
}

.starbase-purchase-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

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

.starbase-purchase-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
  opacity: 0.8;
}

/* Ensure scrollbars are visible */
.starbase-list::-webkit-scrollbar,
.starbase-shop::-webkit-scrollbar {
  width: 8px;
}

.starbase-list::-webkit-scrollbar-track,
.starbase-shop::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.starbase-list::-webkit-scrollbar-thumb,
.starbase-shop::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.starbase-list::-webkit-scrollbar-thumb:hover,
.starbase-shop::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
  opacity: 0.8;
}

.starbase-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  max-height: 150px;
  overflow-y: auto;
}

.starbase-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.starbase-item h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.starbase-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.starbase-item .stats {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.starbase-item .level {
  color: var(--primary-color);
  font-weight: 600;
}

.starbase-item .description {
  margin-top: 0.25rem;
  line-height: 1.3;
  max-height: 60px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Base Upgrades Grid Layout */
.upgrade-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.upgrade-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upgrade-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.upgrade-item h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.upgrade-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.upgrade-item .cost {
  margin-top: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Custom Title Bar */
.title-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  z-index: 10000;
  -webkit-app-region: drag;
  user-select: none;
}

.title-bar-left {
  display: flex;
  align-items: center;
}

.title-bar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: "Orbitron", monospace;
}

.title-bar-right {
  display: flex;
  gap: 4px;
}

.title-bar-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  -webkit-app-region: no-drag;
  transition: all 0.2s ease;
}

.title-bar-btn:hover {
  background: var(--bg-secondary);
}

.title-bar-btn.close-btn:hover {
  background: #e74c3c;
  color: white;
}

/* Adjust main content to account for title bar */
#app {
  margin-top: 32px;
}

/* Fullscreen styles */
body.fullscreen .title-bar {
  display: none;
}

body.fullscreen #app {
  margin-top: 0;
}

body.fullscreen .game-interface,
body.fullscreen .main-content {
  height: 100vh !important;
  max-height: 100vh !important;
}

body.fullscreen .dashboard-grid,
body.fullscreen .dungeons-container,
body.fullscreen .skills-container,
body.fullscreen .base-container,
body.fullscreen .quests-container,
body.fullscreen .inventory-container,
body.fullscreen .shop-container {
  height: calc(100vh - 120px) !important;
  overflow-y: auto;
}

/* Inventory Slots - Responsive & Larger */
.inventory-slot {
  width: clamp(160px, 14vw, 280px);
  height: clamp(160px, 14vw, 280px);
  min-width: 160px;
  min-height: 160px;
  max-width: 280px;
  max-height: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Item Cards - Square */
.item-card {
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.item-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.item-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.item-card:hover::before {
  transform: scaleX(1);
}

.item-card.common {
  border-color: #888;
}

.item-card.rare {
  border-color: #0088ff;
  box-shadow: 0 0 10px rgba(0, 136, 255, 0.3);
}

.item-card.epic {
  border-color: #8833ff;
  box-shadow: 0 0 15px rgba(136, 51, 255, 0.3);
}

.item-card.legendary {
  border-color: #ff8800;
  box-shadow: 0 0 20px rgba(255, 136, 0, 0.3);
}

/* Item Icon - Centered & Responsive */
.item-icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.item-icon img,
.item-icon i {
  max-width: 50%;
  max-height: 50%;
  width: 50%;
  height: 50%;
  min-width: 80px;
  min-height: 80px;
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
}

/* Item Info - Compact & Responsive */
.item-info {
  text-align: center;
  font-size: clamp(0.6rem, 1.5vw, 0.9rem);
  line-height: 1;
}

.item-name {
  font-weight: 600;
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.item-rarity {
  font-size: clamp(0.5rem, 1.2vw, 0.7rem);
  opacity: 0.8;
}

/* Item Quantity Badge - Responsive */
.item-quantity {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary-color);
  color: white;
  font-size: clamp(0.5rem, 1.2vw, 0.7rem);
  font-weight: bold;
  padding: clamp(2px, 0.5vw, 6px) clamp(4px, 0.8vw, 12px);
  border-radius: 6px;
  min-width: clamp(20px, 3vw, 32px);
  text-align: center;
}

/* Skill Items */
.skill-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.skill-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.skill-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.skill-item.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-color);
}

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

.skill-name {
  font-weight: 700;
  color: var(--text-primary);
}

.skill-level {
  color: var(--primary-color);
  font-weight: 700;
}

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

.skill-progress {
  margin-top: 0.5rem;
}

/* Quest Items */
.quest-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.quest-item.completed {
  border-color: var(--success-color);
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.1),
    rgba(0, 204, 102, 0.1)
  );
}

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

.quest-title {
  font-weight: 700;
  color: var(--text-primary);
}

.quest-reward {
  color: var(--warning-color);
  font-weight: 700;
}

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

.quest-progress {
  margin-top: 0.5rem;
}

/* Dungeon Items */
.dungeon-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dungeon-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.dungeon-item.selected {
  border-color: var(--primary-color);
  background: rgba(0, 212, 255, 0.2);
}

.dungeon-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dungeon-difficulty {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.dungeon-difficulty.easy {
  color: var(--success-color);
}

.dungeon-difficulty.medium {
  color: var(--warning-color);
}

.dungeon-difficulty.hard {
  color: var(--error-color);
}

.dungeon-rewards {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Collapsible Dungeon Sections */
.dungeon-section {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.difficulty-header.collapsible {
  padding: 1rem;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
  margin: 0;
  border: none;
  border-radius: 0;
}

.difficulty-header.collapsible:hover {
  background: var(--bg-tertiary);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-content i {
  font-size: 1.2rem;
}

.header-content span {
  font-weight: 600;
  font-size: 1.1rem;
}

.dungeon-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 2rem;
  text-align: center;
}

.collapse-indicator {
  transition: transform 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapse-indicator i {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.difficulty-header.collapsible:hover .collapse-indicator {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.dungeon-content {
  padding: 0 1rem 1rem;
  max-height: 2000px;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 1;
}

.dungeon-content.collapsed {
  max-height: 0;
  padding: 0 1rem;
  opacity: 0;
}

/* Difficulty-specific colors for collapsible headers */
.difficulty-header.tutorial {
  background: linear-gradient(135deg, var(--info-color), #2c5aa0);
  color: white;
}

.difficulty-header.easy {
  background: linear-gradient(135deg, var(--success-color), #27ae60);
  color: white;
}

.difficulty-header.medium {
  background: linear-gradient(135deg, var(--warning-color), #f39c12);
  color: white;
}

.difficulty-header.hard {
  background: linear-gradient(135deg, var(--error-color), #e74c3c);
  color: white;
}

.difficulty-header.extreme {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  color: white;
}

/* Enhanced Dungeon Items in Collapsible Sections */
.dungeon-content .dungeon-item {
  margin-bottom: 0.75rem;
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
}

.dungeon-content .dungeon-item:hover {
  border-left-color: var(--primary-color);
  transform: translateX(4px);
}

.dungeon-content .dungeon-item:last-child {
  margin-bottom: 0;
}

/* Shop Items */
.shop-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.shop-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.shop-item.purchased {
  opacity: 0.5;
  cursor: not-allowed;
}

.shop-item.purchased:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-color);
}

.shop-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

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

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

.shop-cost {
  color: var(--warning-color);
  font-weight: 700;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.2),
    transparent
  );
  animation: loadingShine 1.5s infinite;
}

@keyframes loadingShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

.bounce {
  animation: bounce 2s infinite;
}

.rotate {
  animation: rotate 2s linear infinite;
}

.glow {
  animation: glow 2s infinite;
}

/* Utility Classes */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.flex {
  display: flex;
}
.flex-column {
  flex-direction: column;
}
.flex-center {
  align-items: center;
  justify-content: center;
}
.flex-between {
  justify-content: space-between;
}
.flex-wrap {
  flex-wrap: wrap;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.ml-1 {
  margin-left: 0.5rem;
}
.ml-2 {
  margin-left: 1rem;
}
.mr-1 {
  margin-right: 0.5rem;
}
.mr-2 {
  margin-right: 1rem;
}

.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}
.p-4 {
  padding: 2rem;
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
