/* Reset some defaults */
body, h1, form, input, button, div {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background-color: #121212;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
  box-sizing: border-box;
  padding-bottom: 70px; /* Ensure footer has space */
}

/* Global image rendering settings for pixel art */
img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  image-rendering: crisp-edges;
}

/* Floating donut background */
.donut-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.donut {
  position: absolute;
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  opacity: 0.65;
  z-index: 1;
  animation: float 20s linear infinite;
  pointer-events: none;
  /* Add subtle shadow for more depth */
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
  /* Add slight scale transitions */
  transition: transform 1s ease-in-out;
  /* Hide image boundaries */
  background-color: transparent !important;
  border: none;
  outline: none;
}

/* Randomly alternate the rotation direction */
.donut:nth-child(even) {
  animation-direction: reverse;
}

/* Make some items appear slower */
.donut:nth-child(3n) {
  animation-duration: 25s;
}

/* Make some items appear faster */
.donut:nth-child(5n) {
  animation-duration: 15s;
}

@keyframes float {
  0% {
    transform: translateY(-100%) rotate(0deg) scale(1);
    opacity: 0; /* Start fully transparent */
  }
  10% {
    opacity: 0.65; /* Fade in */
  }
  33% {
    transform: translateY(calc(33vh - 100%)) rotate(120deg) scale(0.9);
    opacity: 0.65;
  }
  66% {
    transform: translateY(calc(66vh - 100%)) rotate(240deg) scale(1.1);
    opacity: 0.65;
  }
  90% {
    opacity: 0.65; /* Begin fade out */
  }
  100% {
    transform: translateY(100vh) rotate(360deg) scale(1);
    opacity: 0; /* End fully transparent */
  }
}

/* Top Bar Styling */
.top-bar {
  position: fixed; /* Keep it at the top */
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background-color: #1f1f1f; /* Slightly lighter than body background */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 100; /* Ensure it's above other content */
}

.logo {
  height: 40px; /* Adjust size as needed */
  width: 40px;
  margin-right: 15px;
  image-rendering: pixelated;
}

.title {
  font-size: 1.8rem; /* Adjust size */
  color: #e0e0e0;
  font-weight: bold;
}

/* Adjust main container padding to prevent overlap with fixed top bar */
.container {
  padding-top: 70px; /* Reduced from 80px */
  margin-top: 15px; /* Reduced from 20px */
  display: flex; /* Make container a flex container */
  flex-direction: column; /* Arrange children vertically */
  max-width: 100%;
  text-align: center;
  padding-left: 2rem; /* Set side/bottom padding explicitly */
  padding-right: 2rem;
  padding-bottom: 2rem;
  background-color: rgba(25, 25, 35, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 90%;
  max-width: 600px;
  position: relative;
  /* Additional glass effect highlights */
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(0, 0, 0, 0.05) 100%
  );
}

h1 {
  margin-bottom: 2rem;
  font-size: 2.5rem;
  text-shadow: 0 2px 10px rgba(98, 0, 238, 0.5);
}

.main-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1; /* Allow main-content to grow vertically */
}

#generationContainer {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0; /* No additional padding at the top */
}

/* Prompt section styling */
#promptSection {
  width: 100%;
  padding-top: 0;
  margin-top: 0;
}

.description {
  font-size: 1.5rem;
  color: #e0e0e0;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
}

.prompt-input-container {
  display: flex;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 100px;
  overflow: hidden;
  background-color: #2c2c2c;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#promptInput {
  flex: 1;
  padding: 1rem 1.5rem;
  font-size: 1.25rem;
  border: none;
  background-color: transparent;
  color: #e0e0e0;
  outline: none;
}

#promptForm button {
  border: none;
  padding: 1.2rem 2.5rem;
  background-color: #6200ee;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

#promptForm button:hover {
  background-color: #3700b3;
}

/* Result section styling */
#resultSection {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

#imageContainer {
  position: relative;
  margin: 0 auto;
  width: 256px;
  height: 256px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.result-image {
  width: 256px;
  height: 256px;
  cursor: pointer;
  /* Remove background transparency grid from main display */
  background-color: transparent;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  image-rendering: pixelated !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  -ms-interpolation-mode: nearest-neighbor !important;
  /* Prevent stretching */
  object-fit: contain;
  max-width: 100%;
}

.result-image:hover {
  transform: scale(1.05);
}

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

