/* Zahava Media - YouTube Filter Parent Portal Styles v2 */
/* Mobile-first, premium dark theme — matches Chrome Extension portal */

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

:root {
  --bg: #09091b;
  --bg-card: rgba(15, 25, 50, 0.85);
  --bg-input: rgba(10, 18, 36, 0.9);
  --text: #f0f4f8;
  --text-secondary: #8ba3c4;
  --text-muted: #4a6180;
  --blue: #2E67AB;
  --blue-hover: #3d7ac4;
  --blue-soft: rgba(46, 103, 171, 0.15);
  --orange: #ED6D53;
  --orange-soft: rgba(237, 109, 83, 0.15);
  --danger: #e74c3c;
  --success: #27ae60;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(46, 103, 171, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(237, 109, 83, 0.04) 0%, transparent 50%);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===== SCREENS ===== */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== SIGN-IN / CENTER CARDS ===== */
.signin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 32px 24px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.signin-logo {
  width: 170px;
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 20px rgba(46, 103, 171, 0.3));
}

.signin-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hint-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 16px;
  min-height: 20px;
}

.success-text {
  color: var(--success);
  font-size: 13px;
  margin-top: 8px;
}

/* ===== HERO BRAND SECTION ===== */
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 20px;
  width: 100%;
  max-width: 480px;
  position: relative;
}

.hero-logo {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(46, 103, 171, 0.35));
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-top: 6px;
}

.hero-accent {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  border-radius: 3px;
  margin-top: 16px;
}

.btn-signout-hero {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-signout-hero:hover {
  color: var(--orange);
  border-color: var(--orange);
}

/* ===== LICENSE BAR ===== */
.license-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(46, 103, 171, 0.12), rgba(46, 103, 171, 0.05));
  border-bottom: 1px solid var(--border);
}
.license-client {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.badge-active { background: rgba(39, 174, 96, 0.15); color: #27ae60; box-shadow: 0 0 8px rgba(39, 174, 96, 0.15); }
.badge-expired { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.badge-disabled { background: rgba(74, 97, 128, 0.2); color: var(--text-muted); }
.badge-mode { background: var(--blue-soft); color: var(--blue); font-size: 10px; }

/* ===== DASHBOARD ===== */
#dashboard-screen {
  align-items: center;
  padding-bottom: 24px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: calc(100% - 32px);
  max-width: 480px;
  margin-top: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== SETTING ROWS ===== */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.setting-row + .setting-row {
  border-top: 1px solid var(--border);
}
.setting-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ===== TOGGLE SWITCH ===== */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: #1e2a3e;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .slider {
  background: linear-gradient(135deg, var(--blue), var(--orange));
  box-shadow: 0 0 12px rgba(46, 103, 171, 0.25);
}
input:checked + .slider::before {
  transform: translateX(20px);
}

/* ===== INPUTS ===== */
.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  width: 100%;
}
.input-field:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 103, 171, 0.12);
}
.input-field::placeholder {
  color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-hover) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46, 103, 171, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(46, 103, 171, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-danger {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}
.btn-danger:hover { background: rgba(231, 76, 60, 0.25); }

.btn-small {
  padding: 10px 16px;
  font-size: 13px;
  width: auto;
}

/* ===== PROFILE GRID ===== */
.profile-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
.profile-grid::-webkit-scrollbar { display: none; }

.profile-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  min-width: 80px;
}
.profile-item:hover {
  border-color: rgba(46, 103, 171, 0.3);
  background: rgba(15, 25, 50, 0.95);
}
.profile-item.selected {
  background: linear-gradient(135deg, rgba(46, 103, 171, 0.2), rgba(46, 103, 171, 0.08));
  border-color: var(--blue);
  box-shadow: 0 0 16px rgba(46, 103, 171, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.profile-avatar { font-size: 28px; }
.profile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
.profile-item.selected .profile-name { color: var(--text); }

/* ===== CHANNELS ===== */
.channel-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.channel-add-row .input-field { flex: 1; }

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: hidden;
}

.channel-swipe-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.channel-delete-layer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 12px;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0a1224;
  border-radius: 12px;
  font-size: 14px;
  position: relative;
  z-index: 1;
  will-change: transform;
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.channel-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.channel-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 14px;
}

.channel-remove { display: none; }

/* ===== TIME LIMIT ===== */
.time-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.time-input { width: 80px; text-align: center; }
.time-unit { font-size: 13px; color: var(--text-secondary); }

/* ===== SCHEDULE ===== */
.schedule-row { display: flex; gap: 16px; }
.schedule-field { flex: 1; }
.schedule-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.time-group { display: flex; gap: 6px; }
.schedule-hour { width: 56px; text-align: center; }
.ampm-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-width: 48px;
}
.ampm-btn:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ===== CONNECTED PHONES ===== */
.phone-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #0a1224;
  border-radius: 12px;
  margin-bottom: 4px;
}
.phone-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.phone-info {
  flex: 1; min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.phone-name {
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-this-badge {
  font-size: 11px;
  color: var(--success);
  font-weight: 500;
  opacity: 0.8;
}
.phone-remove-btn {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.phone-remove-btn:hover { background: var(--danger); color: #fff; }

/* ===== PRESET CHANNELS DROPDOWN ===== */
.preset-dropdown {
  background: #0f1932;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  -webkit-overflow-scrolling: touch;
}
.preset-category-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 12px 4px;
}
.preset-channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  color: var(--text);
}
.preset-channel-item:hover { background: rgba(46, 103, 171, 0.1); }
.preset-channel-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.preset-added-badge {
  font-size: 10px;
  color: var(--success);
  font-weight: 600;
  margin-left: auto;
}

/* ===== PIN MODAL ===== */
.pin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pin-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: calc(100% - 48px);
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ===== SYNC INDICATOR ===== */
.sync-indicator {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 25, 50, 0.95);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 100;
}
.sync-indicator.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 32px 0 16px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  opacity: 0.4;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== CARD ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
#dashboard-screen .card {
  animation: fadeInUp 0.4s ease both;
}
#dashboard-screen .card:nth-child(3) { animation-delay: 0.03s; }
#dashboard-screen .card:nth-child(4) { animation-delay: 0.06s; }
#dashboard-screen .card:nth-child(5) { animation-delay: 0.09s; }
#dashboard-screen .card:nth-child(6) { animation-delay: 0.12s; }
#dashboard-screen .card:nth-child(7) { animation-delay: 0.15s; }
#dashboard-screen .card:nth-child(8) { animation-delay: 0.18s; }
#dashboard-screen .card:nth-child(9) { animation-delay: 0.21s; }
