/* ═══════════════════════════════════════════════════════════
   MEDVENTURES LIVE SYNC — MAIN STYLESHEET
   Brand: #006769 | #40A578 | #9DDE8B | #E6FF94 | #CCFFCC
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&family=Poppins:wght@400;600;700&family=Montserrat:wght@400;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
  --mvl-bg:          #006769;
  --mvl-text:        #E6FF94;
  --mvl-accent:      #40A578;
  --mvl-accent2:     #9DDE8B;
  --mvl-highlight:   #E6FF94;
  --mvl-light:       #CCFFCC;
  --mvl-glass-bg:    rgba(0, 103, 105, 0.4);
  --mvl-glass-border:rgba(157, 222, 139, 0.25);
  --mvl-radius:      20px;
  --mvl-shadow:      0 8px 32px rgba(0,0,0,0.35);
  --mvl-transition:  all 0.35s cubic-bezier(.4,0,.2,1);
}

/* ─── RESET & BASE ─── */
.mvl-wrap *, .mvl-wrap *::before, .mvl-wrap *::after { box-sizing: border-box; }

.mvl-wrap {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #004345 0%, #006769 40%, #005a3e 100%);
  min-height: 100vh;
  color: var(--mvl-text);
  position: relative;
  overflow-x: hidden;
}

/* Subtle grid texture overlay */
.mvl-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(157,222,139,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157,222,139,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ─── GLASSMORPHISM CARD ─── */
.mvl-glass {
  background: var(--mvl-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--mvl-glass-border);
  border-radius: var(--mvl-radius);
  box-shadow: var(--mvl-shadow), inset 0 1px 0 rgba(255,255,255,.1);
  position: relative;
  z-index: 1;
}

/* ─── LOGO BAR ─── */
.mvl-logo-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(0,40,41,0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--mvl-glass-border);
  z-index: 100;
}

.mvl-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--mvl-accent2);
  box-shadow: 0 0 12px rgba(64,165,120,.5);
}

.mvl-logo-topcenter { justify-content: center; }

.mvl-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mvl-highlight);
  letter-spacing: .03em;
}

.mvl-version-badge {
  background: var(--mvl-accent);
  color: #003a35;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ─── WATERMARK ─── */
.mvl-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}
.mvl-watermark img {
  width: 200px;
  opacity: .04;
  filter: grayscale(1);
}

/* ─── TYPOGRAPHY ─── */
.mvl-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--mvl-highlight);
  margin: 0 0 24px;
  text-shadow: 0 0 20px rgba(230,255,148,.3);
}

/* ─── FORM ELEMENTS ─── */
.mvl-field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.mvl-field label { font-size: .85rem; font-weight: 600; color: var(--mvl-accent2); text-transform: uppercase; letter-spacing: .06em; }

.mvl-input, .mvl-select, .mvl-textarea {
  background: rgba(0,60,60,0.6);
  border: 1px solid var(--mvl-glass-border);
  border-radius: 12px;
  color: var(--mvl-text);
  font-size: .95rem;
  font-family: inherit;
  padding: 10px 16px;
  outline: none;
  transition: var(--mvl-transition);
  width: 100%;
}
.mvl-input::placeholder, .mvl-textarea::placeholder { color: rgba(230,255,148,.35); }
.mvl-input:focus, .mvl-select:focus, .mvl-textarea:focus {
  border-color: var(--mvl-accent);
  box-shadow: 0 0 0 3px rgba(64,165,120,.2);
}
.mvl-select option { background: #004345; color: var(--mvl-text); }
.mvl-color { height: 44px; cursor: pointer; padding: 2px; border-radius: 10px; }

/* ─── BUTTONS ─── */
.mvl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--mvl-transition);
  letter-spacing: .02em;
  white-space: nowrap;
}
.mvl-btn:disabled { opacity: .4; cursor: not-allowed; }

.mvl-btn-primary {
  background: linear-gradient(135deg, #40A578, #006769);
  color: #fff;
  box-shadow: 0 4px 15px rgba(64,165,120,.4);
}
.mvl-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(64,165,120,.6);
}

.mvl-btn-success {
  background: linear-gradient(135deg, #9DDE8B, #40A578);
  color: #002a20;
  box-shadow: 0 4px 15px rgba(157,222,139,.3);
}
.mvl-btn-success:hover:not(:disabled) { transform: translateY(-2px); }

.mvl-btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  box-shadow: 0 4px 15px rgba(231,76,60,.3);
}
.mvl-btn-danger:hover:not(:disabled) { transform: translateY(-2px); }