#regenerateButton, #downloadMcaddonButton, #shareMcaddonButton {
  padding: 1rem 2rem;
  font-size: 1.4rem;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

#regenerateButton:hover, #downloadMcaddonButton:hover, #shareMcaddonButton:hover {
  background-color: #3d3d3d;
}

#downloadMcaddonButton {
  background-color: #4CAF50;
  color: white;
  border: none;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  overflow: visible;
  text-overflow: initial;
  height: auto;
  min-height: 48px;
}

#downloadMcaddonButton:hover {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#shareMcaddonButton {
  background-color: #2196F3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.share-icon {
  font-size: 1.2rem;
}

.hidden {
  display: none !important;
}

#downloadMcaddonButton:disabled, #shareMcaddonButton:disabled {
  background-color: #cccccc;
  color: #888888;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.7;
}

/* Error message styling */
.error {
  color: #ff5252;
  font-size: 1rem;
  padding: 1rem;
  background-color: rgba(255, 82, 82, 0.1);
  border-radius: 8px;
  width: 100%;
  margin: 1rem 0;
}

/* Loader styles */
.loader {
  border: 8px solid rgba(255, 255, 255, 0.1);
  border-top: 8px solid #6200ee;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

.hidden {
  display: none;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Modal Styles --- */
.modal {
  position: fixed;
  z-index: 100;
  padding-top: 10px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.8);
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* --- Edit modal styling --- */
#editModal .modal-content {
  position: relative;
  width: 700px;
  max-width: 95%;
  background-color: #1e1e1e;
  padding: 1rem;
  margin: 40px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  background-image: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  overflow-y: auto;
  max-height: 90vh;
}

/* New layout with sidebar */
.editor-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 15px;
  justify-content: center;
  background-image: none;
}

/* Left toolbar styles */
#editToolbar {
  width: 80px;
  height: 512px;
  background-color: #2c2c2c;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
  flex-shrink: 0;
}

/* Right toolbar styles */
#editActionToolbar {
  width: 80px;
  height: 512px;
  background-color: #2c2c2c;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  overflow-y: auto;
  flex-shrink: 0;
}

/* Common button styles for both toolbars */
#editToolbar button, #editActionToolbar button {
  margin: 5px 0;
  padding: 0.5rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 4px;
  background-color: #6200ee;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Style for color picker and brush size controls */
#editToolbar label {
  color: #e0e0e0;
  margin-bottom: 5px;
  font-size: 14px;
  display: block;
  text-align: center;
  font-size: 1.2rem;
}

#brushColor {
  width: 40px;
  height: 30px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
  margin: 0 auto;
}

#brushSize {
  width: 20px;
  height: 100px;
  margin: 0 10px;
  -webkit-appearance: slider-vertical;
  writing-mode: bt-lr;
  display: block;
}

#brushSizeValue {
  color: #e0e0e0;
  font-size: 14px;
  min-width: 40px;
  display: inline-block;
  text-align: center;
  margin-top: 5px;
}

#editCanvasContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  /* Remove distracting background/padding */
  background-color: transparent;
  padding: 0;
  border-radius: 4px;
  flex-grow: 1; /* Allow canvas container to grow */
}

#editCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: none;
  border: none;
  background: transparent;
  image-rendering: pixelated !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  -ms-interpolation-mode: nearest-neighbor !important;
  cursor: crosshair;
}

/* Active state styling for toolbar buttons */
#editToolbar button.active, #editActionToolbar button.active {
  background-color: #3700b3;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Toolbar groups for better organization */
.toolbar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 5px 0;
  width: 100%;
}

/* Make sure the close button is visually distinct */
#closeEdit {
  background-color: #d32f2f;
}

#closeEdit:hover {
  background-color: #b71c1c;
}

/* Make save button stand out */
#saveEdit {
  background-color: #388e3c;
}

#saveEdit:hover {
  background-color: #2e7d32;
}

