/* brandDetails = getDomainDetails() */

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body {
  font-family: "Aeonik", sans-serif;
  background: #0e0e0e;
  color: #fff;
}
a {
  text-decoration: none;
  color: inherit;
}

/* :root {
  --card-bg: #1a1a1a;
  --panel-bg: #212121;
  --text-light: #e0e0e0;
  --text-muted: #a0a0a0;
  --primary: #de0a26;
  --accent: #ff9f43;
  --border: #333;
  --brand-primary: #6514b8;
  --brand-secondary: #1a1a1a;
  --brand-accent: #ffa500;
  --brand-font: "Inter, sans-serif";
  --brand-button-text: #ffffff;
  --logo-src: url("/static/default-logo.png");
} */

:root {
  --brand-secondary: #151515; /* sidebar background fallback */
  --hover-bg: rgba(255, 255, 255, 0.06);
}

/* ======================= Desktop Sidebar ======================= */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 60px;
  background: #151515;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  transition: width 0.3s ease;
  overflow: visible; /* <-- important */
  z-index: 1000;
}
.sidebar.expanded {
  width: 200px;
  align-items: flex-start;
  padding-left: 15px;
}

/* Logos */
.sidebar .logo-collapsed {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0.4rem 0 1.5rem;
  transition: opacity 0.2s;
}
.sidebar .logo-expanded {
  display: none;
  width: 140px;
  height: auto;
  margin: 0.4rem 0 1.5rem;
  transition: opacity 0.2s;
}
.sidebar.expanded .logo-collapsed {
  display: none;
}
.sidebar.expanded .logo-expanded {
  display: block;
}

/* Nav (SCROLLABLE) */
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin: 1rem 0 1.5rem;
  overflow-y: auto; /* ← enables scroll */
  overflow-x: visible;
  max-height: calc(100vh - 170px); /* leaves space for logos & minimize */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  padding-right: 4px;
}
.sidebar nav::-webkit-scrollbar {
  width: 8px;
}
.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}
.sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}

/* Links */
.sidebar nav a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.3rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  position: relative; /* <-- anchor ::after/::before */
  overflow: visible;
}
.sidebar nav img {
  width: 20px;
  height: 20px;
}
.sidebar nav a span {
  display: none;
}
.sidebar.expanded nav a span {
  display: inline-block;
  padding-left: 6px;
  font-weight: bold;
}

.sidebar nav a:hover {
  background: var(--hover-bg);
  color: #fff;
}

/* === Collapsed-only sidebar tooltips (exact like mockup) === */
.sidebar:not(.expanded) nav a {
  position: relative;
}

/* pill */
.sidebar:not(.expanded) nav a[data-tip]::after {
  position: fixed; /* ← escape the sidebar */
  content: attr(data-tip);
  top: calc(var(--tip-y, 0px)); /* will be set from JS on hover */
  left: calc(60px + 12px); /* rail width + gap to pill */
  transform: translateY(-50%);
  padding: 8px 14px;
  background: #2b2b2b;
  color: #fff;
  font: 500 14px/1 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 99999;
}

/* arrow */
.sidebar:not(.expanded) nav a[data-tip]::before {
  position: fixed; /* ← escape too */
  content: "";
  top: calc(var(--tip-y, 0px));
  left: calc(60px + 6px); /* slightly inside toward the rail */
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-right-color: #2b2b2b;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
  opacity: 0;
  transition: opacity 0.14s ease;
  z-index: 99999;
}

