/* RESET ************************************************************/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

/* BODY *************************************************************/

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  color: #e5e7eb;
  background: #020617;
}

/* APP SHELL *******************************************************/

.app-shell {
  min-height: 100vh;
  max-width: 1160px;
  margin: 20px auto 24px;
  padding: 16px 18px 18px;
  border-radius: 18px;
  border: 1px solid #111827;
  background: #020617;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
}

/* HEADER ***********************************************************/

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #111827;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #1d4ed8;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #3b82f6;
}

.title-block h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.title-block p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.title-block code {
  background: #020617;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #1f2937;
}

.header-right {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* FIELD / INPUT ****************************************************/

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: #9ca3af;
}

.field-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.field input {
  background: #020617;
  border-radius: 999px;
  border: 1px solid #374151;
  padding: 7px 10px 7px 12px;
  color: #e5e7eb;
  font-size: 13px;
  outline: none;
  min-width: 230px;
}

.field input::placeholder {
  color: #6b7280;
}

/* BUTTONS **********************************************************/

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.16s ease,
    transform 0.08s ease,
    box-shadow 0.18s ease,
    border-color 0.16s ease;
  font-weight: 500;
}

.btn-primary {
  background: #1d4ed8;
  color: #f9fafb;
  border-color: #2563eb;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
  background: #020617;
  border-color: #374151;
  color: #e5e7eb;
}

.btn-secondary:hover {
  background: #030712;
  border-color: #4b5563;
}

/* LAYOUT ***********************************************************/

.app-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}

/* SIDEBAR **********************************************************/

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* CARD *************************************************************/

.card {
  border-radius: 12px;
  border: 1px solid #111827;
  background: #020617;
  padding: 10px 12px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

/* STATS ************************************************************/

.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: #9ca3af;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.stats-list strong {
  font-weight: 600;
  color: #e5e7eb;
}

/* MAIN CONTENT *****************************************************/

.main-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* STATUS BAR ******************************************************/

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-text {
  font-size: 13px;
  color: #9ca3af;
}

.badge {
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  background: #064e3b;
  border: 1px solid #10b981;
  color: #d1fae5;
}

/* GALLERY **********************************************************/

.gallery-card {
  padding-top: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

/* MEDIA CARD ******************************************************/

.media-card {
  border-radius: 10px;
  border: 1px solid #111827;
  background: #020617;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  cursor: pointer;
  transform: translateY(6px);
  opacity: 0;
  animation: mediaIn 0.28s ease-out forwards;
}

.media-card:hover {
  border-color: #2563eb;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.6);
  transform: translateY(1px);
}

@keyframes mediaIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Thumbnail */

.media-thumb {
  position: relative;
  height: 140px;
  background: #020617;
  overflow: hidden;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.media-card:hover .media-thumb img {
  transform: scale(1.05);
  filter: saturate(1.05);
}

.media-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid #111827;
}

/* Body */

.media-body {
  padding: 8px 10px 10px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.media-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e5e7eb;
}

.media-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #6b7280;
}

.media-actions {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.media-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #1f2937;
  color: #9ca3af;
}

.media-copy-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #2563eb;
  background: #020617;
  color: #bfdbfe;
  cursor: pointer;
}

.media-copy-btn:hover {
  background: #020617;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.6);
}

/* STATES **********************************************************/

.state-message {
  margin: 16px 0 4px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}

.state-message code {
  background: #020617;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #1f2937;
}

.state-error {
  color: #fca5a5;
}

/* FOOTER **********************************************************/

.app-footer {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #111827;
  font-size: 11px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-footer .dot {
  opacity: 0.6;
}

/* LIGHTBOX *********************************************************/

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  backdrop-filter: blur(18px);
}

.lightbox-inner {
  width: min(860px, 96vw);
  max-height: 90vh;
  border-radius: 16px;
  border: 1px solid #111827;
  background: #020617;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-header {
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #111827;
}

.lightbox-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #6b7280;
}

.lightbox-close {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid #ef4444;
  background: #b91c1c;
  color: #f9fafb;
  cursor: pointer;
  font-size: 15px;
}

.lightbox-body {
  padding: 10px 12px;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-body img {
  max-width: 100%;
  max-height: 60vh;
}

.lightbox-footer {
  padding: 8px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #111827;
}

.lightbox-caption {
  flex: 1;
  font-size: 12px;
  color: #d1d5db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-caption .dim {
  color: #60a5fa;
  margin-left: 8px;
}

.lightbox-actions {
  display: flex;
  gap: 8px;
}

/* RESPONSIVE ******************************************************/

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .main-content {
    order: 1;
  }

  .field input {
    min-width: 180px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    margin: 12px auto 16px;
    padding-inline: 12px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}
