/* =========================================
   DASHBOARD — page-specific styles
   ========================================= */

/* Root theme (dark, high contrast) */
.dashboard{
  --bg:#0e1424;
  --layer:#101a31;
  --card:rgba(26,33,56,.88);
  --card-border:rgba(170,195,255,.22);
  --text:#f3f6ff;
  --text-dim:#c6cee7;
  --muted:#aeb9d8;
  --accent:#7c4dff;
  --accent2:#00d6ff;
  --success:#17d49b;

  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(28,44,96,.55) 0%, transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(22,38,84,.45) 0%, transparent 55%),
    var(--bg);
  color:var(--text);
  font-family:"Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Subtle grid overlay */
.dashboard::before{
  content:""; position:fixed; inset:0; pointer-events:none; opacity:.06;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size:42px 42px, 42px 42px;
  mask-image: radial-gradient(80% 60% at 50% 20%, #000, transparent);
}

/* ===== Nav (glass) ===== */
.glass-nav{
  background:linear-gradient(90deg, rgba(16,26,49,.92), rgba(16,26,49,.72));
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--card-border);
}
.brand-dot{
  width:10px; height:10px; border-radius:50%; display:inline-block;
  background: linear-gradient(45deg, var(--accent), var(--accent2));
  box-shadow:0 0 12px rgba(124,77,255,.7);
}

/* ===== Cards ===== */
.glass-card{
  background:var(--card);
  border:1px solid var(--card-border);
  border-radius:18px;
  box-shadow:0 16px 34px rgba(0,0,0,.35);
  overflow:hidden;
  backdrop-filter: blur(12px) saturate(120%);
}
.glass-header{
  background:linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border-bottom:1px solid var(--card-border);
  color:var(--text);
}

/* Improve header text contrast inside dark cards */
.glass-card .card-header,
.glass-card .card-header *{
  color:#eaf2ff !important;
  opacity:1 !important;
  text-shadow:0 1px 0 rgba(0,0,0,.45);
}