/* reveal */
.sidebar:not(.expanded) nav a:hover::after,
.sidebar:not(.expanded) nav a:hover::before {
  opacity: 1;
}
.sidebar:not(.expanded) nav a:hover::after {
  transform: translateY(-50%) translateX(2px);
}
.sidebar:not(.expanded) nav a[data-tip]::after,
.sidebar:not(.expanded) nav a[data-tip]::before {
  top: var(--tip-y, 50%); /* will be set from JS; falls back to 50% if not */
}
/* Keep footer/minimize visible */
.sidebar .minimize {
  margin: 8px;
  padding: 10px 12px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #121826;
  cursor: pointer;
  user-select: none;
  color: #aaa;
  font-size: 1.25rem;
  margin-top: auto; /* stick to bottom */
}
.sidebar .minimize:hover {
  background: #162034;
}
@media (prefers-reduced-motion: reduce) {
  .sidebar:not(.expanded) nav a[data-tip]::after {
    transition: none;
  }
  .sidebar:not(.expanded) nav a[data-tip]::before {
    transition: none;
  }
}
.header {
  position: fixed;
  top: 0;
  left: 60px;
  right: 0;
  background: #1a1a1a;
  padding: 15px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  transition: left 0.3s;
  z-index: 900;
}
.header .spacer {
  flex: 1;
}

.header.expanded {
  left: 200px;
}
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  margin-right: 10px;
}

/* Avatar & Dropdown */
.user-info {
  position: relative;
  display: flex;
  align-items: center;
}
.avatar {
  width: 40px;
  height: 40px;
  background: #2ecc71;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #000;
  margin-left: 10px;
  cursor: pointer;
}
.avatar-dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  display: none;
  flex-direction: column;
  min-width: 160px;
  z-index: 1000;
}
.avatar-dropdown.show {
  display: flex;
}
.avatar-dropdown a {
  padding: 10px;
  color: #ccc;
  font-size: 14px;
}
.avatar-dropdown a:hover {
  background: #333;
  color: #fff;
}

/* Mobile Sidebar */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 160px;
  background: #1a1a1a;
  padding-top: 10px;
  align-items: flex-start;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 900;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-nav.show {
  transform: translateX(0);
}
.mobile-nav .logo {
  width: 50px;
  height: 50px;
  margin: 10px auto;
  margin-bottom: 30px;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  color: #ccc;
  font-size: 16px;
  font-weight: bold;
}
.mobile-nav a:hover {
  color: #fff;
}
.mobile-nav .collapse-icon {
  margin-top: auto;
  width: 100%;
  text-align: center;
  padding: 1rem;
}
.mobile-nav .collapse-icon button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.25rem;
  cursor: pointer;
}
.mobile-nav img {
  width: 20px;
  height: 20px;
}
.details {
  display: flex;
  flex-direction: column;
  margin-left: 10px;
}
.name {
  font-size: 16px;
  font-weight: bold;
}
.role {
  font-size: 12px;
  color: #aaa;
}

/* Main area */
.main {
  margin-left: 60px;
  padding-top: 100px;
  padding-bottom: 10px;
  transition: margin-left 0.3s;
  min-height: 100vh;
  overflow-y: auto;
}
.main.expanded {
  margin-left: 200px;
}
.content {
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.search-bar {
  display: flex;
  align-items: center;
  background: #1e1e1e;
  padding: 8px 12px;
  border-radius: 8px;
  flex: 1;
  min-width: 200px;
}
.search-bar svg {
  width: 20px;
  height: 20px;
  fill: #888;
}
.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  margin-left: 8px;
  width: 100%;
}
.create-artist-btn {
  background: var(--brand-primary);
  color: #fff;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

/* Artists Grid */
.artists-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.artist-card {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.artist-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #2a2a2a;
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #ccc;
}
.artist-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.artist-card h4 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #fff;
}
.artist-card p {
  margin: 0 0 12px;
  font-size: 14px;
  color: #aaa;
}
.artist-card .view-btn {
  padding: 8px 16px;
  border: 1px solid var(--brand-primary);
  border-radius: 6px;
  background: transparent;
  color: var(--brand-primary);
  cursor: pointer;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.pagination button {
  background: #1e1e1e;
  border: 1px solid #fff;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Add Artist Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.show {
  display: flex;
}

/* Modal Container */
.modal {
  background: #1a1a1a;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 16px;
  background: #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #fff;
}
.modal-close {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  max-height: 70vh;
}
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.form-group label {
  color: #ccc;
  font-size: 0.875rem;
  margin-bottom: 4px;
}
.form-group input[type="text"],
.form-group select,
.form-group textarea {
  background: #2e2e2e;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px;
  color: #fff;
  font-size: 0.9rem;
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Include-in-plan toggle */
.toggle-group {
  display: flex;
  gap: 8px;
}
.toggle-group button {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #444;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
}
.toggle-group button.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #000;
}

/* Info box */
.info-box {
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.3);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.875rem;
  color: #fff;
  margin-bottom: 16px;
}

