@import url('../colors.css');

/* Base reset / theme */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Kumbh Sans', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-purple, #7c3aed) #f1f5f9;
}

html { scroll-padding-top: 90px; scroll-behavior: smooth; }
body { background:#ffffff; color:#0f172a; }
body.no-scroll { overflow: hidden; }

.longbar { width:100%; height:1px; background:#e5e7eb; display:block; }

/* ---------------- Navbar ---------------- */
.navbar {
  background:#ffffff;
  height:90px;
  display:flex; justify-content:center; align-items:center;
  position: sticky; top:0; z-index:999;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.navbar-container {
  display:flex; justify-content:space-between; align-items:center;
  height:90px; width:100%; max-width:1300px; padding:0 24px;
}
#navbar-logo { display:flex; align-items:center; text-decoration:none; }
.logo {
  font-size:1.75rem; font-weight:700;
  background-image: var(--grad-txt, linear-gradient(90deg,#7c3aed,#a855f7));
  background-size:100%;
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  transition: transform .2s ease, filter .2s ease;
}
.logo:hover { transform:scale(1.06); filter:brightness(1.1); }

.navbar-menu-center, .navbar-menu-right {
  display:flex; align-items:center; list-style:none; gap:8px;
}
.navbar-item { height:auto; width:auto; }
.navbar-links {
  color:#0f172a; text-decoration:none; padding:8px 12px;
  border-radius:8px; transition: all .2s ease;
}
.navbar-links:hover { background:#f1f5f9; transform: translateY(-1px); }

.navbar-btn {
  font-size:15px; font-weight:700;
  background-image: var(--grad-btn, linear-gradient(90deg,#7c3aed,#a855f7));
  padding:12px 18px; border:none; border-radius:10px;
  color:#fff; cursor:pointer; outline: none;
  box-shadow: 0 8px 16px rgba(124,58,237,.18);
  transition: transform .15s ease, filter .2s ease;
}
.navbar-btn a { color:#fff; text-decoration:none; }
.navbar-btn:hover { filter:brightness(1.08); transform: translateY(-1px); }

/* Mobile nav */
.navbar-toggle { display:none; background:none; border:none; cursor:pointer; }
.navbar-toggle .bar { width:24px; height:3px; margin:4px; background:#0f172a; transition: all .2s ease; }
#primary-menu { transition: all .3s ease; }

@media (max-width: 960px) {
  .navbar-toggle { display:block; }
  .navbar-container { padding:0 16px; }
  .navbar-menu-center {
    position:absolute; left:0; top:-1000px; width:100%;
    display:grid; grid-template-columns:1fr; gap:0;
    background:#ffffff; box-shadow: 0 16px 24px rgba(2,6,23,0.08);
  }
  .navbar-menu-center.active { top:100%; z-index:98; }
  .navbar-links { display:block; padding:16px; }
}

/* ---------------- Hero / Main ---------------- */
.main { background:#ffffff; }
.main-container {
  width:100%; max-width:1300px; margin:0 auto; padding:48px 24px 32px;
}
.main-content { text-align:center; }
.main-content h2 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  background-image: var(--grad-txt, linear-gradient(90deg,#7c3aed,#a855f7));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  margin-bottom:16px;
}
.main-content .lead {
  font-size: clamp(1rem, .9rem + .5vw, 1.25rem);
  color:#334155; max-width:900px; margin: 0 auto 28px;
}
.cta-row { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; }
.main-btn {
  display:inline-block; text-decoration:none; color:#fff;
  background-image: var(--grad-btn, linear-gradient(90deg,#7c3aed,#a855f7));
  padding:12px 18px; border-radius:10px; font-weight:700; font-size:14px;
  box-shadow:0 8px 16px rgba(124,58,237,.18); transition: filter .2s, transform .15s;
}
.main-btn:hover { filter:brightness(1.08); transform: translateY(-1px); }
/* ==================== Listings (fixed height cards + poster fit) ==================== */

.listings {
  background: #ffffff;
  display: block;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.listings-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.listings-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 24px 0 8px;
}

.listings-header h1 {
  font-size: 2rem;
  line-height: 1.1;
  margin: 0;
  color: #5b21b6; /* purple accent */
}

.listings-header .addlisting-btn {
  font-size: 0.95rem;
  font-weight: 700;
  background-image: var(--grad-btn);
  border: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  outline: 0;
  box-shadow: 0 6px 18px rgba(91, 33, 182, .18);
}

/* Grid for cards */
.cards-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: stretch;
}

/* Responsive columns */
@media (max-width: 1200px) {
  .cards-container { grid-template-columns: repeat(9, 1fr); }
}
@media (max-width: 900px) {
  .cards-container { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 640px) {
  .cards-container { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 430px) {
  .cards-container { grid-template-columns: repeat(2, 1fr); }
}

/* Each card spans columns to create 3 / 2 / 1 per row responsively */
.listings-card {
  grid-column: span 4;                 /* 3 per row on wide screens */
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #eee;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 520px;                   /* consistent height */
  max-height: 520px;
}

@media (max-width: 900px) {
  .listings-card { grid-column: span 6; } /* 2 per row */
}
@media (max-width: 640px) {
  .listings-card { grid-column: span 4; } /* 1–2 per row */
}

.listings-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.10);
}

/* Poster area */
.listings-card .img {
  width: 100%;
  height: 230px;               /* fixed poster area */
  object-fit: contain;         /* show the full poster */
  background: #f7f7fb;         /* subtle canvas behind posters */
  border-radius: 14px 14px 0 0;
}

/* Title */
.listings-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 10px 16px 4px;
  text-align: center;
  color: #111827;
}

/* Description – scrollable area */
.listings-card p {
  margin: 0 16px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1 1 auto;             /* fill available space between title and actions */
  min-height: 140px;
  max-height: 140px;          /* keeps card height consistent */
  overflow: auto;
  padding-right: 6px;         /* room for scrollbar */
  word-wrap: break-word;
  hyphens: auto;
  scrollbar-width: thin; 
  scrollbar-color: #c084fc #f1f5f9; /* Firefox */
}

/* WebKit scrollbar for the description */
.listings-card p::-webkit-scrollbar {
  width: 8px;
}
.listings-card p::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
.listings-card p::-webkit-scrollbar-thumb {
  background: #c084fc; /* purple */
  border-radius: 10px;
}
.listings-card p::-webkit-scrollbar-thumb:hover {
  background: #a855f7;
}

/* Actions pinned to bottom */
.listing-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px 16px;
  margin-top: auto;           /* always stick actions at the bottom */
  background: #fff;
  border-top: 1px solid #f1f5f9;
}

.listings-card .editlisting-btn,
.listings-card .deletelisting-btn {
  font-size: 0.9rem;
  font-weight: 700;
  background-image: var(--grad-btn);
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  color: #fff;
  outline: 0;
  box-shadow: 0 6px 18px rgba(91, 33, 182, .18);
  transition: transform .15s ease, box-shadow .15s ease;
}

.listings-card .editlisting-btn:hover,
.listings-card .deletelisting-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(91, 33, 182, .25);
}

/* ---------------- Popups ---------------- */
.popup1, .popup2 {
  display:none; position:fixed; inset:0; background: rgba(2,6,23,.55);
  justify-content:center; align-items:flex-start; padding:24px; z-index:9999;
}
.popup1.show, .popup2.show { display:flex; }
.popup-form {
  width:100%; max-width:760px; background:#ffffff; border-radius:16px;
  box-shadow:0 16px 32px rgba(2,6,23,.20); overflow:hidden;
}
.popup-header {
  display:flex; align-items:center; gap:10px; justify-content:flex-end;
  padding:16px 16px 0 16px;
}
.popup-header h2 {
  margin-right:auto; margin-left:8px;
  font-size:1.5rem;
  background-image: var(--grad-txt, linear-gradient(90deg,#7c3aed,#a855f7));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.video-call-btn { background:none; border:none; cursor:pointer; }
.video-call-icon { position:relative; width:24px; height:18px; display:inline-block; }
.plus-icon, .video-lens { position:absolute; }
.plus-icon { inset:0; }
.plus-icon::before, .plus-icon::after {
  content:''; position:absolute; background:#7c3aed;
}
.plus-icon::before { width:12px; height:2px; left:50%; top:50%; transform:translate(-50%,-50%); }
.plus-icon::after  { width:2px; height:12px; left:50%; top:50%; transform:translate(-50%,-50%); }
.video-lens { right:-6px; top:4px; width:6px; height:10px; background:#7c3aed; border-radius:2px; }

.close-btn {
  font-size:28px; line-height:1; border:none; background:#f1f5f9; color:#0f172a;
  border-radius:10px; padding:2px 10px; cursor:pointer; transition:filter .2s;
}
.close-btn:hover { filter:brightness(0.95); }

.popup-body { padding:8px 16px 20px; }
.popup-instruction { color:#334155; font-weight:600; text-align:center; margin:6px 0 12px; }
.formInput {
  width:100%; background:#f8fafc; color:#0f172a; border:1px solid #e5e7eb;
  border-radius:12px; padding:14px 16px; font-size:14px; margin:8px 0;
}
.formInput::placeholder { color:#94a3b8; }
.formInput:focus { outline:2px solid transparent; border-color:#c4b5fd; box-shadow: 0 0 0 3px rgba(124,58,237,.18); background:#fff; }

.file-field {
  display:flex; align-items:center; gap:10px; margin:10px 0; color:#334155; font-size:.95rem;
}
.file-field input[type="file"] { display:inline-block; }
.file-field span { opacity:.9; }

.popup-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:8px; }
.formsubmit-btn {
  padding:12px 18px; font-size:14px; font-weight:700; color:#fff; border:none; border-radius:10px;
  background-image: var(--grad-btn, linear-gradient(90deg,#7c3aed,#a855f7));
  box-shadow:0 8px 16px rgba(124,58,237,.18); cursor:pointer;
}
.btn-text { background:none; border:none; color:#334155; font-weight:600; cursor:pointer; }

/* ---------------- Offers ---------------- */
.offers { background:#ffffff; }
.offers-inner { max-width:1300px; margin:0 auto; padding:24px; }
.offers h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  background-image: var(--grad-txt, linear-gradient(90deg,#7c3aed,#a855f7));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  margin-bottom:12px;
}
.table-scroll { width:100%; overflow-x:auto; border:1px solid #e5e7eb; border-radius:14px; box-shadow:0 6px 16px rgba(2,6,23,.05); background:#fff; }
.offers-table { width:100%; border-collapse: collapse; min-width:720px; }
.offers-table thead tr { background:linear-gradient(90deg,#7c3aed,#a855f7); color:#fff; }
.offers-table th, .offers-table td { padding:14px 18px; text-align:center; font-size:14px; }
.offers-table tbody tr:nth-child(even) { background:#f8fafc; }
.offers-table a { color:#7c3aed; text-decoration:none; font-weight:600; }
.offers-table a:hover { text-decoration:underline; }

/* ---------------- User Card ---------------- */
.user-info { background:#ffffff; padding:24px; }
.user-card {
  max-width:900px; margin:0 auto; border:1px solid #e5e7eb; border-radius:16px; padding:20px;
  box-shadow:0 6px 16px rgba(2,6,23,.05); background:#fff;
}
.user-card h2 {
  background-image: var(--grad-txt, linear-gradient(90deg,#7c3aed,#a855f7));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  margin-bottom:8px;
}
.user-card p { color:#334155; margin:6px 0; }

/* ---------------- Footer ---------------- */
footer { text-align:center; padding:20px 12px; background:#ffffff; color:#0f172a; }

/* ---------------- Modals / Chat ---------------- */
.modal-overlay {
  position:fixed; inset:0; background: rgba(2,6,23,.55);
  display:none; align-items:center; justify-content:center; z-index:10000;
}
.modal-box {
  width: min(520px, 92vw); background:#ffffff; padding:20px; border-radius:16px;
  box-shadow:0 16px 32px rgba(2,6,23,.2); color:#0f172a;
}
.modal-box h3 { margin-bottom:10px; font-size:1.25rem; }
.modal-box input, .modal-box textarea {
  width:100%; padding:12px 14px; border:1px solid #e5e7eb; border-radius:10px;
  background:#f8fafc; margin:6px 0 10px; color:#0f172a;
}
.modal-actions { display:flex; gap:10px; justify-content:flex-end; }
.modal-btn { padding:10px 14px; border:none; border-radius:10px; cursor:pointer; font-weight:700; }
.modal-btn.confirm { color:#fff; background:linear-gradient(90deg,#7c3aed,#a855f7); }
.modal-btn.cancel { background:#f1f5f9; color:#0f172a; }

.chat-window {
  position:fixed; bottom:0; right:20px; width:300px; height:420px; background:#ffffff;
  border:1px solid #e5e7eb; border-radius:12px 12px 0 0; overflow:hidden; z-index:9999;
  display:flex; flex-direction:column; box-shadow:0 10px 24px rgba(2,6,23,.18);
}
#chatHeader { background:#7c3aed; color:#fff; padding:10px; display:flex; justify-content:space-between; align-items:center; }
.chat-title { font-weight:700; }
.chat-min-btn { background:none; border:none; color:#fff; font-size:20px; cursor:pointer; }
#chatMessages { flex:1; overflow-y:auto; padding:8px; background:#fff; color:#0f172a; }

/* Mini chat & restore button */
#restoreChatBtn {
  position:fixed; bottom:20px; right:20px; width:60px; height:60px; border:none;
  background:#7c3aed; border-radius:50% 50% 0 50%; color:#fff; display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 24px rgba(2,6,23,.18); cursor:pointer; transition: transform .2s;
}
#restoreChatBtn:hover { transform: scale(1.06); }
.chat-icon-body { display:flex; gap:8px; }
.dot { width:10px; height:10px; background:#fff; border-radius:50%; }

/* Mini chat boxes */
.mini-chatbox {
  position: fixed; bottom: 20px; width: 250px; background:#ffffff; border:1px solid #e5e7eb;
  border-radius: 12px; z-index: 10000; overflow:hidden; box-shadow:0 10px 24px rgba(2,6,23,.18);
}
.mini-chat-header { background:#7c3aed; color:#fff; padding:8px; text-align:center; font-weight:700; position:relative; display:flex; align-items:center; gap:10px; }
.mini-chat-close { background:none; border:none; color:#fff; font-size:16px; position:absolute; right:10px; cursor:pointer; }
.mini-chat-messages { display:flex; flex-direction:column; align-items:flex-start; height:220px; overflow-y:auto; padding:8px; background:#fff; }
.mini-chat-message { max-width:80%; margin:6px; padding:10px 14px; border-radius:16px; position:relative; word-break:break-word; }
.mini-chat-message.sent { align-self:flex-end; background:#7c3aed; color:#fff; border-bottom-right-radius:4px; }
.mini-chat-message.received { align-self:flex-start; background:#f1f5f9; color:#0f172a; border-bottom-left-radius:4px; }
.mini-chat-input { display:flex; background:#f8fafc; padding:8px; gap:6px; }
.mini-chat-input textarea { flex:1; max-height:100px; min-height:30px; padding:8px; border:1px solid #e5e7eb; border-radius:8px; resize:vertical; background:#fff; color:#0f172a; }
.mini-chat-input button { background:#7c3aed; color:#fff; border:none; padding:8px 10px; border-radius:8px; cursor:pointer; }

.date-label {
  text-align:center; margin:10px auto; padding:6px 12px; background:#f1f5f9; color:#334155;
  border-radius:12px; width:fit-content; font-size:.85rem;
}
.message-footer { display:flex; justify-content:space-between; align-items:center; font-size:.75rem; margin-top:4px; color:#334155; }
.tick.read { display:inline-block; width:20px; height:20px; border-radius:50%; background:#fff; color:#7c3aed; font-weight:700; text-align:center; line-height:20px; }
.tick.unread { display:inline-block; width:18px; height:18px; border-radius:50%; background:#e5e7eb; color:#0f172a; font-size:10px; text-align:center; line-height:18px; }

/* Video modal */
.video-modal {
  position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(2,6,23,.7); z-index:10000;
}
.video-modal video { width:320px; max-width:42vw; background:#000; margin:6px; border-radius:10px; }
.video-modal .end-call { margin-top:6px; background:#ef4444; color:#fff; border:none; padding:10px 12px; border-radius:8px; cursor:pointer; }
.video-modal.hidden { display:none; }
.video-modal:not(.hidden) { display:flex; }

/* ---------------- Responsive Tweaks ---------------- */
@media (max-width: 600px) {
  .cards-container { grid-template-columns: 1fr; }
  .mini-chatbox { width: 86vw; right: 7vw; }
  .chat-window { right: 10px; width: 86vw; }
}


/* three-dot chat icon */
#restoreChatBtn .chat-dots{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:100%;
  height:100%;
  pointer-events:none; /* dots don't block the click */
}

#restoreChatBtn .chat-dots span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#fff;
  opacity:.95;
  animation:typingDots 1.2s infinite ease-in-out;
}

#restoreChatBtn .chat-dots span:nth-child(2){ animation-delay:.15s }
#restoreChatBtn .chat-dots span:nth-child(3){ animation-delay:.30s }

@keyframes typingDots{
  0%, 60%, 100% { transform:translateY(0); opacity:.75; }
  30%          { transform:translateY(-2px); opacity:1; }
}
