/* ══════════════════════════════════════════════════
   SilvaStream — Features Stylesheet
   Profiles, Smart TV, Modals, Notifications, Share
   ══════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────
   MODAL SYSTEM
   ────────────────────────────────────────────────── */
.ss-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: ssModalFadeIn .25s ease;
}
@keyframes ssModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ss-modal {
  background: var(--bg-card, #1a1a2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: ssModalSlideUp .3s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
@keyframes ssModalSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.ss-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ss-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.ss-modal-header h3 i {
  margin-right: 8px;
  color: var(--accent, #e50914);
}
.ss-modal-close {
  background: rgba(255,255,255,.08);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  font-size: 14px;
}
.ss-modal-close:hover { background: rgba(255,255,255,.15); }
.ss-modal-body {
  padding: 24px;
}

/* ──────────────────────────────────────────────────
   FORMS
   ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #999);
  margin-bottom: 8px;
}
.form-group label input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--accent, #e50914);
}
.ss-input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.ss-input:focus {
  border-color: var(--accent, #e50914);
}
select.ss-input {
  cursor: pointer;
  appearance: auto;
}
.ss-modal .btn-full { width: 100%; justify-content: center; }
.ss-modal .btn-sm { padding: 8px 14px; font-size: 12px; }
.ss-modal .btn-outline,
.ss-modal .btn.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ss-modal .btn-outline:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
.ss-modal .btn-primary {
  background: var(--accent, #e50914);
  border: none;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ss-modal .btn-primary:hover { background: #c20812; transform: translateY(-1px); }
.ss-modal .btn-danger {
  background: #dc2626;
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.ss-modal .btn-danger:hover { background: #b91c1c; }

/* ──────────────────────────────────────────────────
   PROFILES
   ────────────────────────────────────────────────── */
.profile-avatar-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .25s;
  border: 2px solid transparent;
  background: rgba(255,255,255,.03);
}
.profile-card:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.profile-card.active { border-color: var(--accent, #e50914); background: rgba(229,9,20,.08); }
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  transition: transform .2s;
}
.profile-card:hover .profile-avatar { transform: scale(1.1); }
.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-kid-badge {
  background: #10b981;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .5px;
}
.profile-add-new .profile-avatar {
  border: 2px dashed rgba(255,255,255,.2);
  color: rgba(255,255,255,.4);
  font-size: 24px;
}
.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.manage-profile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.manage-profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
}
.profile-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.manage-profile-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

/* AVATAR / COLOR PICKER */
.avatar-picker, .color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-option {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(255,255,255,.06);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.avatar-option:hover { background: rgba(255,255,255,.12); }
.avatar-option.selected { border-color: var(--accent, #e50914); background: rgba(229,9,20,.1); }
.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all .2s;
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent, #e50914); }

/* ──────────────────────────────────────────────────
   NOTIFICATIONS
   ────────────────────────────────────────────────── */
.ss-notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #e50914;
  border-radius: 50%;
  border: 2px solid var(--bg-card, #0a0a1a);
}
.notif-count {
  background: #e50914;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}
.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #666);
}
.notif-empty i {
  font-size: 48px;
  opacity: .3;
  margin-bottom: 12px;
  display: block;
}
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-item.unread { background: rgba(229,9,20,.06); border-left: 3px solid #e50914; }
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent, #e50914);
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.notif-body { font-size: 12px; color: var(--text-muted, #999); line-height: 1.4; }
.notif-time { font-size: 11px; color: rgba(255,255,255,.25); margin-top: 4px; }

/* ──────────────────────────────────────────────────
   SHARE
   ────────────────────────────────────────────────── */
.share-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.share-btn i { font-size: 24px; }
.share-btn span { font-size: 11px; }
.share-twitter { background: rgba(29,161,242,.15); color: #1da1f2; }
.share-twitter:hover { background: rgba(29,161,242,.25); }
.share-facebook { background: rgba(24,119,242,.15); color: #1877f2; }
.share-facebook:hover { background: rgba(24,119,242,.25); }
.share-whatsapp { background: rgba(37,211,102,.15); color: #25d366; }
.share-whatsapp:hover { background: rgba(37,211,102,.25); }
.share-telegram { background: rgba(0,136,204,.15); color: #0088cc; }
.share-telegram:hover { background: rgba(0,136,204,.25); }
.share-email { background: rgba(255,255,255,.06); color: #fff; }
.share-email:hover { background: rgba(255,255,255,.12); }
.share-copy { background: rgba(255,255,255,.06); color: #fff; }
.share-copy:hover { background: rgba(255,255,255,.12); }

.share-trigger-btn {
  gap: 6px;
}

/* ──────────────────────────────────────────────────
   DOWNLOAD BUTTON
   ────────────────────────────────────────────────── */
.download-btn.downloaded {
  border-color: #10b981;
  color: #10b981;
}

/* ──────────────────────────────────────────────────
   RECOMMENDATION ROW
   ────────────────────────────────────────────────── */
.recommendation-row .row-accent-line.accent-purple {
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}
.recommendation-row .row-title i {
  color: #8b5cf6;
}

/* ──────────────────────────────────────────────────
   SMART TV / D-PAD
   ────────────────────────────────────────────────── */
.ss-focus-ring {
  position: absolute;
  z-index: 9999;
  border: 3px solid #e50914;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(229,9,20,.4), inset 0 0 20px rgba(229,9,20,.1);
  transition: all .2s ease;
  opacity: 0;
}

.smarttv-mode * { cursor: default !important; }
.smarttv-mode *:focus {
  outline: 3px solid var(--accent, #e50914) !important;
  outline-offset: 4px;
  border-radius: 10px;
}
.smarttv-mode .movie-card:focus,
.smarttv-mode .channel-card:focus,
.smarttv-mode .surf-card:focus {
  transform: scale(1.08);
  z-index: 10;
  box-shadow: 0 8px 32px rgba(229,9,20,.3);
}

/* 10-FOOT UI — large screens (TV distance) */
@media (min-width: 1920px) and (pointer: coarse),
       (min-width: 1920px) and (hover: none) {
  .smarttv-mode body,
  body.smarttv-mode {
    font-size: 18px;
  }
  .smarttv-mode .nav-link { font-size: 18px; padding: 12px 20px; }
  .smarttv-mode .logo-text { font-size: 28px; }
  .smarttv-mode .movie-card { min-width: 220px; }
  .smarttv-mode .movie-card-title { font-size: 16px; }
  .smarttv-mode .row-title { font-size: 24px; }
  .smarttv-mode .hero-slide .slide-title { font-size: 52px; }
  .smarttv-mode .genre-chip { font-size: 16px; padding: 12px 24px; }
  .smarttv-mode .btn { padding: 16px 32px; font-size: 18px; }
  .smarttv-mode .search-input { font-size: 18px; height: 52px; }
}

/* Leanback mode — simplified layout for TV */
.smarttv-mode .search-container { display: none; }
.smarttv-mode .footer-content { display: none; }
.smarttv-mode footer .copyright { padding: 24px; }
.smarttv-mode .hamburger { display: none !important; }
.smarttv-mode .mobile-nav-overlay { display: none !important; }

/* ──────────────────────────────────────────────────
   MOBILE RESPONSIVE FOR FEATURES
   ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ss-modal {
    width: 95%;
    max-height: 90vh;
    border-radius: 16px;
  }
  .ss-modal-header { padding: 16px 18px; }
  .ss-modal-body { padding: 18px; }
  .profile-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .profile-avatar { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
  .profile-name { font-size: 11px; }
  .share-buttons { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .share-btn { padding: 12px 8px; }
  .share-btn i { font-size: 20px; }
  .avatar-option { width: 38px; height: 38px; font-size: 18px; }
  .color-option { width: 30px; height: 30px; }
}

@media (max-width: 480px) {
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-actions { flex-direction: column; }
  .profile-actions .btn { width: 100%; justify-content: center; }
}
