/* ---------------------------
   Variables & Reset
---------------------------- */
:root {
  --bg: #12151f;
  --text: #fff;
  --btn-grad-start: #8f00ff;
  --btn-grad-end:   #0058ff;
  --purple:         #8f00ff;
  --blue:           #0058ff;
  --card-bg:        #1e2230;
  --border-dash:    #8f00ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.5;
}

/* ---------------------------
   Typography & Layout
---------------------------- */
h1, h2, h3 {
  text-align: center;
  margin: 1rem 0;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0 1rem;
}

section {
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

/* ---------------------------
   Gradient Buttons
---------------------------- */
button, .btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--btn-grad-start), var(--btn-grad-end));
  color: white;
  transition: transform .2s, box-shadow .2s;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}

/* ---------------------------
   Upload Area
---------------------------- */
#drop-area {
  border: 2px dashed var(--border-dash);
  border-radius: 12px;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text);
  margin-bottom: 2rem;
  transition: background .2s;
}

#drop-area.hover {
  background: rgba(143,0,255,0.1);
}

/* ---------------------------
   Camera Section
---------------------------- */
/* Center the camera widget */
#camera {
  display: flex;
  flex-direction: column;
  align-items: center;    /* horizontal centering */
  justify-content: center;/* vertical centering within its section */
  gap: 1rem;              /* space between video, canvas, buttons, status */
  padding: 2rem 0;
}

/* Make sure the video element doesn’t just sit on the left */
#camera video {
  display: block;         /* override any inline-styles */
  max-width: 100%;        /* responsive */
  width: 600px;           /* or whatever max width you prefer */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  margin-bottom: 1rem;    /* space before the buttons */
}


/* ---------------------------
   Gallery Grid
---------------------------- */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 1.5rem;
}

.photo {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  position: relative;
  transition: transform .2s;
}

.photo:hover {
  transform: translateY(-4px);
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
}

.votes {
  display: flex;
  justify-content: space-around;
  padding: 0.5rem;
  background: rgba(0,0,0,0.2);
}

.votes .vote {
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: background .2s, color .2s;
}

.votes .vote:hover {
  background: var(--text);
  color: var(--bg);
}

/* ---------------------------
   “Scroll to Top” Button
---------------------------- */
#scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  text-decoration: none;
  padding: 0.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--btn-grad-start), var(--btn-grad-end));
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: transform .2s;
}

#scroll-top:hover {
  transform: translateY(-3px);
}

/* ---------------------------
   Responsive Tweaks
---------------------------- */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
  }
  button, .btn {
    width: 100%;
    text-align: center;
  }
}
/* Upload status */
.status {
  margin-top: 0.5rem;
  color: #8f00ff;
  font-weight: bold;
}

/* ————————————— Pending Upload Status ————————————— */
.status {
  margin-top: 0.5rem;
  color: #8f00ff;
  font-weight: bold;
}

.photo.pending {
  position: relative;
  opacity: 0.7;
}
.photo.pending .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
}

/* ————— Upload / Camera Status ————— */
.status {
  margin-top: 0.5rem;
  color: #8f00ff;
  font-weight: bold;
}

/* ————— Pending Card Overlay ————— */
.photo.pending {
  position: relative;
  opacity: 0.7;
}
.photo.pending .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
}

/* ————— Lightbox Modal Styles ————— */
/* ————— Lightbox Modal Styles (Flex‐based centering) ————— */
.lightbox {
  position: fixed;
  inset: 0;                 /* shorthand for top/right/bottom/left: 0 */
  z-index: 1000;
  display: none;            /* shown via JS */
  background: rgba(0,0,0,0.8);
  align-items: center;      /* vertical center */
  justify-content: center;  /* horizontal center */
}

.lightbox.active, .lightbox[style*="display: block"] {
  display: flex;
}

.lb-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-close {
  position: absolute;
  top: -1rem; right: -1rem;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
}

.lb-content img#lb-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.lb-navs {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.lb-nav {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.lb-votes {
  display: flex;
  gap: 1rem;
}

.lb-votes .vote {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}
/* ----------------------------
   My Gallery (logged-in user)
----------------------------- */
#my-gallery .cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

