/* ============================================
   SBY - Ebeveyn Paneli (Modern Tasarım)
   ============================================ */

/* ── ANA LAYOUT ── */
#parent-view {
  height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.parent-layout {
  display: flex;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

/* ── SOL PANEL ── */
.parent-sidebar {
  width: 220px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.parent-sidebar-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 0.5rem;
  margin-bottom: 0.25rem;
}

.child-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.child-card:hover { border-color: var(--primary-lt); transform: translateX(2px); }
.child-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--bg2), var(--surface));
  box-shadow: 0 4px 12px rgba(155,89,182,0.15);
}
.child-avatar-sm {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-lt), var(--accent-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--primary-lt);
}
.child-card.active .child-avatar-sm { border-color: var(--primary); }
.child-card-name { font-weight: 700; font-size: 0.9rem; }
.child-card-user { font-size: 0.75rem; color: var(--text-muted); }

.add-child-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  width: 100%;
}
.add-child-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--bg2); }

/* ── SAĞ PANEL ── */
.parent-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-right: 0.25rem;
}

/* ── ÇOCUK BAŞLIK ── */
.parent-child-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: #fff;
  box-shadow: 0 6px 20px rgba(155,89,182,0.3);
}
.child-avatar-lg {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; overflow: hidden; flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.4);
}
.child-header-name { font-size: 1.4rem; font-weight: 900; }
.child-header-user { font-size: 0.85rem; opacity: 0.8; margin-top: 0.15rem; }
.child-header-actions { margin-left: auto; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-white {
  background: rgba(255,255,255,0.2);
  color: #fff; border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-sm); padding: 0.5rem 1rem;
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); backdrop-filter: blur(4px);
}
.btn-white:hover { background: rgba(255,255,255,0.35); }

.online-dot {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; opacity: 0.9; margin-top: 0.3rem;
}
.online-dot::before {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; background: #4caf50;
  box-shadow: 0 0 6px #4caf50;
}
.offline-dot { opacity: 0.7; }
.offline-dot::before { background: rgba(255,255,255,0.5); box-shadow: none; }

/* ── İSTATİSTİK KARTLARI ── */
.parent-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.parent-stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 1rem;
  transition: var(--transition);
  border-left: 4px solid transparent;
}
.parent-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.parent-stat-card.purple { border-left-color: var(--primary); }
.parent-stat-card.pink   { border-left-color: var(--accent); }
.parent-stat-card.green  { border-left-color: #2e7d32; }
.parent-stat-card.orange { border-left-color: #f57c00; }

.stat-icon-wrap {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon-wrap.purple { background: rgba(155,89,182,0.12); }
.stat-icon-wrap.pink   { background: rgba(233,30,140,0.12); }
.stat-icon-wrap.green  { background: rgba(46,125,50,0.12); }
.stat-icon-wrap.orange { background: rgba(245,124,0,0.12); }

.stat-info .val { font-size: 1.7rem; font-weight: 900; line-height: 1; color: var(--text); }
.stat-info .lbl { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; font-weight: 600; }

/* ── BÖLÜM KARTLARI ── */
.parent-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.parent-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.parent-card-header h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.parent-card-body { padding: 1.25rem; }

/* ── OYUN SÜRESİ ── */
.game-time-display {
  display: flex; align-items: center; gap: 1.5rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.game-time-circle {
  position: relative; width: 90px; height: 90px; flex-shrink: 0;
}
.game-time-circle svg { width: 90px; height: 90px; transform: rotate(-90deg); }
.game-circle-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.game-circle-fill { fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.game-circle-fill.warning { stroke: #f57c00; }
.game-circle-fill.danger  { stroke: var(--danger); }
.game-time-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.game-time-text .mins { font-size: 1.3rem; font-weight: 900; color: var(--primary); line-height: 1; }
.game-time-text .dk   { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; }

.game-settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem;
}
.setting-row { display: flex; flex-direction: column; gap: 0.4rem; }
.setting-row label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 6px;
  border-radius: 3px; background: var(--border); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
  box-shadow: 0 2px 6px rgba(155,89,182,0.4);
}
.range-val { font-weight: 800; color: var(--primary); font-size: 0.9rem; }

/* ── TOGGLE SWITCH ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.toggle-label { font-weight: 600; font-size: 0.9rem; }
.toggle-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

.toggle-switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 28px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; left: 3px; bottom: 3px;
  transition: 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(24px); }

/* ── AKTİVİTE LİSTELERİ ── */
.activity-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg2); display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.activity-info { flex: 1; min-width: 0; }
.activity-title { font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }
.activity-badge {
  font-size: 0.75rem; font-weight: 700;
  padding: 3px 8px; border-radius: 12px;
  background: var(--bg2); color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}

/* ── MESAJLAŞMA AKTİVİTESİ ── */
.contact-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.contact-item:last-child { border-bottom: none; }
.contact-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-lt), var(--accent-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.contact-name { font-weight: 700; font-size: 0.88rem; }
.contact-count { font-size: 0.75rem; color: var(--text-muted); }
.contact-actions { margin-left: auto; }
.btn-block {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 0.25rem 0.6rem;
  font-size: 0.75rem; cursor: pointer; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.btn-block:hover { border-color: var(--danger); color: var(--danger); background: rgba(231,76,60,0.06); }

/* ── ENGELLENENLER ── */
.blocked-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.85rem; background: var(--bg2);
  border-radius: var(--radius-sm); margin-bottom: 0.5rem;
}
.blocked-item:last-child { margin-bottom: 0; }
.blocked-badge {
  font-size: 0.7rem; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; background: rgba(231,76,60,0.1); color: var(--danger);
}
.btn-unblock {
  margin-left: auto; background: none;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.2rem 0.6rem; font-size: 0.75rem;
  cursor: pointer; font-weight: 600; color: var(--text-muted);
  transition: var(--transition);
}
.btn-unblock:hover { border-color: var(--success); color: var(--success); }

/* ── BOŞ DURUM ── */
.parent-empty {
  text-align: center; padding: 3rem 2rem;
}
.parent-empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.parent-empty h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.parent-empty p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }

/* ── DAVET MODAL ── */
.invite-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
}
.invite-modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 2rem; width: 90%; max-width: 400px;
  text-align: center; box-shadow: var(--shadow-lg);
}
.invite-modal h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.invite-modal p  { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.25rem; }

.invite-code-box {
  background: var(--bg2); border: 2px dashed var(--primary);
  border-radius: var(--radius-sm); padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.invite-code-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.invite-code-text {
  font-size: 2rem; font-weight: 900; letter-spacing: 8px;
  color: var(--primary); font-family: 'Courier New', monospace;
}
.invite-expires { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .parent-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .parent-layout { flex-direction: column; }
  .parent-sidebar { width: 100%; flex-direction: row; overflow-x: auto; flex-wrap: nowrap; gap: 0.5rem; }
  .child-card { min-width: 160px; }
  .parent-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .parent-child-header { flex-wrap: wrap; }
  .game-settings-grid { grid-template-columns: 1fr; }
}
