/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Space Mono", monospace;
  background: #101830 url("images/heaven-header.jpg") no-repeat center center / cover;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  color: white;
}

/* === FLOATING LOGO STARBURST === */
.logo {
  width: min(80vw, 400px);
  margin: 20px auto 0 auto;
  position: relative;
  overflow: visible;
}

.logo-float {
  width: 100%;
  height: 100%;
  position: relative;
  animation: float 6s ease-in-out infinite;
}

.logo img {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0);
  }
}

/* === NAVIGATION BAR === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 30px auto;
  text-align: center;
}

.menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap; /* Single row on desktop */
  gap: 10px;
  padding: 0 10px;
}

@media (max-width: 768px) {
  .menu {
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
  }
}

.menu-item {
  flex-shrink: 1;
}

.menu-item a {
  color: #60a5fa;
  text-decoration: none;
  font-size: clamp(12px, 1.2vw, 16px);
  background: rgba(30, 30, 30, 0.65);
  border-radius: 5px;
  padding: 8px 15px;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: center;
}

@media (max-width: 768px) {
  .worst-item {
    width: 100%;
    max-width: 300px;
  }
  .menu-item a {
    width: 100%;
    padding: 10px 20px;
    font-size: clamp(14px, 1.5vw, 18px);
  }
}

.menu-item a small {
  font-size: 0.7em;
  color: #93c5fd;
}

.menu-item a:hover {
  box-shadow: 0 0 15px rgba(96, 165, 250, 1);
}

/* === GALLERY GRID === */
.gallery {
  max-width: 100%;
  margin: 20px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  padding: 0 5px;
  overflow-x: hidden;
}

.approval-gallery {
  max-width: 1200px;
  margin: 20px auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  padding: 0 10px;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, calc(50vw - 15px)); /* Fit within 100vw */
  }
  .approval-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery .media-wrapper {
    padding: 1px;
  }
}

.media-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border-radius: 5px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: 0.3s ease;
  background: #1a2639;

  box-sizing: border-box;
}



.media-wrapper:hover {
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(96, 165, 250, 1);
}

.galmedia {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Stretch to fill square */
  cursor: pointer;
  position: relative;
  margin-bottom: 5px;
}

.approval-gallery .galmedia {
  max-height: 100%; /* Leave space for buttons/input */
}

/* === VIDEO PLAY OVERLAY === */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  margin-bottom: 5px;
}

.approval-gallery .video-wrapper {
  max-height: calc(100% - 90px); /* Leave space for buttons/input */
}

.galvid {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Stretch to fill square */
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  z-index: 2;
}

.play-overlay::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 20px solid #000;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 5px;
}

/* === DOWNLOAD BUTTON === */
.download-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  font-size: 24px;
  color: #000;
  z-index: 10;
}

.download-btn::before {
  content: "⬇";
}

/* === FULLSCREEN MODE === */
.galmedia.full {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain; /* Show full image uncropped in fullscreen */
  background: #000;
  z-index: 1000;
}

.fullscreen-download {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 1001 !important;
  width: 40px !important;
  height: 40px !important;
  font-size: 28px !important;
}

@media (max-width: 768px) {
  .fullscreen-download {
    right: 10px !important;
    bottom: 10px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 24px !important;
  }
}

#vClose {
  display: none;
  position: fixed;
  top: 15px;
  right: 15px;
  font-size: 32px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 50%;
  z-index: 1001;
  cursor: pointer;
}

#vClose.show {
  display: block;
}

/* === UPLOAD / SEARCH === */
.upload-section,
.search-section,
.approval-header {
  text-align: center;
  margin: 20px auto;
}

.file-input-label,
.upload-btn {
  padding: 10px 20px;
  background: #1a1a1a;
  color: #60a5fa;
  border: 1px solid #60a5fa;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  margin: 5px;
}

.file-input-label:hover,
.upload-btn:hover {
  background: #60a5fa;
  color: #1a1a1a;
}

#search-input {
  padding: 10px;
  width: 80%;
  max-width: 400px;
  border: 1px solid #60a5fa;
  border-radius: 5px;
  font-weight: bold;
  background: #101830;
  color: #fff;
}

/* === UPLOAD PROGRESS === */
#upload-overlay {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 20px 30px;
  border: 2px solid #60a5fa;
  border-radius: 10px;
  z-index: 9999;
  text-align: center;
}