.mvl-btn-secondary {
  background: rgba(64,165,120,.25);
  color: var(--mvl-accent2);
  border: 1px solid rgba(64,165,120,.4);
}
.mvl-btn-secondary:hover { background: rgba(64,165,120,.4); }

.mvl-btn-ghost {
  background: transparent;
  color: var(--mvl-text);
  border: 1px solid var(--mvl-glass-border);
}
.mvl-btn-ghost:hover { background: rgba(255,255,255,.07); }

.mvl-btn-full { width: 100%; }

.mvl-btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mvl-btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 8px;
  transition: background .2s;
}
.mvl-btn-icon:hover { background: rgba(255,255,255,.12); }

/* ─── GRIDS ─── */
.mvl-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mvl-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .mvl-grid-2, .mvl-grid-3 { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────
   ATTENDEE VIEW
───────────────────────────────────────────── */
.mvl-attendee { display: flex; flex-direction: column; align-items: center; padding-top: 80px; }

.mvl-selector {
  padding: 40px;
  max-width: 500px;
  width: 100%;
  margin: 60px auto 0;
}

.mvl-field-center { display: flex; align-items: flex-end; }

/* ─── LIVE VIEW ─── */
.mvl-live-view {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 16px 40px;
  gap: 20px;
  position: relative;
}

.mvl-slide-wrap {
  width: 100%;
  max-width: 960px;
  border-radius: var(--mvl-radius);
  overflow: hidden;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--mvl-glass-border);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mvl-media {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

/* ─── OFFLINE PULSE ─── */
.mvl-offline-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  color: rgba(230,255,148,.5);
}
.mvl-pulse {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--mvl-accent);
  animation: mvl-pulse 2s ease-in-out infinite;
}
@keyframes mvl-pulse {
  0%, 100% { transform: scale(1); opacity: .6; }
  50%       { transform: scale(1.3); opacity: 1; }
}

/* ─── TIMER ─── */
.mvl-timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.5);
  border: 2px solid var(--mvl-accent);
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 1.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--mvl-accent2);
  text-shadow: 0 0 20px rgba(64,165,120,.8), 0 0 40px rgba(157,222,139,.4);
  box-shadow: 0 0 20px rgba(64,165,120,.4), inset 0 0 20px rgba(64,165,120,.05);
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 90;
  animation: mvl-glow 2s ease-in-out infinite alternate;
}

@keyframes mvl-glow {
  from { box-shadow: 0 0 15px rgba(64,165,120,.3), 0 0 30px rgba(64,165,120,.15); }
  to   { box-shadow: 0 0 30px rgba(64,165,120,.6), 0 0 60px rgba(157,222,139,.25); }
}

.mvl-timer-expired { color: #ff6b6b !important; border-color: #ff6b6b !important; }

.mvl-timer-big {
  font-size: 4rem;
  position: absolute;
  top: 60px;
  right: 20px;
}

/* ─── SLIDE COUNTER ─── */
.mvl-slide-counter {
  font-size: .85rem;
  color: var(--mvl-accent2);
  opacity: .7;
  background: rgba(0,0,0,.3);
  padding: 4px 14px;
  border-radius: 50px;
  border: 1px solid var(--mvl-glass-border);
}

/* ─── NOTES ─── */
.mvl-notes {
  width: 100%;
  max-width: 960px;
  padding: 20px 24px;
}
.mvl-notes h4 { margin: 0 0 10px; color: var(--mvl-highlight); }
.mvl-notes p  { margin: 0; line-height: 1.7; color: var(--mvl-light); }

/* ─── FADE TRANSITIONS ─── */
.mvl-fade-out { opacity: 0; transform: scale(.98); transition: var(--mvl-transition); }
.mvl-fade-in  { opacity: 1; transform: scale(1);   transition: var(--mvl-transition); }

/* ─────────────────────────────────────────────
   ADMIN CONTROL PANEL
───────────────────────────────────────────── */
.mvl-admin { padding-top: 68px; }

.mvl-admin-setup {
  max-width: 700px;
  margin: 80px auto 0;
  padding: 40px;
}

.mvl-control-panel {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 68px);
  position: relative;
}

/* Projector Area */
.mvl-projector-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px 40px;
  position: relative;
  background: rgba(0,20,21,.5);
  min-height: calc(100vh - 68px);
}

