/* === RESET & GLOBAL === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background: #0d0f15;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* === HEADER === */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 2, 2, 0.4);
  padding: 15px 30px;
  color: white;
  position: relative;
  user-select: none;
}

.header-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

header .logo {
  width: 60px;
  height: 60px;
  transform: scale(1.2);
  margin-right: 15px;
  flex-shrink: 0;
}

header .text {
  font-size: 1.4vw;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
  flex: 1;
  min-width: 0;
}

header .total {
  font-weight: bold;
  color: #00ff9f;
  white-space: nowrap;
  font-size: 1.2rem;
  margin: 0 20px;
  flex-shrink: 0;
  background: rgba(0, 255, 159, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(0, 255, 159, 0.3);
  backdrop-filter: blur(10px);
}

.right-header {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

/* === AUTHENTICATION STYLES === */
.auth-btn {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(88, 101, 242, 0.6);
  background: linear-gradient(135deg, #4752c4, #5865f2);
}

.logout-btn {
  background: linear-gradient(135deg, #ed4245, #c73e1d);
  box-shadow: 0 4px 12px rgba(237, 66, 69, 0.4);
}

.logout-btn:hover {
  background: linear-gradient(135deg, #c73e1d, #ed4245);
  box-shadow: 0 6px 16px rgba(237, 66, 69, 0.6);
}

.user-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 15px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #00ff9f;
}

.admin-badge {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

/* === MAIN === */
main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* === SIDEBAR === */
#sidebar {
  width: 200px;
  background-color: #12141b;
  padding: 10px;
  overflow-y: auto;
  border-right: 1px solid #1f1f1f;
  position: relative;
}

#sidebar button {
  display: block;
  width: 100%;
  height: 40px;
  margin-bottom: 10px;
  padding: 10px 10px;
  background: #1c1e26;
  color: #fff;
  border: none;
  border-radius: 0.25vh;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
}

#sidebar button:hover,
#sidebar button:focus {
  background: #2b2e39;
  outline: none;
}

/* === GALLERY === */
#gallery {
  flex: 1;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 180px;
  gap: 20px;
  overflow-y: auto;
  position: relative;
}

.image-container {
  background: #1c1e26;
  border-radius: 0.25vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  min-height: 180px;
  box-sizing: border-box;
  justify-content: space-between;
}

.image-container img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  flex-shrink: 0;
  user-select: none;
  cursor: pointer;
}

.image-container img:hover {
  filter: brightness(1.2);
}

.caption {
  margin-top: -15px;
  font-size: 0.85em;
  color: #ccc;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
  text-align: center;
}

/* === DRAG AND DROP ZONE === */
.drop-zone {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  border: 3px dashed #00ff9f;
  border-radius: 10px;
  background: rgba(0, 255, 159, 0.1);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #00ff9f;
  font-weight: bold;
  z-index: 100;
  pointer-events: none;
}

.drop-zone.active {
  display: flex;
    pointer-events: auto; 

}

/* === LIGHTBOX === */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.95);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

#lightbox.show {
  display: flex;
}

#lightbox img {
  max-width: 90%;
  max-height: 80vh;
  margin-bottom: 20px;
  user-select: none;
}

.close-btn,
.nav-btn {
  position: absolute;
  font-size: 2em;
  cursor: pointer;
  color: #fff;
  user-select: none;
  transition: color 0.2s ease;
}

.close-btn:hover,
.nav-btn:hover {
  color: #00ff9f;
}

.close-btn {
  top: 20px;
  right: 30px;
}

.nav-btn.left {
  top: 50%;
  left: 30px;
  transform: translateY(-50%);
}

.nav-btn.right {
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
}

/* === CONTEXT MENU === */
#context-menu {
  position: fixed;
  z-index: 9999;
  background: #1c1e26;
  border: 1px solid #2b2e39;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  min-width: 180px;
  overflow: hidden;
}

#sidebar-context-menu {
  position: fixed;
  z-index: 9999;
  background: #1c1e26;
  border: 1px solid #2b2e39;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  min-width: 200px;
  overflow: hidden;
}

.context-item {
  padding: 10px 16px;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.context-item:hover {
  background: #2b2e39;
}

.context-delete {
  color: #ff6b6b;
  border-top: 1px solid #2b2e39;
}

.context-delete:hover {
  background: #ff6b6b;
  color: white;
}

.context-admin {
  color: #00ff9f;
  border-top: 1px solid #2b2e39;
}

.context-admin:hover {
  background: #00ff9f;
  color: #1c1e26;
}

/* === MODAL === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #1c1e26;
  padding: 30px;
  border-radius: 10px;
  border: 1px solid #2b2e39;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2b2e39;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #00ff9f;
}

.modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #ff6b6b;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #ccc;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px;
  background: #2b2e39;
  border: 1px solid #444;
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #00ff9f;
}

.file-drop-zone {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  background: #2b2e39;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 15px;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: #00ff9f;
  background: rgba(0, 255, 159, 0.1);
}

.file-drop-zone i {
  font-size: 2rem;
  color: #666;
  margin-bottom: 10px;
  display: block;
}

.file-drop-zone.has-file {
  border-color: #00ff9f;
  background: rgba(0, 255, 159, 0.1);
}

.file-drop-zone.has-file i {
  color: #00ff9f;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #00ff9f, #00cc7a);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00cc7a, #00ff9f);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 159, 0.3);
}

.btn-secondary {
  background: #2b2e39;
  color: #ccc;
}

.btn-secondary:hover {
  background: #3a3f4f;
  color: white;
}

.discord-btn {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discord-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(88, 101, 242, 0.6);
  background: linear-gradient(135deg, #4752c4, #5865f2);
}

footer {
  background: rgba(2, 2, 2, 0.4);
  padding: 15px 30px;
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
  border-top: 1px solid #1f1f1f;
}

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

.footer-content .credits a {
  color: #00ff9f;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-content .credits a:hover {
  color: #00ffaa;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  header {
    padding: 10px 15px;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .header-left {
    justify-content: center;
  }

  header .logo {
    transform: scale(1.5);
    margin-right: 10px;
  }

  header .text {
    font-size: 4vw;
    text-align: center;
  }

  header .total {
    font-size: 1rem;
    margin: 0;
    text-align: center;
    align-self: center;
  }

  .right-header {
    justify-content: center;
    gap: 10px;
  }

  .user-info {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
  }

  #sidebar {
    width: 140px;
    padding: 8px;
  }

  #sidebar button {
    font-size: 0.9em;
    padding: 6px 10px;
  }

  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 15px;
  }

  .image-container {
    min-height: 160px;
    padding: 8px;
  }

  .image-container img {
    max-height: 100px;
  }

  .auth-btn {
    padding: 8px 15px;
    font-size: 0.8rem;
  }

  .modal-content {
    padding: 20px;
    max-width: 95%;
  }
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-thumb {
  background-color: #1f1f1f;
}