#progress-text {
  color: #fff;
  margin-bottom: 10px;
}

#progress-bar {
  height: 6px;
  background: #60a5fa;
  width: 0%;
  transition: width 0.3s ease;
}

/* === APPROVAL BUTTONS (rename / approve / delete) === */
.rename-input {
  display: block !important;
  width: 100%;
  padding: 8px;
  margin: 5px 0 0 0;
  border: 1px solid #60a5fa;
  background: #000;
  color: #fff;
  border-radius: 5px;
  text-align: center;
  font-size: 14px;
  z-index: 20;
  box-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
  pointer-events: auto;
}

.approval-actions {
  display: flex !important;
  justify-content: center;
  gap: 8px;
  z-index: 20;
  pointer-events: auto;
}

.approval-actions button {
  display: inline-block !important;
  margin: 4px;
  padding: 8px 12px;
  border-radius: 5px;
  font-weight: bold;
  font-family: monospace;
  cursor: pointer;
}

.approve-btn {
  background: #28a745;
  color: white;
  border: none;
}

.delete-btn {
  background: #dc3545;
  color: white;
  border: none;
}

/* Prevent body overflow when fullscreen active */
body.fullscreen-active {
  overflow: hidden !important;
}

/* Ensure no horizontal scroll on mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden !important;
  }
  .container,
  .gallery,
  .approval-gallery {
    width: 100%;
    max-width: 100%;
    padding: 0 5px;
  }
}

/* CONTRACT ADDRESS */
.contract-container {
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  text-align: center;
  z-index: 3;
}

.contract-address {
  color: #60a5fa;
  text-decoration: none;
  font-size: clamp(14px, 1.5vw, 18px);
  background: rgba(30, 30, 30, 0.65);
  border-radius: 5px;
  padding: 10px 20px;
  box-shadow: 0 0 8px rgba(96,165,250,0.5);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}

.contract-address small {
  font-size: 0.7em;
  color: #93c5fd;
  margin-top: 4px;
}

.contract-address:hover {
  animation: sparkle 1.5s infinite;
}

.contract-address::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 15px;
  width: calc(100% - 30px);
  height: 2px;
  background: #60a5fa;
  box-shadow: 0 0 4px #60a5fa;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contract-address:hover::after {
  opacity: 1;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .contract-address {
    font-size: clamp(12px, 1.3vw, 16px);
    padding: 8px 15px;
  }
}

/* Popup Notification */
.popup {
  position: absolute;
  background: rgba(30, 30, 30, 0.85);
  color: #60a5fa;
  font-size: clamp(12px, 1.3vw, 14px);
  padding: 8px 12px;
  border-radius: 5px;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
  z-index: 10;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none; /* Prevents interaction with the popup */
  white-space: nowrap;
}

.popup.show {
  opacity: 1;
  transform: translateY(0);
}

  /* Wrapper for centering the login container */
        .login-page-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh; /* Full viewport height, using min-height to avoid overflow issues */
            margin: 0;
        }


        /* Style the login container */
        .login-container {
            background-color: #f0f0f0;
            padding: 2rem; /* Increased padding */
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            width: 90%; /* Responsive width */
            max-width: 500px; /* Increased from typical ~300px */
            text-align: center; /* Center text inside */
            color: black;
        }

        /* Style the heading */
        .login-container h2 {
            font-size: 2.5rem; /* Doubled from typical ~1.2rem */
            margin-bottom: 1.5rem;
        }

        /* Style labels */
        .login-container label {
            display: block;
            font-size: 1.5rem; /* Doubled from typical ~0.8rem */
            margin-bottom: 0.5rem;
            text-align: left;
            color: black;
        }

        /* Style input fields */
        .login-container input[type="text"],
        .login-container input[type="password"] {
            width: 100%;
            padding: 1rem; /* Increased padding */
            font-size: 1.5rem; /* Doubled from typical ~0.8rem */
            margin-bottom: 1.5rem;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-sizing: border-box;
        }

        /* Style the button */
        .login-container .upload-btn {
            width: 100%;
            padding: 1rem; /* Increased padding */
            font-size: 1.5rem; /* Doubled from typical ~0.8rem */
            background-color: blue;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .login-container .upload-btn:hover {
            background-color: #45a049;
        }

        /* Style the error message */
        .login-container p {
            font-size: 1.2rem; /* Doubled from typical ~0.6rem */
            color: red;
            margin-top: 1rem;
        }