/* Family Circle Video Styling System */
:root {
  --bg-dark: #0f111a;
  --bg-card: rgba(26, 29, 45, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --accent-primary: #7c3aed;
  --accent-primary-hover: #6d28d9;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-heading: 'Outfit', system-ui, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Header & Navigation */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  font-size: 32px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  color: var(--text-muted);
  font-size: 13px;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--bg-card-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.tab-btn.active, .tab-btn:hover {
  color: #fff;
  background: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

/* Tabs Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Layout */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.full-width {
  grid-column: 1 / -1;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #d1d5db;
}

input[type="text"], input[type="email"], select.form-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 17, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease;
}

input:focus, select.form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  background: rgba(124, 58, 237, 0.1);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Buttons */
.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn {
  background: var(--accent-primary);
  color: #fff;
  width: 100%;
}

.primary-btn:hover {
  background: var(--accent-primary-hover);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 100%;
}

.accent-btn {
  background: #3b82f6;
  color: #fff;
}

.danger-btn {
  background: var(--accent-danger);
  color: #fff;
}

.success-btn {
  background: var(--accent-success);
  color: #fff;
}

.lg-btn {
  padding: 16px 28px;
  font-size: 16px;
}

.giant-btn {
  padding: 24px 48px;
  font-size: 24px;
  font-weight: 800;
  border-radius: 16px;
  letter-spacing: 1px;
}

/* PIN Display Box */
.pin-box {
  margin-top: 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 20px;
  border-radius: 14px;
  text-align: center;
}

.pin-code {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #34d399;
  margin: 10px 0;
}

.pin-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.pin-expiry {
  display: block;
  font-size: 12px;
  color: #a7f3d0;
}

/* Members & Devices Grids */
.members-grid, .devices-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.member-card-item, .device-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--bg-card-border);
}

.member-info-flex {
  display: flex;
  align-items: center;
  gap: 14px;
}

.member-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #374151;
}

.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;

}

.trusted-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.online { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.offline { background: rgba(156, 163, 175, 0.2); color: #9ca3af; }

/* KIOSK SIMULATOR (1280x800) */
.kiosk-frame-container {
  background: #000;
  border-radius: 20px;
  padding: 12px;
  border: 3px solid #334155;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  max-width: 1000px;
  margin: 0 auto;
}

.kiosk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0f172a;
  border-radius: 10px 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.kiosk-viewport {
  aspect-ratio: 16 / 10;
  background: #090a10;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}

.kiosk-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.kiosk-view.active {
  opacity: 1;
  pointer-events: auto;
}

/* Kiosk Unpaired View */
.kiosk-center-box {
  margin: auto;
  text-align: center;
  padding: 40px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.big-kiosk-pin {
  font-family: var(--font-heading);
  font-size: 64px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 12px;
  margin: 20px 0;
}

/* Kiosk Idling Touch Grid View */
.kiosk-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kiosk-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #c4b5fd;
}

.kiosk-clock {
  font-size: 20px;
  font-weight: 700;
  color: #f3f4f6;
}

.kiosk-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 16px;
  padding: 24px;
  flex: 1;
}

.kiosk-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.kiosk-card:hover {
  transform: scale(1.03);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}

.kiosk-card img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 12px;
}

.kiosk-card .card-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

/* Call Overlay Views */
.call-overlay {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.calling-avatar-ring img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 6px solid var(--accent-primary);
  margin-bottom: 20px;
}

.pulse {
  animation: pulseRing 1.5s infinite;
}

@keyframes pulseRing {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.call-actions-row {
  display: flex;
  gap: 24px;
  margin-top: 32px;
}

/* Video Containers */
.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pip-video {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 180px !important;
  height: 120px !important;
  border-radius: 12px;
  border: 2px solid #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.video-controls-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Backdrops */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: #1e293b;
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.hidden { display: none !important; }