.mvl-slide-projector {
  max-width: 100%;
  width: 90%;
  max-height: 70vh;
  min-height: 400px;
  background: rgba(0,0,0,.4);
}

/* Sidebar */
.mvl-sidebar {
  width: 360px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px 80px;
  overflow-y: auto;
  background: rgba(0,35,36,.6);
  border-left: 1px solid var(--mvl-glass-border);
  max-height: calc(100vh - 68px);
  position: sticky;
  top: 68px;
}

.mvl-control-card {
  padding: 20px;
}
.mvl-control-card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mvl-highlight);
}

/* Jump & Timer inputs */
.mvl-jump-wrap, .mvl-timer-input-wrap {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: flex-start;
}
.mvl-jump-wrap .mvl-input, .mvl-timer-input-wrap .mvl-input { width: 80px; text-align: center; }

/* Slide List */
.mvl-slide-list, .mvl-room-list { display: flex; flex-direction: column; gap: 8px; }
.mvl-slide-item, .mvl-room-item, .mvl-tpl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,.25);
  border-radius: 12px;
  border: 1px solid var(--mvl-glass-border);
  transition: background .2s;
}
.mvl-slide-item:hover, .mvl-room-item:hover, .mvl-tpl-item:hover { background: rgba(64,165,120,.1); }
.mvl-slide-num {
  background: var(--mvl-accent);
  color: #002a20;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.mvl-slide-title { flex: 1; font-size: .88rem; color: var(--mvl-light); }
.mvl-slide-actions { display: flex; gap: 4px; margin-left: auto; }

/* Session badge */
.mvl-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: .8rem; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.mvl-badge-live    { background: rgba(64,165,120,.3); color: #9DDE8B; border: 1px solid #40A578; animation: mvl-glow 2s infinite alternate; }
.mvl-badge-offline { background: rgba(100,100,100,.2); color: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.1); }

/* ─────────────────────────────────────────────
   TEMPLATE BUILDER
───────────────────────────────────────────── */
.mvl-templates { padding-top: 68px; }

.mvl-template-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 90px auto 0;
  padding: 0 24px 60px;
}
@media(max-width: 900px){ .mvl-template-layout { grid-template-columns: 1fr; } }

.mvl-template-list-panel { padding: 28px; }
.mvl-template-editor { padding: 32px; }

.mvl-tpl-swatch {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}

/* Preview box */
.mvl-tpl-preview-wrap h4 {
  color: var(--mvl-accent2);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 24px 0 10px;
}
.mvl-tpl-preview {
  background: #006769;
  border-radius: 12px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--mvl-glass-border);
  transition: background .3s, color .3s;
}
.mvl-tpl-preview-logo {
  position: absolute;
  top: 10px; left: 10px;
}
.mvl-tpl-preview-logo img { width: 30px; border-radius: 50%; }
.mvl-tpl-preview-slide {
  font-size: .85rem;
  opacity: .6;
  border: 1px dashed currentColor;
  padding: 20px 40px;
  border-radius: 8px;
  transition: border-color .3s;
}
.mvl-tpl-preview-timer {
  position: absolute;
  top: 10px; right: 10px;
  font-size: .9rem;
  font-weight: 700;
}

/* ─────────────────────────────────────────────
   MISC
───────────────────────────────────────────── */
.mvl-error {
  background: rgba(231,76,60,.15);
  border: 1px solid rgba(231,76,60,.4);
  border-radius: 12px;
  padding: 16px 24px;
  color: #ff8a8a;
  text-align: center;
}

/* Scrollbar */
.mvl-sidebar::-webkit-scrollbar { width: 4px; }
.mvl-sidebar::-webkit-scrollbar-track { background: transparent; }
.mvl-sidebar::-webkit-scrollbar-thumb { background: var(--mvl-accent); border-radius: 4px; }

/* ─────────────────────────────────────────────
   RESPONSIVE — MOBILE ATTENDEE
───────────────────────────────────────────── */
@media (max-width: 768px) {
  .mvl-control-panel { flex-direction: column; }
  .mvl-sidebar { width: 100%; min-width: 0; max-height: none; position: static; }
  .mvl-projector-area { min-height: 50vh; }
  .mvl-timer { font-size: 1.2rem; padding: 6px 14px; }
  .mvl-timer-big { font-size: 2rem; }
  .mvl-heading { font-size: 1.3rem; }
  .mvl-selector { padding: 24px; margin-top: 30px; }
}