/* Add position:relative to both toolbars for tooltips */
#editToolbar button, #editToolbar label, #editActionToolbar button {
  position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 1.25rem;
    width: 95%;
    margin: 2rem auto;
  }
  
  h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }
  
  .prompt-input-container {
    flex-direction: column;
    border-radius: 8px;
  }
  
  #promptInput {
    width: 100%;
    border-radius: 8px 8px 0 0;
    padding: 1rem;
    font-size: 1rem;
  }
  
  #promptForm button {
    width: 100%;
    border-radius: 0 0 8px 8px;
    padding: 0.8rem;
  }
  
  /* Hide download button on mobile */
  #downloadMcaddonButton.mobile-hidden {
    display: none !important;
  }
  
  /* Result image container for mobile */
  #imageContainer {
    width: 240px;
    height: 240px;
  }
  
  .result-image {
    width: 240px;
    height: 240px;
    max-width: 100%;
    object-fit: contain;
  }
  
  .js-image-container {
    width: 240px;
    height: 240px;
  }
  
  /* Edit button styles removed */
  
  /* Edit modal adjustments for mobile */
  .editor-layout {
    flex-direction: column;
    gap: 10px;
  }
  
  #editToolbar, #editActionToolbar {
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 10px;
    overflow-x: auto;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
  }
  
  .toolbar-group {
    flex-direction: row;
    width: auto;
    margin: 0 10px;
  }
  
  #editCanvasContainer {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
  }
  
  /* Make the modal smaller on mobile */
  #editModal .modal-content {
    width: 95%;
    padding: 0.8rem;
  }
  
  /* Make canvas fit better on mobile */
  .canvas-stack {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    max-width: 300px;
    max-height: 300px;
    margin: 0 auto;
  }

  /* Fix editor canvas sizing */
  #backgroundCanvas,
  #editCanvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 300px;
    max-height: 300px;
  }

  /* Better handle touch events */
  #editCanvas {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Fix Safari issues */
  * {
    -webkit-touch-callout: none;
  }

  /* Mobile adjustments for download container */
  .download-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .download-container button {
    width: 100%;
    max-width: 280px;
  }
}

/* Small screens */
@media (max-width: 480px) {
  .container {
    padding: 1rem;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    margin: 0;
  }
  
  h1 {
    font-size: 1.5rem;
    margin: 1rem 0;
  }
  
  .buttons-container {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  #regenerateButton, #downloadMcaddonButton {
    width: 100%;
  }

  /* Image container for very small screens */
  #imageContainer {
    width: 200px;
    height: 200px;
  }
  
  .result-image {
    width: 200px;
    height: 200px;
  }
  
  .js-image-container {
    width: 200px;
    height: 200px;
  }

  /* Edit button styles removed */

  /* Even smaller edit modal for tiny screens */
  .canvas-stack {
    max-width: 240px;
    max-height: 240px;
  }

  #backgroundCanvas,
  #editCanvas {
    max-width: 240px;
    max-height: 240px;
  }

  /* Make edit toolbars more compact */
  #editToolbar button, #editActionToolbar button {
    width: 40px;
    height: 40px;
    padding: 0.4rem;
    font-size: 1rem;
  }

  /* Fix edit modal positioning */
  #editModal .modal-content {
    margin: 10px auto;
    max-height: 95vh;
    position: relative;
    padding: 0.5rem;
    overflow-y: auto;
  }

  #downloadMcaddonButton {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.2;
  }
}

/* Stacked canvas setup for the editor */
.canvas-stack {
  position: relative;
  /* Keep the UI display size reasonable */
  width: 512px;
  height: 512px;
  /* Remove the border causing the shadow effect */
  border: none;
}

.stacked-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Ensure pixelated rendering for crisp pixels */
  image-rendering: pixelated !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  -ms-interpolation-mode: nearest-neighbor !important;
}

/* Make sure the background canvas is behind */
#backgroundCanvas {
  z-index: 1;
}

/* Make sure the edit canvas is on top */
#editCanvas {
  z-index: 2;
  cursor: crosshair;
}

/* Style for images both before and after editing - we won't use this directly */
.checkerboard-bg {
  /* We'll apply this background pattern using JavaScript for consistency */
  background-color: transparent;
}

/* Remove other background styles that might interfere */
.edited-image {
  width: 256px !important;
  height: 256px !important;
  image-rendering: pixelated !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  -ms-interpolation-mode: nearest-neighbor !important;
}

/* Style for the dynamically created image containers */
.js-image-container {
  width: 320px;
  height: 320px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  image-rendering: pixelated !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  /* Remove the transparency grid background */
  background-image: none !important;
  background-color: transparent !important;
  /* Add transition for hover effect */
  transition: transform 0.3s;
}

.js-image-container:hover {
  transform: scale(1.05);
}