/* Tiny status chips (left of titles) */
.chip{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.chip-cyan{ background:linear-gradient(90deg,var(--accent),var(--accent2)); box-shadow:0 0 10px rgba(0,214,255,.5); }
.chip-purple{ background:linear-gradient(90deg,#7c4dff,#a684ff); box-shadow:0 0 10px rgba(124,77,255,.45); }

/* ===== Forms (dark readable) ===== */
.form-label{ color:var(--text); font-weight:600; }
.form-control, .form-select{
  background: rgba(255,255,255,.12);
  border:1px solid var(--card-border);
  color:var(--text);
}
.form-control::placeholder{ color:#eef3ff; opacity:1; }
.form-control:focus, .form-select:focus{
  border-color:var(--accent2);
  box-shadow:0 0 0 .22rem rgba(0,214,255,.22);
  background: rgba(255,255,255,.14);
  color:var(--text);
}

/* Custom select caret (high contrast) */
.dashboard .form-select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  padding-right:2.2rem !important;
  background-repeat:no-repeat; background-position:right .6rem center; background-size:16px 16px;
  background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%2300d6ff' d='M3.2 5.6a1 1 0 0 1 1.4 0L8 9l3.4-3.4a1 1 0 1 1 1.4 1.4L8.7 11.1a1 1 0 0 1-1.4 0L3.2 7a1 1 0 0 1 0-1.4z'/%3e%3c/svg%3e");
}
.form-select.form-select-sm{ height:calc(1.6rem + 10px); padding-top:.25rem; padding-bottom:.25rem; font-weight:600; }

/* ===== Buttons (brand) ===== */
.btn-accent{
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  border:none; color:#031022; font-weight:700;
  box-shadow:0 10px 24px rgba(0,214,255,.25), 0 6px 16px rgba(124,77,255,.25);
}
.btn-accent:hover{ filter:brightness(1.06); transform:translateY(-1px); }
.btn-outline-accent{ border-color:var(--accent2); color:#b7f4ff; background:rgba(0,214,255,.08); }
.btn-outline-accent:hover{ background:rgba(0,214,255,.16); }
.btn-ghost{ background:rgba(255,255,255,.06); border:1px dashed var(--card-border); color:var(--text-dim); }
.btn-ghost:hover{ border-style:solid; color:#fff; }
.btn-xs{ padding:.22rem .6rem; font-size:.82rem; }

/* ===== Tables (modern) ===== */
.table-modern thead tr{
  background: linear-gradient(0deg, rgba(255,255,255,.12), rgba(255,255,255,.05)) !important;
}
.table-modern th{ color:#f7f9ff !important; border-bottom-color:rgba(255,255,255,.18) !important; font-weight:700; }
.table-modern td{ color:#eef2ff !important; border-top-color:rgba(255,255,255,.12) !important; }
.dashboard .table>:not(caption)>*>*{
  background-color:transparent !important; color:var(--text) !important; border-color:rgba(255,255,255,.10) !important;
}

/* ===== Alerts (dark) ===== */
.modern-alert{
  border:1px solid var(--card-border);
  background:rgba(18,25,46,.9);
  color:#eaf0ff;
}

/* ===== Footer (dark) ===== */
.footer{
  margin-top:48px;
  background:linear-gradient(90deg, rgba(16,26,49,.92), rgba(16,26,49,.72));
  border-top:1px solid var(--card-border);
  padding:14px 0;
  color:var(--text);
}

/* ===== HERO overrides (dashboard image band) ===== */
.dashboard-hero{
  position: relative;
  background-repeat:no-repeat !important;
  background-position:center center !important;
  background-size:contain !important;       /* full image visible */
  background-color:#0b1324 !important;      /* letterboxing bg */
  min-height:520px;
  padding:24px 0;
  display:flex; align-items:center;
}
/* Use global .hero image overlay off, add custom layer */
.dashboard-hero::after{ display:none; }
.dashboard-hero::before{
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.30) 0%, rgba(0,0,0,.22) 60%, rgba(0,0,0,.18) 100%);
  pointer-events:none;
}
.dashboard-hero .container{ position:relative; z-index:1; }
.dashboard-hero .row{ width:100%; display:flex; align-items:center; justify-content:center; }
.dashboard-hero .col-lg-9{ flex:0 0 100%; max-width:100%; text-align:center; }
.dashboard-hero h1{ color:#fff; text-shadow:0 2px 10px rgba(0,0,0,.35); }
.dashboard-hero .lead{ color:#e7f0ff; }
/* Logged-in badge pinned top-right of hero */
.hero-badge{
  position:absolute; top:16px; right:16px;
  background: linear-gradient(90deg, rgba(124,77,255,.55), rgba(0,214,255,.55));
  border: 1px solid rgba(255,255,255,.45);
  color:#fff; font-family: "JetBrains Mono", monospace;
  backdrop-filter: blur(4px);
  border-radius: .6rem;
  padding:.35rem .6rem;
}

/* Spacing after hero for cards */
.after-hero{ margin-top:40px; }

/* ===== Chat window ===== */
.chat-window{
  height:360px; overflow-y:auto; padding:12px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--card-border);
  border-radius:14px;
}
/* user chat: same thumbnail sizing as admin so previews don’t flood */
.chat-window .chat-attachment { display:inline-block; max-width:100%; }

.chat-window img.chat-media,
.chat-window .chat-img{
  width: 260px; height: 170px; max-width:100%;
  object-fit: cover; border-radius:10px; display:block;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer;
}

.chat-window video.chat-media,
.chat-window .chat-video{
  width: 260px; max-width:100%; height:auto;
  border-radius:10px; display:block;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* tiny paperclip */
.attach-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:42px; min-width:42px; height:42px;
  border:1px dashed rgba(170,195,255,.22); border-radius:12px;
  background:rgba(255,255,255,.06); color:#cfe6ff; font-size:18px; line-height:1;
}
.attach-btn:hover{ background:rgba(255,255,255,.12); color:#fff; }


/* Chat message bubbles */
.message-row{ display:flex; margin:8px 0; }
.message-row.user{ justify-content:flex-end; }
.message-row.admin{ justify-content:flex-start; }
.message-row .bubble{
  max-width:78%;
  border-radius:14px; padding:10px 12px; word-wrap:break-word;
  box-shadow:0 6px 14px rgba(0,0,0,.25);
}
.message-row.user .bubble{
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color:#031022;
}
.message-row.admin .bubble{
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  color:var(--text);
}
.message-row .bubble .text{ white-space: pre-wrap; }
.message-row .bubble .meta{ font-size:.75rem; opacity:.85; margin-top:6px; }

/* Live indicator */
.live-dot{ width:10px; height:10px; border-radius:50%; background:#1df2b1; box-shadow:0 0 10px rgba(29,242,177,.8); }
.live-dot.off{ background:#8b96b8; box-shadow:none; }

/* Minor utilities */
.text-muted{ color:var(--muted) !important; }

/* ===== Responsive tweaks ===== */
@media (max-width:992px){
  .dashboard-hero{ min-height:420px; }
}
@media (max-width:576px){
  .dashboard-hero{ min-height:360px; }
  .chat-window{ height:300px; }
}
/* Imported mini-SPA area */
#spaHost .imported-wrap {
  max-height: 72vh;           /* desktop */
  overflow: auto;              /* vertical scroll */
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  background: transparent;
}

/* mobile / small screens */
@media (max-width: 576px) {
  #spaHost .imported-wrap { max-height: 62vh; }
}

/* imported content hygiene */
#spaHost .imported-wrap img,
#spaHost .imported-wrap video,
#spaHost .imported-wrap iframe {
  max-width: 100%;
  height: auto;
}
#spaHost .imported-wrap .container,
#spaHost .imported-wrap .container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* Profile dropdown card */
.profile-card {
  background: #121212;  /* dark background */
  color: #fff;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.profile-card h6,
.profile-card p {
  color: #ddd; /* text contrast */
}

/* Profile buttons */
.profile-card .btn {
  display: block;
  width: 100%;
  margin: 0.3rem 0;
  background: transparent;
  border: 1px solid #555;
  color: #fff;
  transition: all 0.2s;
}

.profile-card .btn:hover {
  background: #0dcaf0;   /* bootstrap info color */
  border-color: #0dcaf0;
  color: #000;
}

/* Logout button */
.profile-card .btn-logout {
  background: #dc3545;
  color: #fff;
  border: none;
}

.profile-card .btn-logout:hover {
  background: #b52b37;
}
/* Avatar edit UI */
.avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}
.avatar-wrap img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}
.avatar-edit-btn {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  font-size: 14px;
  line-height: 28px;
  background: #0dcaf0;       /* accent */
  color: #000;
  box-shadow: 0 4px 14px rgba(13,202,240,0.35);
  cursor: pointer;
}
.avatar-edit-btn:hover { filter: brightness(0.95); }