#my-gallery .card {
  flex: 0 0 150px;        /* each card is 150px wide */
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
}

#my-gallery .card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
/* --------------------------------
   Hero / Logo / Top Nav Pills
---------------------------------- */
/* ————— Override hero to stack vertically ————— */
.hero {
  /* make it a block-level flex container in column direction */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;      /* center the children text too */
  padding: 4rem 1rem 2rem;
}

.logo {
  /* block-level flex container (icon + text) */
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}


.hero-nav {
  display: inline-flex;
  gap: 1rem;
}

/* ensure your .btn gradient looks good here */
.hero-nav .btn {
  padding: 0.75rem 2rem;
}

/* -------------------------------
   Section Headings & Layout
--------------------------------- */
section.upload-section,
section.camera-section {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
}

.upload-section h2,
.camera-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* -------------------------------
   Drop-area & Camera already styled
--------------------------------- */
/* you already have #drop-area and #camera rules */

/* -------------------------------
   Gallery title spacing
--------------------------------- */
#gallery h2 {
  text-align: center;
  font-size: 2rem;
  margin: 2rem 0;
}
/* ————————————— Responsive / Mobile Friendly ————————————— */
@media (max-width: 768px) {
  /* Shrink hero paddings & logo */
  .hero {
    padding: 2rem 1rem;
  }
  .logo {
    font-size: 2.5rem;
  }

  /* Stack nav pills & auth links, full-width buttons */
  .hero-nav,
  .auth-nav {
    flex-direction: column;
    gap: 0.5rem;
  }
  .hero-nav .btn,
  .auth-nav .btn {
    width: 100%;
    max-width: 300px;
  }

  /* Tighter upload & camera sections */
  section.upload-section,
  section.camera-section {
    margin: 0 auto 2rem;
    padding: 0 1rem;
  }
  #drop-area {
    padding: 2rem 1rem;
  }

  /* Make camera video responsive */
  #camera video {
    width: 100%;
    height: auto;
  }

  /* Gallery: more, smaller columns */
  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  /* Center “My Gallery” cards on small screens */
  #my-gallery .cards {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  /* Even smaller logo & tighter spacing */
  .hero {
    padding: 1.5rem 0.5rem;
  }
  .logo {
    font-size: 2rem;
  }
  /* One-column gallery on phones */
  #gallery {
    grid-template-columns: 1fr;
  }
}
/* chat room */
.chat-container { display: flex; height: 80vh; }
.user-list    { width: 20%; border-right: 1px solid #ccc; overflow-y: auto; }
.chat-window  { flex: 1; display: flex; flex-direction: column; }
#messages     { flex: 1; overflow-y: auto; padding: 10px; }
.msg           { margin-bottom: 8px; }
.msg.incoming  { text-align: left; }
.msg.outgoing  { text-align: right; }
#chat-form     { display: flex; border-top: 1px solid #ccc; }
#msg-input     { flex: 1; padding: 8px; border: none; }
#chat-form button { padding: 8px 12px; }
.active        { background: #eef; cursor: pointer; }
#users li      { padding: 6px; cursor: pointer; }
.user-list li { position: relative; padding-right: 2.5em; }
.user-list .badge {
  position: absolute;
  top:  8px;
  right: 8px;
  background: red;
  color: #fff;
  border-radius: 50%;
  padding: 0 6px;
  font-size: 0.75em;
}
.tabs {
  display: flex;
  border-bottom: 1px solid #ccc;
  margin: 0;
}
.tabs button {
  flex: 1;
  padding: 8px;
  background: #f0f0f0;
  border: none;
  cursor: pointer;
}
.tabs button.active {
  background: #fff;
  border-bottom: 2px solid #007bff;
}
.user-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.block-btn, .unblock-btn {
  background: none;
  border: 1px solid #888;
  padding: 2px 6px;
  font-size: 0.8em;
  cursor: pointer;
}
.block-btn { color: red; }
.unblock-btn { color: green; }
.msg-body { /* preserves existing styling */ }
.msg-time {
  font-size: 0.75em;
  color: #666;
  text-align: right;
  margin-top: 4px;
}
