.app-wrapper {
  width: 100%;
  align-self: flex-start;
}

/* ========================================== */

/* GLOBAL HEADER & NAVIGATION ELEMENTS */

/* ========================================== */

.global-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
}

.header-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-radius: 999px;
  background-color: rgba(10, 10, 12, 0.5);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-color);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.logo-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid #fff;
  border-top-color: transparent;
}

.logo-wordmark {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-wordmark span {
  color: var(--primary);
}

.group-logo-img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  display: inline-block;
  flex-shrink: 0;
}

/* Toast notifications */

.toast-container {
  position: fixed;
  top: 88px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-notification {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 13px 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  max-width: 340px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

.toast-notification.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-info .toast-icon {
  color: var(--primary);
}

.header-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 4px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Avatar Menu & Dropdown */

.user-profile-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}

.avatar:hover {
  box-shadow: 0 0 0 3px var(--primary-light);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 52px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 230px;
  padding: 6px;
  display: none;
  box-shadow: 0 16px 48px var(--shadow);
}

.dropdown-menu.show {
  display: block;
}

.dropdown-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropdown-user-info {
  min-width: 0;
}

.dropdown-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-email {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-menu a {
  display: block;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 7px;
}

.dropdown-menu a:hover {
  background-color: var(--tertiary-bg);
  color: var(--text-color);
}

.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 4px 0;
}

.logout-link {
  color: var(--danger) !important;
}

.logout-link:hover {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: var(--danger) !important;
}

/* ========================================== */

/* AUTHENTICATION VIEWS COMPONENTS */

/* ========================================== */

.auth-wrapper {
  width: 100%;
  max-width: 400px;
  margin: 40px auto;
}

.auth-card {
  background-color: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 32px var(--shadow);
}

.auth-card.hidden {
  display: none;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 8px;
}

.social-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-social {
  width: 100%;
  background-color: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-social img {
  width: 18px;
  height: 18px;
  position: absolute;
  left: 20px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
  margin-right: .75em;
}

.divider:not(:empty)::after {
  margin-left: .75em;
}

.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.view-trigger {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

input {
  width: 100%;
  padding: 14px 16px;
  background-color: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 15px;
  outline: none;
}

input:focus {
  border-color: var(--primary);
}

input::placeholder {
  color: var(--text-tertiary);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 13px;
  width: auto;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* ========================================== */

/* APPS PROTECTED CONTENT PANES DIRECTIVES */

/* ========================================== */

.app-pane {
  width: 100%;
  animation: fadeIn 0.2s ease-in-out;
}

.app-pane.hidden {
  display: none !important;
}

.pane-header {
  margin-bottom: 32px;
}

.pane-header h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.pane-header p {
  color: var(--text-secondary);
}

/* Home Dashboard Panels Layout */

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.dashboard-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: 12px;
}

.dashboard-card h3 {
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

.group-row-item {
  background-color: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.group-row-item:hover {
  transform: translateX(4px);
  border-color: var(--primary);
}

.badge {
  background-color: var(--tertiary-bg);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge.primary {
  background-color: var(--primary);
  color: white;
  border: none;
}

.empty-state-text {
  color: var(--text-tertiary);
  font-size: 14px;
}

/* Private Invite-Only Group Layout Panel */

.pane-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.group-workspace {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: 450px;
}

.group-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-item {
  background: none;
  border: none;
  padding: 14px 16px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
}

.sidebar-item:hover {
  background-color: var(--primary-light);
  color: var(--text-color);
}

.sidebar-item.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.group-content {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.content-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.member-count {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Movie Engine Dashboard Component Inside Group */

.add-movie-bar {
  display: flex;
  gap: 12px;
}

.add-movie-bar input {
  flex: 1;
}

.list-section h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.movie-row {
  background-color: var(--tertiary-bg);
  padding: 14px 20px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.movie-title {
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.added-by {
  font-size: 12px;
  color: var(--text-tertiary);
}

.btn-action {
  background: none;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

/* ========================================== */

/* MODAL OVERLAYS */

/* ========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  padding: 32px;
}

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

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toggle switch */

.custom-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.custom-toggle input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s;
}

.custom-toggle input:checked + .toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

.custom-toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background-color: #fff;
}

/* ========================================== */

/* GLOBAL FOOTER COMPONENT MODAL LAYOUTS */

/* ========================================== */

.global-footer {
  background-color: var(--secondary-bg);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 72px 24px 32px 24px;
  margin-top: auto;
  width: 100%;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand-section {
  max-width: 320px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--text-color);
  text-decoration: none;
}

.footer-logo .logo-mark {
  width: 28px;
  height: 28px;
}

.footer-logo .logo-wordmark {
  font-size: 20px;
  font-weight: 800;
}

.footer-logo .logo-wordmark span {
  color: var(--primary);
}

.footer-tagline {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

.footer-links-grid {
  display: flex;
  gap: 72px;
  flex-wrap: wrap;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-column h4 {
  color: var(--text-color);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.footer-column a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-crafted {
  color: var(--text-tertiary);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Layout adjustments for smaller screen frames */

@media (max-width: 768px) {
  .dashboard-grid, .group-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .footer-links-grid {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .header-actions .btn-outline {
    display: none;
  }
}