/* Tab styling for result section */
.result-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
  padding: 0.5rem 1.5rem;
  background-color: transparent;
  color: #a0a0a0;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  margin: 0 0.5rem;
}

.tab-button:hover {
  color: #ffffff;
}

.tab-button.active {
  color: #ffffff;
  border-bottom: 3px solid #6200ee;
}

.tab-content {
  display: none;
  width: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
}

/* JSON display styling */
.json-display {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin: 0 auto;
  max-width: 500px;
  max-height: 250px; /* Reduced from 300px */
  overflow-y: auto;
  text-align: left;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  position: relative;
  /* Add smooth scrolling with quicker speed */
  scroll-behavior: auto;
  overscroll-behavior: contain;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
  z-index: 5;
}

.copy-button:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.copy-button:active {
  background-color: #6200ee;
}

.copy-success {
  background-color: #4caf50 !important;
}

.json-display::-webkit-scrollbar {
  width: 8px;
}

.json-display::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.json-display::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.json-display::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.json-content {
  white-space: pre-wrap;
  /* Add auto overflow for faster scrolling */
  max-height: 280px;
  overflow-y: auto;
  padding-right: 5px;
}

/* New style for components section to display on a single line */
.json-components {
  white-space: nowrap;
  overflow-x: auto;
  display: block;
}

.json-key {
  color: #8bc34a;
}

.json-string {
  color: #ff9800;
}

.json-number {
  color: #2196f3;
}

.json-boolean {
  color: #e91e63;
}

.json-null {
  color: #9e9e9e;
}

/* API Mode Indicator */
.api-mode-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 9999;
  color: white;
  font-weight: bold;
  opacity: 0.8;
  pointer-events: none;
}

.api-mode-indicator.local {
  background-color: #ff9800;
}

.api-mode-indicator.api {
  background-color: #4caf50;
}

/* New Item button in header */
.result-header {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 15px;
}

.new-item-button {
  background-color: #414141;
  color: #e0e0e0;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.new-item-button:hover {
  background-color: #555555;
}

/* Pack info container */
.pack-info-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 15px;
  gap: 10px;
}

.pack-prompt, .pack-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.pack-prompt label, .pack-name label {
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: #aaaaaa;
}

.pack-prompt input, .pack-name input {
  width: 100%;
  padding: 8px 10px;
  background-color: #2c2c2c;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.9rem;
}

.pack-prompt input {
  background-color: #333;
  cursor: default;
}

.pack-name input {
  cursor: text;
}

.pack-name input:focus {
  border-color: #6200ee;
  outline: none;
}

/* Media query adjustments */
@media (max-width: 480px) {
  .pack-info-container {
    flex-direction: column;
  }
}

/* Pack name container below image */
.pack-name-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 256px;
  margin: 15px auto 0;
  position: relative;
  padding-bottom: 15px;
}

.pack-name-container label {
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #aaaaaa;
  align-self: flex-start;
}

.pack-name-container input {
  width: 100%;
  padding: 8px 10px;
  background-color: #2c2c2c;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.9rem;
  text-align: center;
}

.pack-name-container input:focus {
  border-color: #6200ee;
  outline: none;
}

@media (max-width: 480px) {
  .pack-name-container {
    max-width: 200px;
  }
}

/* Download container at the bottom */
.download-container {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 20px 0 5px 0;
  position: relative;
}

/* Remove the border and add a subtle separator with box-shadow */
.download-container:before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.download-container button {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

#downloadMcaddonButton {
  background-color: #4CAF50;
  color: white;
  border: none;
}

#downloadMcaddonButton:hover:not(:disabled) {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#shareMcaddonButton {
  background-color: #2196F3;
  color: white;
  border: none;
}

#shareMcaddonButton:hover:not(:disabled) {
  background-color: #0b7dda;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Edit functionality removed */
.image-edit-button {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  pointer-events: none !important;
}

/* Navigation button in header */
.nav-button {
  background: none;
  border: none;
  color: #a0a0a0;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  transition: color 0.3s;
}
.nav-button:hover {
  color: #ffffff;
}
.nav-button.active {
  color: #ffffff;
  border-bottom: 3px solid #6200ee;
}

/* General modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: #1e293b;
  color: #fff;
  border-radius: 20px;
  padding: 30px;
  width: 95%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  position: relative;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-button:hover {
  color: #fff;
}