/* Image upload */
.image-upload-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.preview-box,
.upload-box {
  flex: 1;
  min-width: 120px;
  height: 120px;
  border: 2px dashed #444;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #2a2a2a;
}
.preview-box img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}
.upload-box button {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
  color: #ccc;
  cursor: pointer;
}
.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Modal Footer */
.modal-footer {
  padding: 16px;
  background: #111;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-footer .btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.modal-footer .cancel-modal {
  background: transparent;
  color: #ccc;
  border: 1px solid #444;
}
.modal-footer .save-modal {
  background: var(--brand-primary);
  color: #000;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .header,
  .main {
    left: 0 !important;
    width: 100% !important;
  }
  .main,
  .header {
    left: 0 !important;
    margin-left: 0 !important;
  }
  .mobile-menu-btn {
    display: block;
  }
  .header {
    justify-content: space-between;
  }
  .main {
    margin-left: 0;
    padding-top: 120px;
  }
  .content {
    padding: 0 10px;
  }
  .artists-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
.notification-wrapper {
  position: relative;
  margin-right: 16px;
}
.notification-wrapper button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.notification-wrapper img {
  width: 24px;
  height: 24px;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Dropdown Panel */
#notifDropdown {
  display: none;
  position: absolute;
  top: 32px;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  min-width: 240px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  z-index: 1000;
}
.notif-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: none;
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  margin-bottom: 8px; /* space between messages */
}
.notif-item:last-child {
  margin-bottom: 0;
}
.notif-item.unseen {
  background: rgba(222, 10, 38, 0.1);
}
.notif-item:hover {
  background: #333;
  color: #fff;
}
.notif-item .message {
  flex: 1;
  pointer-events: none; /* make unclickable */
}
.notif-item a {
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.notif-item .mark-read {
  background: none;
  border: none;
  color: #777;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
}
.notif-item .mark-read:hover {
  color: #fff;
}
.notif-empty {
  padding: 12px;
  color: #777;
  font-size: 14px;
  text-align: center;
}
.header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 60px;
  background: #111;
}
.header > * {
  flex-shrink: 0;
}
/* spacer */
.header .spacer {
  flex: 1;
}

/* Responsive tweaks */
@media (max-width: 576px) {
  .notification-wrapper {
    margin-right: 8px;
  }
  #notifDropdown {
    top: 28px;
    right: -4px;
    min-width: 200px;
  }
}
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
}

.toast {
  background-color: #323232;
  color: white;
  padding: 12px 45px;
  margin-right: 0.75rem;
  border-radius: 6px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s ease;
}

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

.toast.error {
  background-color: #e53935;
  color: white;
  font-size: 1.2rem;
}

.toast.success {
  background-color: #43a047;
  color: white;
  font-size: 1.2rem;
}

.toast.info {
  background-color: #2196f3;
  color: white;
  font-size: 1.2rem;
}
.toast.warning {
  background-color: #fbc02d;
  color: black;
  font-size: 1.2rem;
}

.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--brand-primary);
  border-radius: 50%;
  width: 35px;
  height: 35px;
  animation: spin 0.7s linear infinite;
  margin: auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
