/* ==============================================================================
   Tube for Kids - Parent Web Control Portal Stylesheet
   Theme: Light Mode Pro (Flat & Clean)
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  
  --secondary: #0ea5e9;
  --secondary-light: #f0f9ff;
  
  --success: #16a34a;
  --success-light: #dcfce7;
  --success-border: #bbf7d0;
  --success-text: #15803d;

  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --background: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-flat: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==============================================================================
   Navbar & Top Header
   ========================================================================== */
.parent-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-flat);
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.brand-tagline {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Nav Links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Child Switcher & User Section */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-switcher {
  display: flex;
  align-items: center;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 6px;
  gap: 8px;
}

.child-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.child-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* ==============================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==============================================================================
   Cards & Grids
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-flat);
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==============================================================================
   Badges (Pills)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-active {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.badge-locked {
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.badge-neutral {
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

/* Pulsing Online Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ==============================================================================
   Buttons & Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--surface-hover);
  border-color: #cbd5e1;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background: #15803d;
}

.btn-block {
  width: 100%;
}

/* ==============================================================================
   Remote Control Hub (Action Cards)
   ========================================================================== */
.control-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
}

.control-box:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-hover);
}

.control-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.control-icon-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.control-icon-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.control-icon-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.control-icon-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }

.control-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.control-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Push to Play Search / Quick Add */
.push-input-group {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-flat);
}

.push-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text-main);
}

/* Video Card in Parent Portal */
.parent-video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.parent-video-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.video-thumb-container {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

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

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-cc-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.video-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Progress bar for daily screen time */
.quota-bar-wrapper {
  margin-top: 10px;
}

.quota-bar-track {
  height: 8px;
  background: var(--surface-hover);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.quota-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ==============================================================================
   Tables
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: #fafbfc;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

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

.form-control {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
}

.alert-success {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.alert-danger {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.alert-info {
  background: var(--secondary-light);
  border: 1px solid #bae6fd;
  color: #0369a1;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Footer */
.parent-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: auto;
}
