:root {
  --text: #ffffffff;
  --text-secondary: #d6d3d6;
  --background: #0b0e0c;
  --surface: #1e1e1e;
  --primary: white;
  --primary-hover: #ff7043;
  --secondary: #ff7b00;
  --secondary-hover: #ff9021;
  --accent: #ffb74d;
  --border: #333333;
}

:root.light-theme {
  --text: #020202ff;
  --text-secondary: #302e30;
  --background: #e7eff0;
  --surface: #c2c2c2;
  --primary: black;
  --primary-hover: #ff7043;
  --secondary: #ff7b00;
  --secondary-hover: #ff9021;
  --accent: #ff9800;
  --border: #4b4b4b;
}
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  color: var(--text);
  background-color: var(--background);
  overflow-y: scroll;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

* {
  box-sizing: inherit;
}

header {
  background-color: var(--background);
  padding: 8px;
  box-shadow: 0 0 3px 1px var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  text-align: center;
  max-height: 100px;
}

header * {
  transition: all 0.3s ease;
}

header a {
  text-align: center;
  align-self: center;
  justify-self: center;
  margin: 0;
  padding: 0;
}

header a span {
  color: var(--text);
}



.nav-links {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: start;
  align-items: center;
  overflow-x: hidden;
}

.nav-links a,
.nav-links button {
  margin: 0;
  padding: 16px;
  color: var(--text);
  background-color: var(--background);
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--background);
  cursor: pointer;
}

.nav-links a:hover,
.nav-links button:hover {
  border: 1px solid var(--primary);
}

#profile-link {
  background-color: var(--background);
  height: auto;
  max-height: min-content;
  margin: 0;
  margin-right: 12px;
  padding: 0;
  cursor: pointer;
  border: none;
}

#profile-link:hover {
  background-color: var(--surface);
}

#toggleTheme {
  cursor: pointer;
}
/***************************************************************************/
/**************nostr-user-search*************/
/* Search container */
#search-container {
  position: relative;
}

/* Search overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 1;
}

/* Search wrapper */
.search-wrapper {
  width: 100%;
  max-width: 600px;
  margin-top: 36px;
  padding: 0 20px;
}

/* Search content */
.search-content {
  background-color: var(--background);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-overlay.open .search-content {
  transform: translateY(0);
}

/* Close button */
.close-search {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 5px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.close-search:hover {
  color: var(--text);
  background-color: var(--surface);
}

/* Search toggle button */
.searchToggle {
  background-color: transparent;
  padding: 8px;
  margin: 0;
  border: none;
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.searchToggle:hover {
  background-color: var(--surface);
}


nostr-user-search {
  width: 100%;
  display: block;

}

/* Input styling */
nostr-user-search::part(input) {
  width: 100%;
  padding: 14px 18px;
  background-color: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

nostr-user-search::part(input):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

/* Results container */
nostr-user-search::part(results) {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  background-color: var(--surface);
  border: 2px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 4px 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 1001;
  box-shadow: inset 0 0 0 1px var(--border);
  margin: 0;
  padding: 0;
}

/* Individual result items */
nostr-user-search::part(item) {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
  text-decoration: none;
}

nostr-user-search::part(item):hover,
nostr-user-search::part(item):focus {
  background-color: var(--hover-bg, rgba(0, 122, 204, 0.05));
}

nostr-user-search::part(item):last-child {
  border-bottom: none;
  border-radius: 0 0 4px 4px;
}

/* Profile picture */
nostr-user-search::part(picture) {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

/* User name */
nostr-user-search::part(name) {
  font-weight: 600;
  color: var(--text);
  margin-right: 8px;
  font-size: 15px;
  line-height: 1.4;
}

/* NIP-05 identifier */
nostr-user-search::part(nip05) {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  opacity: 0.8;
}

/* Wrapper for better control */
nostr-user-search::part(wrapper) {
  width: 100%;
}

/* Custom scrollbar for results */
nostr-user-search::part(results)::-webkit-scrollbar {
  width: 6px;
}

nostr-user-search::part(results)::-webkit-scrollbar-track {
  background: var(--surface);
}

nostr-user-search::part(results)::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

nostr-user-search::part(results)::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Loading state */
nostr-user-search.searching::part(input) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

@media (max-width: 768px) {
  .search-wrapper {
    margin-top: 40px;
    padding: 0 12px;
  }
  
  .search-content {
    padding: 16px;
    border-radius: 12px 12px 0 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-height: 70vh;
    overflow: hidden;
  }

nostr-user-search::part(wrapper) {
  max-width: 380px;
}

  nostr-user-search::part(results) {
    max-height: 50vh;
    position: static;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
    margin-top: 12px;
  }

  nostr-user-search::part(input) {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  nostr-user-search::part(wrapper) {
  max-width: 320px;
}
}
/*****************/

.logo-n-btn {
  margin-left: 4px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 12px;
  margin-right: 16px;
  width: auto;
  text-align: center;
}

.sidebar-toggle:hover {
  color: var(--primary);
}

.drawer-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 12px;
  margin-right: 16px;
  width: auto;
  text-align: center;
}

.drawer-toggle:hover {
  color: var(--primary);
}

.logo {
  text-decoration: none;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.logo span {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
}

.logo svg {
  border-radius: 8px;
  margin: 0;
  padding: 0;
}

.logo svg rect {
  fill: var(--primary);
}

.logo svg polygon {
  fill: var(--background);
}

.logo:hover {
  transform: scale(1.05);
}

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

footer {
  display: none;
}

h1 {
  margin-bottom: 24px;
  font-size: 28px;
  font-weight: 700;
  color: #616161;
}

.page-container {
  display: flex;
  min-height: calc(100vh - 120px);
  max-height: calc(100vh - 119px);
}

#notify-menu-btn {
  margin-right: 8px;
}

#notify-menu-btn svg,
#colorPicker svg,
.searchToggle svg,
#toggleTheme svg,
.video-action-tabs svg {
  width: 24px; 
  height: 24px;
  fill: var(--text);
  stroke: var(--primary);
}


.light-theme #notify-menu-btn svg,
.light-theme #colorPicker svg,
.light-theme .searchToggle svg,
.light-theme #toggleTheme svg,
.light-theme .video-action-tabs svg {
  fill: var(--primary);
  stroke: var(--text);
}

.sidebar svg {
  width: 24px; 
  height: 24px;  
  fill: var(--text);
  stroke: var(--text-secondary);
}

/* .light-theme .sidebar svg {
  width: 24px; 
  height: 24px;  
  fill: var(--text);
  stroke: var(--border);
} */

#create-button svg {
  width: 24px; 
  height: 24px;
  stroke: var(--text-secondary);
  fill: var(--background);  
}

.like-icon {
  fill: var(--text);
  stroke: var(--primary);
  transition: fill 0.2s ease;
}

.light-theme .like-icon {
  fill: var(--background);
  stroke: var(--text);
  transition: fill 0.2s ease;
}

.video-action-tab-button.liked .like-icon {
  fill: var(--primary);
  stroke: currentColor;
}

/*************************************/
/*settings*/

.settings-container {
  max-width: 500px;
  padding: 20px;
}

.settings-container h1 {
  margin-bottom: 30px;
}

.settings-group {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-group:last-child {
  border-bottom: none;
}

.settings-group h3 {
  margin: 0 0 15px 0;
  color: var(--text);
}

.settings-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  text-align: left;
}

.settings-btn:hover {
  background-color: var(--background);
}

.settings-btn.warning {

  border-color: #856404;
}

.settings-btn.danger {

  border-color: #721c24;
}

.debug {
  display: none;
}

.settings-group .search-relay-section {
  margin-top: 1rem;
}

.settings-group .relay-selector {
  margin-bottom: 4px;
}

.settings-group .relay-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.settings-group .relay-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--text);
  font-size: 0.9rem;
}

.settings-group .relay-management {
  padding-top: 4px;
}

.settings-group .relay-list-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.settings-group .relay-list {
  margin-top: 1rem;
  display: none;
}

.settings-group .relay-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  background: var(--background);
  color: var(--text);
}

.settings-group .relay-item.active {
  background: var(--background);
  border-color: var(--border);
}

.settings-group .relay-url {
  flex: 1;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 1rem;
}

.settings-group .relay-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-group .active-indicator {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: bold;
}

.settings-group .remove-relay-btn {
  background: var(--background);
  color: var(--text);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.settings-group .remove-relay-btn:hover {
  background: var(--surface);
}

.settings-group .add-relay-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.settings-group .relay-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.settings-group .empty-relays {
  color: var(--text);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Media whitelist */
.whitelist-domains {
  margin: 15px 0;
}

.domain-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 5px;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.domain-name {
  font-family: monospace;
}

.remove-domain-btn {
  padding: 4px 8px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.empty-whitelist {
  padding: 15px;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* .add-domain-form {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding: 15px;
  background-color: var(--surface);
  border-radius: 4px;
} */

.settings-group .add-domain-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.domain-input {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--background);
  color: var(--text);
}

/* .confirm-add-btn,
.cancel-add-btn {
  padding: 8px 16px;
  margin-right: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--background);
  color: var(--text);
}

.confirm-add-btn {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
} */
/*settings menu*/
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:  rgba(0, 0, 0, 0.5);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.menu-overlay .settings-menu {
  pointer-events: all;
}
.settings-menu {
  position: fixed;
  background-color: var(--background);
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1000;
  width: 300px;
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.settings-menu.visible {
  opacity: 1;
  transform: translateY(0);
}

.menu-container {
  display: flex;
  flex-direction: column;
}

.menu-container > p {
  align-self: center;
}
.menu-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 12px;
}

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

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.user-email {
  font-size: 0.9em;
  color: #606060;
}

.manage-profile-link {
  display: inline-block;
  color: #065fd4;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9em;
  margin-top: 8px;
}

.manage-profile-link:hover {
  color: #0048a7;
}

.menu-items {
  margin: 4px;
  padding: 8px 0;
  max-height: 60vh;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.menu-item:hover {
  box-shadow: inset 0 0 0 3px var(--primary);
}

.item-icon {
  margin-right: 16px;
  font-size: 18px;
  min-width: 24px;
  text-align: center;
}

.item-text {
  flex: 1;
}

.toggle-switch {
  width: 36px;
  height: 16px;
  background-color: #e5e5e5;
  border-radius: 10px;
  position: relative;
  transition: background-color 0.3s ease;
}

.toggle-switch:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  top: -2px;
  left: 0;
  transition: left 0.3s ease;
}

.toggle-switch.active {
  background-color: #065fd4;
}

.toggle-switch.active:before {
  left: 16px;
}
.menu-separator {
  height: 1px;
  background-color: var(--surface);
  margin: 8px 0;
}

.logout-btn {
  color: #cc0000;
}

/* For dark theme */
.dark-theme .settings-menu {
  background-color: var(--background);
  color: var(--text);
}

.dark-theme .menu-header {
  border-bottom-color: var(--border);
}

.dark-theme .user-email {
  color: var(--text);
}

.dark-theme .menu-item {
  color: var(--text);
}

.dark-theme .menu-item:hover {
  background-color: var(--primary);
}

.dark-theme .menu-separator {
  background-color: var(--border);
}
/*****************************************************/
/*************** Sidebar *************/
/*****************************************************/
/*****************************************************/

.sidebar {
  width: 240px;
  background-color: var(--background);
  padding: 12px 0;
  position: sticky;

  overflow-y: hidden;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  transition: width 0.3s ease;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  padding: 24px 24px;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.2s;
  border-radius: 6px;
}

.sidebar.collapsed .sidebar-item {
  padding: 10px 10px;
}

.sidebar-text {
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-text {
  display: none;
}

.sidebar-icon {
  margin-right: 24px;
  font-size: 18px;
  transition: margin-right 0.3s ease;
}

.sidebar.collapsed .sidebar-icon {
  margin-right: 0;
}

.sidebar-item:hover {
  background-color: var(--surface);
}

.sidebar-item.active {
  box-shadow: inset 0 0 0 3px var(--primary);
}

main {
  flex-grow: 1;
  transition: margin-left 0.3s ease;
  overflow-x: hidden;
  justify-content: start;
  line-height: 1.6;
}

@media (min-width: 1201px) {
  .sidebar {
    width: 240px;
  }

  .sidebar-text {
    display: block;
  }

  .sidebar-icon {
    margin-right: 0;
    font-size: 24px;
  }

  .sidebar-item {
    padding: 18px 0;
    justify-content: center;
  }

  .sidebar:not(.collapsed) {
    width: 240px;
  }

  .sidebar:not(.collapsed) .sidebar-text {
    display: block;
  }

  .sidebar:not(.collapsed) .sidebar-icon {
    margin-right: 24px;
  }

  .sidebar:not(.collapsed) .sidebar-item {
    padding: 10px 24px;
    justify-content: start;
  }

  main {
    margin-left: 0;
  }
}

@media (max-width: 1200px) and (min-width: 769px) {
  .sidebar {
    width: 72px;
  }

  .sidebar-text {
    display: none;
  }

  .sidebar-icon {
    margin-right: 0;
    font-size: 20px;
  }

  .sidebar-item {
    padding: 16px 0;
    justify-content: center;
  }

  .sidebar:not(.collapsed) {
    width: 240px;
  }

  .sidebar:not(.collapsed) .sidebar-text {
    display: block;
  }

  .sidebar:not(.collapsed) .sidebar-icon {
    margin-right: 24px;
  }

  .sidebar:not(.collapsed) .sidebar-item {
    padding: 10px 24px;
    justify-content: start;
  }
}

/**********************************************************/
#main {
  max-width: none;
  min-width: 70vw;
  padding: 0 24px 24px 24px;
}

#main.hiding {
  opacity: 0;
}

#main.visible {
  opacity: 1;
  transition: opacity 0.5s ease;
}

/********************************************/
@media (max-width: 1200px) {
  #main {
    max-width: 90vw;
  }
}

/**********************************************************/

/********************************************/
/********************************************/
/*****************Home page******************/

.load-more-btn {
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  margin: 20px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.load-more-btn:hover {
  background: var(--background);
  border: 1px solid var(--primary);
}

.shorts-button {
  display: none;
  /* display: flex; */
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin: 8px;
  border: none;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.shorts-button:hover {
  background: var(--background);
}

.shorts-icon {
  width: 18px;
  height: 18px;
}

/* Filtering UI Styles */
.filtering-container {
  margin-top: 8px;
}

/* Simple Mode Styles */
.simple-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--background);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 0 1px 1px var(--border);
}

.simple-chip-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background-color: var(--background);
  padding-bottom: 4px;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
  flex: 1;
}

.simple-chip-bar::-webkit-scrollbar {
  display: none;
}

.advanced-filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--surface);
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 24px;
  margin-left: 16px;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.advanced-filters-toggle:hover {
  border: 1px solid var(--primary);
}

.advanced-filters-toggle.filters-applied {
  background-color: var(--surface);
}

.advanced-filters-toggle svg {
  flex-shrink: 0;
}

/* Advanced Mode Styles */
.advanced-mode {
  padding: 4px;
  background-color: var(--background);
  border-radius: 8px;
  box-shadow: 0 0 1px 1px var(--border);
}

.advanced-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.advanced-mode-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.close-advanced-filters {
  background: none;
  border: 1px solid var(--background);
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-advanced-filters:hover {
  border: 1px solid var(--primary);
}

.selected-chips-container {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.selected-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-chips-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-right: 8px;
}

.selected-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.empty-selection {
  color: var(--text-secondary);
  font-size: 14px;
  font-style: italic;
}

.selected-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface);
  border-radius: 16px;
  padding: 8px;
  font-size: 13px;
  color: var(--text);
}

.remove-chip {
  background: none;
  border: none;
  color: #c82333;
  font-size: 24px;
  margin-left: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.remove-chip:hover {
  background-color: var(--surface);
}

.clear-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 4px;
  font-weight: 500;
  cursor: pointer;
  margin-left: auto;
}

.clear-btn:hover {
  border: 1px solid var(--primary);
}

.chip-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.chip-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
}

.chip-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chip-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  border-radius: 16px;
  padding: 6px 12px;
  border: 1px solid var(--surface);

  background-color: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.chip:hover {
  border: 1px solid var(--primary);
}

.chip.active {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.filter-sort-controls {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.filter-section {
  margin-bottom: 16px;
}

.filter-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

#sort-selector {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.filter-actions button {
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.reset-filters {
  background: none;
  border: none;
  color: var(--text-secondary);
}

.apply-filters {
  background-color: var(--background);
  border: none;
  color: var(--text);
}

.apply-filters:hover {
  background-color: var(--primary);
  color: #000;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 8px;
  width: 100%;
  margin-top: 20px;
  background-color: var(--background);
}
/********************************************/
/********************************************/
/******************same video card is rendered on grid or list view*********************/
/********************************************/
/* Video Card - Shared Styles */
.video-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
  transition: box-shadow 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  padding: 4px;
}



@media (max-width: 480px) {
  .video-card {
    margin: 0;
    padding: 0;
    margin-top: 8px;
    border-radius: 0;
  }
 
  .video-card:hover {
        border: 1px solid var(--background);

  }

  .video-card .creator {
    border: none;
    border-radius: 0;
    background-color: var(--background);
  }


  .videos-grid {
    padding: 0;
    margin: 0;
    margin-top: 4px;
  }
}


.video-card:hover {
  border: 1px solid var(--primary);
}

.thumbnail-container {
  position: relative;
  width: 100%;
}

.thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

.thumbnail::before {
  position: relative;
  top: 24%;
  padding: 4px;
  color: var(--primary);
}


.duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.video-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  
}

.video-info .title {
  margin: 4px;
}

.title {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  /* Dynamic font scaling */
  font-size: 16px; /* Base font size */
}

/* For longer titles, progressively reduce font size */
.title:nth-child(n + 20) {
  font-size: 15px;
}

.title:nth-child(n + 30) {
  font-size: 14px;
}

.title:nth-child(n + 40) {
  font-size: 13px;
}

.title:nth-child(n + 50) {
  font-size: 12px;
}

.title:nth-child(n + 60) {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border: 1px solid var(--background);
  background-color: var(--background);
  border-radius: 6px;
  transition: background-color 0.2s ease;
  margin: -4px; /* Negative margin to expand clickable area */
  text-overflow: ellipsis;

}

.creator:hover {
  background-color: var(--surface);
}

.creator-image {
  flex-shrink: 0;
}

.creator-name {
  max-width: 50px;
}

.channel-image {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
}

/* .video-card .time {
  margin-left: 4px;
} */

.channel-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  opacity: 0.9;
  max-width: 150px;
  text-overflow: ellipsis;
}

.metadata {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
  align-items: center;
  justify-content: flex-start;
  margin: 4px;
  padding: 4px;
 
}



.file-size,
.blossom-indicator,
.time {
  font-size: 12px;
  color: var(--text);
 
  background-color: var(--background);
  

  font-weight: 500;
}

/* .blossom-indicator {
  font-size: 16px;
} */

/* .blossom-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 16px;
  z-index: 5;
  pointer-events: none;
}
 */
.options-button {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  margin: 4px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.options-button:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.options-button svg {
  width: 16px;
  height: 16px;
}

.options-menu {
  position: absolute; /* Back to absolute */
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;

  min-width: 160px;
  z-index: 100;
  overflow: visible;
  bottom: 128px; /* Position below button */
  right: 72px; /* Align with right edge */
}
.options-menu.hidden {
  display: none;
}

.videos-listview .options-menu {
  top: 16px; /* Position below button */
  bottom: unset;
  right: 36px;
}

.listv-spacer {
  display: none;
  height: 64px;
}
.videos-listview .options-button {
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
}
.options-menu-item {
  padding: 12px 16px;
  margin: 4px;
  cursor: pointer;
  background-color: var(--background);
  border: 1px solid var(--background);
  border-radius: 8px;
  transition: background-color 0.15s ease;
  font-size: 14px;
  color: var(--text);
}

.options-menu-item:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

/* Secondary Elements */
.description,
.participants,
.hashtags,
.links,
.content-warning,
.text-tracks,
.segments {
  font-size: 13px;
  color: var(--text);
  opacity: 0.8;
  margin-top: 4px;
}

.content-warning {
  color: var(--accent);
  font-weight: 500;
  opacity: 1;
}

.videos-listview .creator {
  width: 30%;
}

.videos-listview .video-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--secondary);
  width: 95%;
  max-width: 600px;
  height: auto;
  flex-wrap: nowrap;
  overflow-y: visible;
}

.videos-listview .video-card > * {
  margin-right: 10px;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.videos-listview .video-info {
  flex-grow: 1;
  padding: 4px;
  white-space: nowrap;
  overflow: visible;
  background-color: var(--surface);
  border: none;
  text-overflow: ellipsis;
}

.video-card .description,
.video-card .participants,
.video-card .links,
.video-card .hashtags,
.video-card .quality,
.video-card .text-tracks,
.videos-listview .participants,
.videos-listview .hashtags {
  display: none;
}

.videos-listview .thumbnail-container,
.videos-listview .thumbnail,
.videos-listview .channel-image {
  display: none;
}

.videos-listview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 8px;
  width: 100%;
  max-width: 1000px;
  min-height: 600px;
  margin: 0 auto;
  margin-bottom: 36px;
  align-items: center;
}

/* Better spacing for list view */
.videos-listview .title {
  font-size: 18px;
  margin-bottom: 4px;
}

.videos-horizontal .videos-grid {
  display: inline-flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 1.5rem;
  padding: 8px;
  width: 100%;
  scrollbar-width: thin;
}

/* fixed width for each card in the horizontal layout */
/*********this horizontal would contain the same grid*/
.videos-horizontal .videos-grid .video-card {
  min-width: 280px;
  width: 280px;
  flex: 0 0 auto;
}

.videos-horizontal::-webkit-scrollbar {
  display: none;
}

.videos-horizontal {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
@media (max-width: 769px) {
  .videos-listview .video-info {
    justify-content: center;
  }

  .videos-listview .title {
    font-size: 16px;
  }
}

/***************************************/
/***********playlist card***************/

.playlist-card .video-count {
  font-weight: bolder;
  font-size: larger;
  color: var(--text);
  opacity: 1;
}

.playlist-card .options-menu {
  min-width: 160px;
  z-index: 100;
  overflow: visible;
  top: 50px; /* Position below button */
  right: 72px; /* Align with right edge */
  bottom: unset;
}

/**********************************************/
/**********************************************/
/**********************************************/
/*******************************************/
/************video page********************/
/*******************************************/

/********************************************/
/* Video player */
/********************************************/

/* Updated Video Container */
.video-container {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16/9; /* Maintains proper aspect ratio */
  margin-top: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #000;
  position: relative; /* Important for custom player positioning */
}

/* Ensure video elements fill the container properly */
.video-container video,
.video-container .custom-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Default video player specific styles */
.default-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Custom video player container */
.custom-video-player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 8px;
}

.custom-video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Custom player indicator (so you can tell it's the custom player) */
.custom-player-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .video-container {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .video-container {
    border-radius: 4px;
  }
}

/* Video container loading state */
.video-container.loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container .loading-spinner {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Video error styling improvements */
.video-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  padding: 20px;
  text-align: center;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.video-error p {
  margin: 5px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/***************************************************************/
/* Blocked Video UI */
.blocked-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  background-color: var(--background);
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden; /* Prevent content from overflowing */
}

.blocked-video-icon {
  font-size: clamp(18px, 4vw, 36px); /* Responsive icon size */
  margin-bottom: clamp(6px, 2vw, 12px);
  flex-shrink: 0;
}

.blocked-video-title {
  margin: 0 0 clamp(6px, 1.5vw, 12px) 0;
  color: var(--text);
  font-size: clamp(18px, 3vw, 24px);
  flex-shrink: 0;
}

.blocked-video-domain {
  margin: 0 0 clamp(4px, 1vw, 8px) 0;
  color: var(--text-secondary);
  font-size: clamp(16px, 2.5vw, 18px);
  font-weight: bold;
  flex-shrink: 0;
}

.blocked-domain {
  word-break: break-all; /* Break long domain names */
}

.blocked-video-description {
  margin: 0 0 clamp(10px, 2.5vw, 20px) 0;
  color: var(--text-secondary);
  max-width: 90%;
  font-size: clamp(14px, 2.2vw, 18px);
  line-height: 1.4;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blocked-video-actions {
  display: flex;
  gap: clamp(6px, 1.5vw, 12px);
  flex-wrap: wrap;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
}

.allow-once-btn,
.add-to-whitelist-btn {
  padding: clamp(6px, 1.5vw, 10px) clamp(10px, 2.5vw, 20px);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: clamp(14px, 2vw, 18px);
  transition: background-color 0.2s ease;
  background-color: var(--background);
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 45%;
}

.allow-once-btn:hover,
.add-to-whitelist-btn:hover {
  background-color: var(--surface);
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
  .blocked-video-container {
    padding: 10px;
  }

/*   .blocked-video-icon,
  .blocked-video-title {
    display: none;
  } */

/*   .blocked-video-actions {
    flex-direction: column;
    gap: 8px;
  } */

  .allow-once-btn,
  .add-to-whitelist-btn {
    max-width: 49%;
    width: 49%;
  }

  .blocked-video-description {
    font-size: 12px;
    line-height: 1.3;
  }
}

/* Very small containers */
@media (max-height: 300px) {
  .blocked-video-container {
    padding: 8px;
  }

  .blocked-video-description {
    display: none; /* Hide description on very small heights */
  }

  .blocked-video-icon {
    font-size: 24px;
    margin-bottom: 4px;
  }
}

.player-toggle {
  background-color: var(--surface);
  color: var(--text-secondary);
  text-align: center;
  border: none;
  width: 100%;
  height: 50px;
  max-height: 40px;
  max-width: 720px;
  font-size: small;
}

.player-toggle button {
  margin: 0;
  padding: 0;
  width: 99%;
  height: 99%;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--text);
  cursor: pointer;
}

.player-toggle button:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}
/****************************************/
/***video actions***/

.video-action-tab-button {
  background: var(--background);
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0; /* Prevent buttons from shrinking */
  min-width: fit-content;
}

.video-action-tab-button:hover {
  background: var(--surface);
}

.video-action-tab-button.active {
  border-bottom-color: var(--primary);
  background: var(--surface);
}

/* Mobile optimizations */
@media (max-width: 769px) {
  .video-action-tab-button {
    padding: 10px 16px;
    font-size: 13px;
  }
}



.video-action-tab-button.saved,
.video-action-tab-button.liked {
  background: var(--surface);
  border-color: var(--primary);
}

/**********************************************/
/* Video info */
.video-info {
  padding: 4px;
  background-color: var(--background);
  border-top: 1px solid var(--border);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.video-title {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.video-description {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
}

.video-info-bar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  background-color: var(--background);
  padding: 8px;
  border-top: 1px solid var(--primary);
  color: var(--text);
  gap: 8px;
}

.channel-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  cursor: pointer;
  text-align: center;
  height: 6vh;
  gap: 8px;
  color: var(--text);
  border-bottom: 1px solid var(--background);
  margin-top: 8px;
  padding: 8px;
}

.channel-info:hover {
  border-bottom: 1px solid var(--primary);
}

.channel-image {
  max-width: 50px;
  max-height: 50px;
  border-radius: 50%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

nostr-picture::part(img) {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border: none;
  border-radius: 50%;
  margin: 0;
  padding: 0;
  background-color: var(--surface);
}

.channel-name {
  font-weight: bold;

  white-space: nowrap; /* Prevent text from wrapping */
  text-overflow: ellipsis; /* Add ellipsis if text is too long */
  max-width: 100%; /* Or set a specific max width */
  display: inline-block; /* Or block, depending on your layout */

  font-size: clamp(10px, 3vw, 16px);
}

.video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.video-actions button {
  display: flex;
  align-items: center;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px;
  margin: 8px;
  cursor: pointer;
}

.video-actions button:hover {
  border: 1px solid var(--primary);
  background-color: var(--background);
}

.action-like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-like-btn:hover {
  background: var(--surface);
}

.action-like-btn.liked {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--primary);
}

.action-like-btn:disabled {
  cursor: not-allowed;
}

.like-count {
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

.like-count:empty {
  display: none;
}

.info-containers {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.social-info .video-content {
  padding: 4px;
}

.social-info .video-tags,
.social-info .video-relays {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  align-items: end;
}

.social-data > div {
  margin-bottom: 8px;
}

.social-data .relays-section {
  display: none;
}

.social-data h4 {
  margin: 0 0 5px 0;
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
}

.social-data p {
  color: var(--text);
  word-break: break-word;
}

.technical-info .technical-title {
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  margin: 0;
  color: var(--text);
}

.technical-content {
  padding: 4px;
}

.technical-data > div {
  margin-bottom: 8px;
}

.technical-data h4 {
  margin: 0 0 5px 0;
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
}

.technical-data p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.clickable-tag {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.2s;
  padding: 8px;
  margin: 4px;
}

.clickable-tag:hover {
  opacity: 0.8;
  background-color: var(--background);
  border: 1px solid var(--primary);
}

.clickable-relay {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: underline;
  transition: all 0.2s;
  word-break: break-all;
  padding: 8px;
  margin: 4px;
}

.clickable-relay:hover {
  opacity: 0.8;
  background-color: var(--background);
  border: 1px solid var(--primary);
}

.validate-blossom-btn {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
}

.validate-blossom-btn:hover {
  border: 1px solid var(--primary);
  background-color: var(--background);
}

.info-container {
  border: 1px solid var(--surface);
  border-radius: 8px;
  padding: 4px;
  width: 100%;
  max-width: 720px;
  margin-bottom: 8px;
}

.info-container:hover {
  border: 1px solid var(--primary);
}
.video-title {
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  margin: 0;
  color: var(--text);
}

.arrow {
  font-size: 1.2rem;
  transition: transform 0.3s;
}

details[open] .arrow {
  transform: rotate(180deg);
}

.video-content {
  padding: 1rem 0;
  word-break: break-all;
}

.video-description {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 20px;
}

.video-stats {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 20px;
}

.video-stats span {
  margin-right: 10px;
}

/********************************************/

/*********************************************/
/* Cross-browser thin scrollbar with dynamic color */
.scrollable-content,
.comments-container {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: thin; /* Firefox thin scrollbar */
  overflow-y: scroll; /* Ensure scrolling works */
}

/* Webkit browsers (Chrome, Safari, Opera) */
.scrollable-content::-webkit-scrollbar,
.comments-container::-webkit-scrollbar,
main::-webkit-scrollbar {
  width: 2px; /* Very thin scrollbar */
}

.scrollable-content::-webkit-scrollbar-thumb,
.comments-container::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb {
  background-color: var(--border); /* Dynamic color from CSS variable */
  border-radius: 2px; /* Rounded corners */
}

.scrollable-content::-webkit-scrollbar-track,
.comments-container::-webkit-scrollbar-track,
main::-webkit-scrollbar-track {
  background: transparent; /* Transparent track */
}

/* Firefox specific styling */
.scrollable-content,
.comments-container,
main {
  scrollbar-color: var(--border) transparent; /* Color and track color */
}

@media (max-width: 769px) {
  .scrollable-content {
    max-height: 600px;
    overflow-y: auto;
  }

  .comments-container {
    padding: 4px;
  }

  .comment-card {
    padding: 0.7rem;
  }

}

@media (min-width: 769px) {
  .scrollable-content {
    max-height: 600px;
    overflow-y: auto;
  }
}

.toggle-view-btn {
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-view-btn:hover {
  background-color: var(--surface);
}

/**********************************************/
/**********************************************/
/*********comments*****************/
/**********************************************/
.comments-container {
  margin-top: 4px;
  max-height: 600px;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 8px;
  background-color: var(--background);
  width: 100%;
  max-width: 720px;
}

.comments-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comments-header {
  margin: 4px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-card {
  background-color: var(--surface);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.comment-author {
  font-weight: bold;
  color: var(--secondary);
}

.comment-date {
  color: var(--text-secondary);
}

.comment-content {
  line-height: 1.5;
  margin-bottom: 1rem;
  word-break: break-word;
  color: var(--text);
}

.nostr-note-wrapper {
  display: none;
  margin-bottom: 1rem;
}

.loading-message,
.error-message {
  padding: 1rem;
  text-align: center;
  color: #666;
  font-style: italic;
}

.error-message {
  color: #d32f2f;
}

.see-more-btn {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 0.9em;
  padding: 4px 0;
  text-decoration: underline;
  margin-top: 8px;
}

.see-more-btn:hover {
  color: #0056b3;
}

.comment-text {
  white-space: pre-wrap; /* Preserves line breaks */
  word-wrap: break-word; /* Handles long words */
}

/*******************************************/
/*********Bookmarks page*********************/
/* Bookmarks Page Styles */
.bookmarks-header {
  display: flex;
  flex-direction: column;

  justify-content: space-between;
  margin: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  max-width: 800px;
}

.bookmarks-header h2 {
  margin: 0;
  color: var(--text);
}

.bookmark-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.bookmark-actions button {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.bookmark-actions button:hover {
  background: var(--hover);
  border-color: var(--primary);
}

.bookmarks-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.bookmark-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: flex-start;
  gap: 15px;
}

.bookmark-card:hover {
  background: var(--hover);
  border-color: var(--primary);
}

.bookmark-thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--background);
  border: 1px solid var(--border);
}

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

.no-thumbnail {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-secondary);
  background: var(--background);
}

.bookmark-details {
  flex: 1;
  min-width: 0;
}

.bookmark-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.bookmark-channel .channel-name {
  font-weight: 500;
  color: var(--primary);
  font-size: 14px;
}

.video-created-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.bookmark-meta {
  margin-bottom: 8px;
}

.saved-time {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--background);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.bookmark-description {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.remove-bookmark-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.remove-bookmark-btn:hover {
  background: #ff4444;
  border-color: #ff4444;
  color: white;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state h1 {
  color: var(--text);
  margin-bottom: 15px;
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 16px;
}

.empty-state .nav-link {
  display: inline-block;
  padding: 10px 20px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.empty-state .nav-link:hover {
  background: var(--background);
  border: 1px solid var(--primary);
}

@media (max-width: 769px) {
  .bookmark-card {
    flex-direction: column;
    text-align: center;
  }

  .bookmark-thumbnail {
    width: 100%;
    height: 160px;
    align-self: center;
  }

  .bookmark-actions {
    align-self: stretch;
  }

  .remove-bookmark-btn {
    width: 100%;
  }
}

#bookmark-videos .video-description {
  display: none;
}

/*******************************************/
/************************************************/
/******************PostingPage******************/
/************************************************/

.posting-container {
  color: var(--text);
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  max-width: 900px;
  margin: 8px auto;
}

.posting-title {
  color: var(--primary);
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.posting-container .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.posting-container .form-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--background);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.posting-container .form-section h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
}

.posting-container .form-group {
  margin-bottom: 1rem;
}

.posting-container .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-weight: 600;
}

.posting-container .form-group input,
.posting-container .form-group textarea,
.posting-container .form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.posting-container .form-group input:focus,
.posting-container .form-group textarea:focus,
.posting-container .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

.posting-container .form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.posting-container .form-section label {
  display: block;
  margin-bottom: 0.5rem;
}

.posting-container .form-section input,
.posting-container .form-section textarea,
.posting-container .form-section select {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.posting-container .form-section input:focus,
.posting-container .form-section textarea:focus,
.posting-container .form-section select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

.posting-container .form-section textarea {
  resize: vertical;
  min-height: 100px;
}

/* Tabs */
.posting-container .video-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.posting-container .tab-button {
  padding: 0.75rem 1.5rem;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.posting-container .tab-button.active {
  background-color: var(--background);
  color: var(--text);
  box-shadow: 0 0 0 6px var(--primary);
}

.posting-container .tab-button:hover:not(.active) {
  border-color: var(--primary);
}

.posting-container .tab-content {
  display: none;
}

.posting-container .tab-content.active {
  display: block;
}

/* Input groups */
.posting-container .input-group,
.posting-container .tags-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.posting-container .input-group input,
.posting-container .tags-input-group input,
.posting-container .tags-input-group select {
  flex: 1;
}

.posting-container .input-group button,
.posting-container .tags-input-group button {
  padding: 0.75rem 1rem;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.posting-container .input-group button:hover,
.posting-container .tags-input-group button:hover {
  border-color: var(--primary);
}

.posting-container .help-text {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Upload area */
.posting-container .upload-area {
  text-align: center;
  padding: 2rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background-color: var(--surface);
}

.posting-container .upload-button {
  display: none;
  padding: 1rem 2rem;
  background-color: var(--primary);
  color: var(--background);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.posting-container .upload-button:hover {
  background-color: var(--primary-hover);
}

.external-upload-services {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 15px;
  margin-top: 15px;
}

.upload-service-link {
  text-decoration: none;
  width: 100%;
  max-width: 300px;
  text-align: center;
  padding: 12px 15px;
  background-color: var(--background);
  color: var(--text);
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.upload-service-link:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.validation-options > label {
  color: var(--text-secondary);
}

/* Video counter */
.posting-container .video-counter {
  text-align: center;
  margin: 1rem 0;
  padding: 0.5rem;
  background-color: var(--surface);
  border-radius: 6px;
  font-weight: 600;
  color: var(--primary);
}

/* Video items */
.posting-container .video-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.posting-container .video-preview {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.posting-container .video-thumbnail {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.posting-container .video-info {
  flex: 1;
  word-break: break-all;
}

.posting-container .video-info p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.posting-container .posting-video-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.posting-container .thumbnail-input {
  flex: 1;
  min-width: 200px;
}

.posting-container .update-thumbnail,
.posting-container .remove-video {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.posting-container .update-thumbnail {
  background-color: var(--surface);
  color: var(--text);
}

.posting-container .remove-video {
  background-color: var(--error);
  color: white;
  border-color: var(--error);
}

.posting-container .update-thumbnail:hover {
  border-color: var(--primary);
}

.posting-container .remove-video:hover {
  background-color: var(--error-hover);
}

/* Tags */
.posting-container #selected-tags-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.posting-container .tag-item {
  background-color: var(--surface);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  margin: 0.75rem 0.25rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 0.5rem;
  max-width: 300px;
}

.posting-container .remove-tag {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
}

.posting-container .no-tags {
  color: var(--text-secondary);
  font-style: italic;
}

/* Custom fields */
.posting-container .custom-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.posting-container .field-name,
.posting-container .field-value {
  flex: 1;
}

.posting-container .remove-field {
  padding: 0.5rem;
  background-color: var(--surface);
  color: var(--text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#add-field {
  padding: 0.75rem 1rem;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

#add-field:hover {
  border-color: var(--primary);
}

.posting-container .relay-sets-selection {
  margin-bottom: 1rem;
}

.posting-container .relay-set-checkbox {
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}

.posting-container .relay-set-checkbox label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  min-width: 350px;
  transition: background 0.3s ease;
}

.posting-container .relay-set-checkbox label:hover {
  background: var(--surface);
}

.posting-container .relay-set-checkbox input[type="checkbox"]:checked + * ~ *,
.posting-container .relay-set-checkbox input[type="checkbox"]:checked + * {
  color: var(--primary);
}

.posting-container .relay-set-checkbox input[type="checkbox"] {
  margin-right: 0.5rem;
}

.posting-container .relay-set-name {
  font-weight: bold;
  color: var(--text);
  margin-right: 0.5rem;
}

.posting-container .relay-set-count {
  color: var(--text);
  font-size: 0.9em;
}

.posting-container .selected-relays-info {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--background);
  border-radius: 4px;
}

.posting-container .relay-preview {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.posting-container .relay-chip {
  display: inline-block;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  font-size: 0.8em;
}

.posting-container .relay-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.9em;
  margin: 2px;
}

.posting-container .remove-relay {
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.posting-container .remove-relay:hover {
  background: var(--background);
}

.posting-container .no-relays {
  color: var(--text);
  font-style: italic;
}

/* Submit button */
.posting-container .submit-button {
  width: 100%;
  padding: 1rem;
  background-color: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.posting-container .submit-button:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.posting-container .submit-button:disabled {
  background-color: var(--text-secondary);
  cursor: not-allowed;
}

.posting-container .submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.posting-container .loading {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 769px) {
  .posting-container {
    padding: 1rem;
    margin: 4px;
  }

  .posting-container .video-preview {
    flex-direction: column;
  }

  .posting-container .video-thumbnail {
    width: 100%;
    height: 180px;
  }

  .posting-container .posting-video-controls {
    flex-direction: column;
  }

  .posting-container .thumbnail-input {
    min-width: unset;
  }

  .posting-container .input-group,
  .posting-container .tags-input-group {
    flex-direction: column;
  }

  .posting-container .input-group input,
  .posting-container .tags-input-group input,
  .posting-container .tags-input-group select {
    width: 100%;
  }

  .posting-container .relay-set-checkbox label {
    min-width: 250px;
  }
}


/*******************************************************************/
/************************************************/
/******************faqPage******************/
/************************************************/

.faq-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;

  overflow: hidden; /* Prevents any internal scrolling */
  width: 100%;
}

.faq-section {
  margin: 8px;
  width: 100%;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item h3 {
  margin-bottom: 0.5rem;
}

.markdown-note {
  border-left: 2px solid var(--primary);
  background-color: var(--background);
  padding: 8px;
  margin: 4px;
  color: var(--text);
  font-style: italic;
  font-size: 1.1em;
  border-radius: 4px;
}

.svgg1 {
  background-color: var(--primary);
  height: 90px;
  width: 150px;
}

.svgg2 {
  background-color: var(--accent);
  width: 50px;
  height: 45px;
}

.svgg3 {
  background-color: var(--primary-hover);
  height: 45px;
  width: 75px;
  border: 3px solid var(--primary);
  border-radius: 8px;
}

.svgg4 {
  background-color: var(--secondary);
  height: 50px;
  width: 100px;
}

/************************************************/
/******************ProfilePage******************/
/************************************************/

.profile-container {
  word-break: normal;
}

.settings-section {
  display: flex;
  justify-content: start;
  margin-top: 12px;
}
.profile-container .profile-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.profile-container .profile-card p {
  margin: 0;
  padding: 0;
}

/* Profile Page Container */
.profile-page {
  background-color: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  margin: 8px;
  max-width: 1200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.profile-banner {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: var(--background);
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-container .profile-header {
  display: flex;
  align-items: flex-start;
  padding: 20px;
  gap: 20px;
  word-break: break-all;
}

.profile-container .profile-picture {
  margin-top: -80px; /* Overlap with banner */
  border: 4px solid var(--surface);
  border-radius: 50%;
  background-color: var(--surface);
  width: 160px;
  height: 160px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.profile-container .profile-info {
  flex: 1;
}

.profile-container .display-name {
  font-size: 2rem;
  margin: 0;
  color: var(--text);
}

.profile-container .username {
  font-size: 1.2rem;
  color: var(--primary);
  margin: 5px 0;
}

.profile-container .about {
  font-size: 1rem;
  color: var(--text);
  margin: 10px 0;
  white-space: pre-line;
}

.profile-container .about nostr-name {
  color: var(--primary);
  font-size: large;
}

.profile-container .profile-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

/* .profile-links-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  gap: 12px;
  flex-wrap: wrap;
}



.profile-link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-shrink: 1;
}

.website-link,
.nip05-container,
.lud16,
.shareProfileLink {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  background-color: var(--background);
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  transition: all 0.2s ease;
  min-width: 0;
  overflow: hidden;
}

.nip05-container {
  flex-direction: column;
  align-items: stretch;
  padding: 12px 14px;
  cursor: default;
}

.nip05-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.nip05-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.cors-notice {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
  line-height: 1.2;
}

.cors-test-button {
  background: linear-gradient(135deg, var(--background), var(--surface));
  color: var(--text);
  border: none;
  padding: 6px 12px;
  font-size: 0.7rem;
  border-radius: 15px;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.cors-test-button:hover {
  box-shadow: 0 0 0 2px var(--primary);
}

.cors-test-button:active {
  background: var(--surface);
}

.website-link:hover,
.lud16:hover,
.shareProfileLink:hover {
  border-color: var(--primary);

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.website-link:hover {
  color: var(--primary);
}
 */
.profile-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.profile-links-row .profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.profile-links-row .profile-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.profile-links-row .profile-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.profile-links-row .profile-btn-text {
  font-weight: 500;
}

/* Follow button states */
.profile-links-row .profile-btn.following {
  background: var(--background);
  color: var(--text);
  border-color: var(--border);
}

.profile-links-row .profile-btn.following:hover {
  background: var(--surface);
  border-color: var(--primary);
}

/* NIP-05 verification states */
.profile-links-row .profile-btn.nip05-btn.pending .profile-btn-text {
  color: #6c757d;
}

.profile-links-row .profile-btn.nip05-btn.verified {
  border-color: var(--success, #28a745);
}

.profile-links-row .profile-btn.nip05-btn.verified .profile-btn-text {
  color: var(--success, #28a745);
}

.profile-links-row .profile-btn.nip05-btn.failed {
  border-color: var(--danger, #dc3545);
}

.profile-links-row .profile-btn.nip05-btn.failed .profile-btn-text {
  color: var(--danger, #dc3545);
}

/* CORS notice */
.profile-links-row .cors-notice {
  font-size: 11px;
  color: #6c757d;
  margin-top: 4px;
}

.profile-links-row .cors-test-btn {
  font-size: 11px;
  padding: 2px 8px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}

/* SVG icon styling */
.profile-links-row .profile-icon {
  width: 16px;
  height: 16px;
}

/* .nip05-container.verified {
  border-color: #28a745;
  background-color: rgba(40, 167, 69, 0.05);
}

.nip05-container.failed {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

.nip05-container.pending {
  border-color: #ffc107;
  background-color: rgba(255, 193, 7, 0.05);
}
 */
/* Responsive design */
@media (max-width: 768px) {
  .profile-links-row {
    gap: 8px;
  }

  .website-link,
  .nip05-container,
  .lud16,
  .shareProfileLink {
    font-size: 0.8rem;
    padding: 8px 12px;
    max-width: 180px;
  }

  .cors-notice {
    font-size: 0.65rem;
  }

  .cors-test-button {
    font-size: 0.65rem;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
/*   .profile-links-row {
    flex-direction: column;
    align-items: stretch;
  } */

  .profile-link-item {
    width: 100%;
  }

  .website-link,
  .nip05-container,
  .lud16,
  .shareProfileLink {
    max-width: none;
    width: 100%;
    justify-content: center;
  }
}

.action-follow-btn {
  border: 4px solid var(--border);
  margin-top: 10px;
  padding: 8px;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--surface);
  color: var(--text);
}

.action-follow-btn:hover {
  border: 4px solid var(--primary);
}

.action-follow-btn.following {
  border: 2px solid var(--primary);
  background-color: var(--background);
}

@media (max-width: 769px) {
  .profile-container .profile-card {
    flex-direction: column;
  }
  .profile-container .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-container .profile-picture {
    margin-top: -60px;
    width: 120px;
    height: 120px;
  }
}

.profile-tabs,
.video-action-tabs {
  overflow: hidden;
}

.video-action-tabs {
  width: 100%;
  margin: 4px;
}
.tab-scroll-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background-color: var(--background);
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
  flex: 1;
}

.tab-scroll-container::-webkit-scrollbar {
  display: none;
}

.profile-tab-button {
  background: var(--background);
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0; /* Prevent buttons from shrinking */
  min-width: fit-content;
}

.profile-tab-button:hover {
  background: var(--surface);
}

.profile-tab-button.active {
  border-bottom-color: var(--primary);
  background: var(--surface);
}

.tab-placeholder {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.tab-placeholder h1 {
  margin-bottom: 10px;
  color: var(--text);
}

/* Mobile optimizations */
@media (max-width: 769px) {
  .profile-tab-button {
    padding: 10px 16px;
    font-size: 13px;
  }
}

.profile-tab-content {
  min-height: 200px;
}

.profile-tab-panel {
  display: none;
  min-height: 500px;
}

.profile-tab-panel.active {
  display: block;
}

/* Technical Info Section */
.profile-technical-info {
  background-color: var(--surface);
  border-radius: 8px;
  padding: 4px;
  margin: 8px;
  max-width: 1200px;
  border: 1px solid var(--border);
}

.technical-info-toggle {
  width: 100%;
  background-color: var(--background);
  border: none;
  border-radius: 4px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.technical-info-toggle:hover {
  background-color: var(--surface);
}

.toggle-arrow {
  font-size: 0.7rem;
}

.technical-info-content {
  display: none;
  padding: 16px;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
}

.technical-info-content.expanded {
  display: block;
}

.profile-identifiers {
  margin-bottom: 16px;
  max-width: 600px;
}

.identifier-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  background-color: var(--background);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.identifier-label {
  color: var(--primary);
  flex-shrink: 0;
}

.identifier-value {
  flex: 1;
  color: var(--text);
  overflow-x: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.copy-btn {
  background-color: var(--background);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.copy-btn:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.relay-hints-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.relay-hints-section h4 {
  margin: 0 0 12px 0;
  color: var(--primary);
}

.relay-hints-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-width: 500px;
}
.relay-hint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px;
  padding: 8px;
  background-color: var(--background);
  border-radius: 4px;
  border: 1px solid var(--border);
  min-height: 32px;
  cursor: pointer;
  transition: background-color 0.2s ease;

  /* Button-specific resets */
  font: inherit; /* Inherit font from parent */
  text-align: left; /* Left-align content */

  box-sizing: border-box;
}

.relay-hint-item:hover {
  background-color: var(--surface);
}

.relay-hint-item:focus {
  outline: 2px solid var(--accent, #0066cc); /* Add focus indicator */
  outline-offset: 1px;
}

.relay-hint-item span {
  color: var(--text);
  font-size: larger;
}


.relay-url {
  flex: 1;
  /*   font-family: monospace;
  font-size: 0.75rem; */
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
  min-width: 0;
  text-align: left; /* Ensure text stays left-aligned */
}

.relay-icon {
  flex-shrink: 0;
  pointer-events: none;
}

/* Mobile and small screens */
@media (max-width: 769px) {
  .technical-info-content {
    padding: 12px;
  }

  .identifier-item {
    padding: 6px;
    gap: 6px;
  }

  .relay-hint-item {
    padding: 5px 6px;
    gap: 6px;
    min-height: 28px;
  }

  /*   .relay-url {
    font-size: 0.7rem;
  } */

  .copy-btn,
  .relay-btn {
    padding: 3px 6px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .profile-technical-info {
    .relay-hint-item {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 6px;
      padding: 6px 8px;
      background-color: var(--background);
      border-radius: 4px;
      border: 1px solid var(--border);
      min-height: 32px;
      cursor: pointer;
      transition: background-color 0.2s ease;

      /* Button-specific resets */
      font: inherit; /* Inherit font from parent */
      text-align: left; /* Left-align content */

      box-sizing: border-box;
    }

    .relay-hint-item:hover {
      background-color: var(--surface);
    }

    .relay-hint-item:focus {
      outline: 2px solid var(--accent, #0066cc); /* Add focus indicator */
      outline-offset: 1px;
    }

    .relay-url {
      flex: 1;
      color: var(--text);
      overflow-x: auto;
      white-space: nowrap;
      min-width: 0;
      text-align: left; /* Ensure text stays left-aligned */
    }

    .relay-icon {
      flex-shrink: 0;
      pointer-events: none;
    }
  }
}
/* Mobile and small screens */
@media (max-width: 769px) {
  .relay-hint-item {
    padding: 5px 6px;
    gap: 6px;
    min-height: 28px;
  }

  /*   .relay-url {
    font-size: 0.7rem;
  } */

  .technical-info-toggle {
    padding: 10px 12px;
    /* font-size: 0.85rem; */
  }

  .technical-info-content {
    padding: 10px;
  }
}
/***************************************/
/* Profile Edit Page */
.edit-profile-container {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 20px;
}

.edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.edit-header h1 {
  margin: 0;
  color: var(--text);
}

.edit-actions {
  display: flex;
  gap: 10px;
}

.cancel-button {
  background-color: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.cancel-button:hover {
  border-color: var(--primary);
}

.save-button {
  background-color: var(--background);
  color: var(--text);
  border: 2px solid var(--primary);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.save-button:hover:not(:disabled) {
  background-color: var(--surface);
  border-color: var(--accent);
}

.save-button:disabled {
  background-color: var(--border);
  border-color: var(--border);
  cursor: not-allowed;
}

.edit-content {
  background-color: var(--surface);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section h3 {
  margin: 0 0 10px 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

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

.form-group label {
  font-weight: bold;
  color: var(--text);
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background-color: var(--background);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  font-size: 12px;
  color: var(--text);
  opacity: 0.7;
  margin-top: -4px;
}

.edit-profile-button {
  background-color: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 24px 16px;
  margin: 8px;
  border-radius: 8px;
  width: 97%;
  max-width: 1200px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.edit-profile-button:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

@media (max-width: 769px) {
  .edit-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .edit-actions {
    justify-content: space-between;
  }

  .cancel-button,
  .save-button {
    flex: 1;
  }

  .edit-content {
    padding: 20px;
  }
}

/************************************************/
/************************************************/

.loading-indicator {
  text-align: center;
  padding: 2rem;
  color: var(--text);
}

.error-message {
  background-color: var(--surface);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 2px 5px var(--surface);
}

.error-message h2 {
  color: #e74c3c;
  margin-bottom: 1rem;
}

.error-message a {
  color: #3498db;
  text-decoration: none;
}

.error-message a:hover {
  text-decoration: underline;
}

/*********************************************************************************************************/
#create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 100px;
  flex-shrink: 0;
  background-color: rgba(92, 92, 92, 0.342);
  padding: 12px;
  border-radius: 16px;
  margin: 8px;
  text-decoration: none;
  gap: 6px;
}

@media (max-width: 600px) {
  #create-button {
    margin: 4px;
    padding: 8px;
    height: 36px;
    min-width: 80px;
    gap: 4px;
  }
}

@media (min-width: 770px) {
  .sidebar {
    height: auto;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
  }

  .sidebar-item {
    padding: 8px 24px;
  }

  .sidebar-section {
    flex-shrink: 0;
    padding: 4px 0;
  }

  #main {
    height: 100%;
    max-height: 75vh;
  }
}

@media (max-width: 770px) {
  body::-webkit-scrollbar {
    display: none;
  }

  .logo span {
    display: none;
  }

  .logo img {
    scale: 0.9;
  }

  #main {
    max-width: none;
    padding: 4px;
    margin-bottom: 60px;
    height: 100%;
   
  }

  .page-container {
    flex-direction: column;
    padding-bottom: 2vh;
  }

  .sidebar,
  .sidebar.collapsed {
    width: 100%;
    height: auto;
    min-height: 9vh;
    max-height: 10vh;

    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    z-index: 99;
    padding: 0;
    display: flex;
    justify-content: space-around;
    background-color: var(--background);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-bottom: none;

    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-section {
    display: flex;
    width: 100%;
    justify-content: space-around;
    padding: 0;
    margin: 0;
  }

  .sidebar-text,
  .sidebar.collapsed .sidebar-text {
    display: none;
  }

  .sidebar-item.active .sidebar-text,
  .sidebar-item.active .sidebar.collapsed .sidebar-text {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
  }

  .sidebar-item,
  .sidebar.collapsed .sidebar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    margin: 4px;
    width: 19vw;
  }

  .sidebar-icon,
  .sidebar.collapsed .sidebar-icon {
    margin: 2px;
    font-size: 20px;
  }

  header {
    padding: 0.5rem;
  }

  footer {
    display: none;
  }


  .nav-links {
    justify-content: flex-end;
    
  }

  .nav-links a,
  #toggleTheme {
    font-size: smaller;
    margin: 0;
    padding: 8px;
  }

  .chip-bar {
    top: 120px;
  }

  .relay-entries {
    grid-template-columns: 1fr;
  }

  .list-actions {
    flex-wrap: wrap;
  }

  .posting-container {
    padding: 1rem;
  }

  .posting-container h1 {
    font-size: 2rem;
  }

  .posting-container .form-group-imeta {
    flex-direction: column;
  }

  .posting-container .form-group-imeta button {
    width: 100%;
  }

  .container {
    padding: 10px;
  }

  .info-container {
    margin-top: 10px;
  }

  .video-title {
    font-size: 20px;
  }

  .video-description {
    font-size: 14px;
  }

  .video-stats {
    font-size: 12px;
  }

  #second-sidebar,
  .sidebar.collapsed #second-sidebar {
    display: none;
  }

  .advanced-filters-toggle span {
    display: none;
  }
}

@media (max-width: 350px) {
  .logo {
    display: none;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 16px 0;
  }

  header {
    padding: 4px;
    gap: 2px;
  }

  .nav-links {
    gap: 2px;
  }

  #profile-link {
    margin-right: 1px;
  }

  #profile-link img {
    border-radius: 50%;
  }

  .nav-links a,
  .nav-links button {
    margin: 0;
    padding: 8px;
  }

  .drawer-toggle {
    margin: 0;
  }

  .drawer {
    padding: 4px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 16px;
  }



  .sidebar-item {
    padding: 4px;
    min-width: 40px;
    margin: 2px;
  }

  #toggleTheme,
  #colorPicker {
    display: none;
  }
}

@media (min-width: 770px) {
  .sidebar-item[data-id="profile"] {
    display: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/*****************************************************/
.break-words {
  overflow-wrap: break-word;
  word-break: break-word;
}

.truncate {
  white-space: nowrap;
  font-size: min(1em, 100%);
  max-width: 100%;
}

/* Multi-line truncation (e.g., 3 lines) */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.offline-container,
.offline-item {
  margin: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.update-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px;
  background-color: var(--background);
  color: var(--text);
  border-radius: 6px;
  z-index: 9999;
  box-shadow: 0 0 0 2px var(--primary);
  width: 80%;
  max-width: 400px;
  text-align: center;
}

.update-notification p {
  margin: 0 0 10px 0;
}

.update-notification button {
  padding: 5px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--primary);
  border-radius: 3px;
  cursor: pointer;
}

.app-version {
  margin-left: 8px;
  padding: 4px;
  gap: 8px;
  color: var(--text-secondary);
}

.app-version .item-text {
  margin: 2px;
  padding: 2px;
  text-align: center;
}

/***********************************************************/
/************************************************/
/*********************************************************/

.lightning-btn {
  display: none;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  /* display: flex; */
  align-items: center;
  justify-content: center;
}

.donation .lightning-btn {
  display: block;
}

.lightning-icon {
  width: 100px;
  height: 100px;
}

.lightning-path {
  stroke: #000;
  stroke-width: 3;
  fill: #ffd800;
}

#profile-info .lightning-btn {
  width: 36px;
  height: 36px;
}

@keyframes zap {
  0% {
    fill: #ffd800;
    filter: drop-shadow(0px 0px 0px rgba(255, 255, 0, 0));
  }
  20% {
    fill: #ffffff;
    filter: drop-shadow(0px 0px 10px rgba(255, 255, 0, 0.8));
    stroke-width: 4;
  }
  40% {
    fill: #ffff00;
    filter: drop-shadow(0px 0px 15px rgba(255, 216, 0, 0.9));
  }
  60% {
    fill: #ffffff;
    filter: drop-shadow(0px 0px 12px rgba(255, 216, 0, 0.7));
    stroke-width: 3.5;
  }
  80% {
    fill: #ffee00;
    filter: drop-shadow(0px 0px 8px rgba(255, 216, 0, 0.5));
  }
  100% {
    fill: #ffd800;
    filter: drop-shadow(0px 0px 0px rgba(255, 255, 0, 0));
  }
}

.zap-animation {
  animation: zap 1.2s ease-out;
}

/************************************/
/******************************************************/
/* Drawer Overlay - STARTS COMPLETELY HIDDEN */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Drawer Panel - STARTS OFF-SCREEN */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100%;
  background-color: var(--background);
  box-shadow: 2px 0 5px var(--primary);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;
}

.drawer-overlay.open .drawer {
  transform: translateX(0);
}

.drawer-logo-n-btn {
  padding: 8px;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: nowrap;
}

@media (max-width: 480px) {
  .drawer-logo-n-btn {
    justify-content: flex-start;
  }
}

.drawer-logo {
  text-decoration: none;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.drawer-logo span {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
}

.drawer-logo svg {
  border-radius: 8px;
  margin: 0;
  padding: 0;
}

.drawer-logo svg rect {
  fill: var(--primary);
}

.drawer-logo svg polygon {
  fill: var(--background);
}

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

/* Drawer specific styles */
.drawer-close-btn {
  background: var(--background);
  border: 1px solid var(--background);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  padding: 10px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.drawer-close-btn:hover {
  border: 1px solid var(--primary);
}

.drawer-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

/* Enhanced drawer content styling */
.drawer-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.drawer-relay-selector {
  padding: 12px 16px;
}

.relay-set-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.relay-set-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--background);
}

.relay-set-select option {
  padding: 8px;
}

.drawer-menu {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* Custom scrollbar for webkit browsers */
.drawer-menu::-webkit-scrollbar {
  width: 6px;
}

.drawer-menu::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-menu::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.drawer-menu::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

.drawer-section {
  margin-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 16px;
}

.drawer-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.drawer-section-content {
  margin-bottom: 0;
}

.drawer-section-title {
  font-weight: 600;
  color: #666;
  margin-bottom: 12px;
  padding: 0 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drawer-section-title.collapsible-title {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.drawer-section-title.collapsible-title::after {
  content: "▼";
  position: absolute;
  right: 16px;
  transition: transform 0.2s ease;
  font-size: 10px;
}

.drawer-section-title.collapsible-title.collapsed::after {
  transform: rotate(-90deg);
}

.drawer-section-title.collapsible-title:hover {
  color: var(--primary);
}

.drawer-items-container {
  transition: all 0.2s ease;
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: start;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid var(--background);
  border-radius: 6px;
  margin: 1px 8px;
  transition: all 0.2s ease;
  position: relative;
}

.drawer-item[data-id="no-favorites"] {
  opacity: 0.6;
  cursor: default;
}

.drawer-item[data-id="no-favorites"]:hover {
  background: none;
}

.drawer-item:hover {
  border: 1px solid var(--primary);
}

.drawer-item.active {
  border: 1px solid var(--primary);
}

/* Left side content */
.drawer-item > div:first-child,
.drawer-item > span:first-child ~ span {
  display: flex;
  align-items: center;
  flex: 1;
}

.drawer-icon {
  margin-right: 12px;
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.drawer-text {
  font-size: 14px;
  font-weight: 400;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right side indicators */
.drawer-count {
  font-size: 11px;
  background-color: var(--surface);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  flex-shrink: 0;
}

.drawer-activity {
  color: #4caf50;
  font-size: 12px;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Different item type styles */
.drawer-channel {
  font-size: 13px;
}

.drawer-channel .drawer-icon {
  color: #888;
  font-weight: bold;
}

.drawer-tag .drawer-count {
  background-color: var(--surface);
  color: #f57c00;
}

.drawer-group .drawer-count {
  background-color: var(--surface);
  color: #2e7d32;
}

/* Active states for different types */
.drawer-item.active.drawer-channel {
  background-color: var(--surface);
  color: #2e7d32;
}

.drawer-item.active.drawer-tag {
  background-color: var(--surface);
  color: #f57c00;
}

.drawer-item.active.drawer-group {
  background-color: var(--surface);
  color: #7b1fa2;
}

@media (max-width: 769px) {
  .drawer {
    width: 280px;
  }
}

/******************************************************/
/* Base explorer styles */
.nostr-explorer {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  color: var(--text);
  word-break: break-all;
}

/* Typography */
.nostr-explorer h1 {
  color: var(--text);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

.nostr-explorer h3 {
  color: var(--text-secondary);
  margin: 0 0 15px 0;
}

/* Card-like containers */
.nostr-explorer .config-form,
.nostr-explorer #relay-dashboard,
.nostr-explorer .event-display {
  background-color: var(--surface);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Simplified details/summary */
.nostr-explorer details {
  background-color: var(--surface);
  border-radius: 4px;
  padding: 0 15px;
  margin-bottom: 15px;
  overflow-x: scroll;
}

.nostr-explorer details[open] {
  padding-bottom: 15px;
}

.nostr-explorer details summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 0;
  margin-bottom: 8px;
  position: relative;
  display: flex;
  align-items: center;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.nostr-explorer details summary::-webkit-details-marker {
  display: none;
}

.nostr-explorer details summary::after {
  content: "▼";
  position: absolute;
  right: 0;
  color: var(--text-secondary);
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

.nostr-explorer details[open] summary::after {
  transform: rotate(180deg);
}

.nostr-explorer details summary h3 {
  margin: 0;
  flex-grow: 1;
  color: var(--text-secondary);
}

.nostr-explorer details summary:hover h3,
.nostr-explorer details summary:hover::after {
  color: var(--text);
}

/* Form elements */
.nostr-explorer .form-group {
  margin-bottom: 15px;
}

.nostr-explorer label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.nostr-explorer input[type="text"],
.nostr-explorer input[type="number"],
.nostr-explorer select,
.nostr-explorer textarea {
  background-color: var(--background);
  color: var(--text);
  width: 90%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}

.nostr-explorer input:focus,
.nostr-explorer select:focus,
.nostr-explorer textarea:focus {
  border-color: var(--primary);
  outline: none;
}

.nostr-explorer textarea {
  font-family: monospace;
  min-height: 100px;
}

.nostr-explorer small {
  color: var(--text);
  font-size: 0.85em;
  display: block;
  margin-top: 4px;
}

.nostr-explorer button {
  background-color: var(--text);
  color: var(--background);
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-right: 10px;
  transition: background-color 0.2s;
}

.nostr-explorer button:hover {
  background-color: var(--primary);
}

.nostr-explorer button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

/* Conditional sections with subtle left border accent */
.nostr-explorer .conditional-section {
  margin-top: 15px;
  padding: 15px;
  background-color: var(--surface);
  border-radius: 4px;
  border-left: 3px solid var(--primary);
}

/* Dashboard and stats */
.nostr-explorer .dashboard-stats {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.nostr-explorer .stat-item {
  background-color: var(--background);
  padding: 10px 15px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.nostr-explorer .stat-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 5px;
}

/* Event content */
.nostr-explorer .event-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
  font-size: 16px;
}

.nostr-explorer .event-meta {
  font-size: 0.85em;
  color: var(--text-secondary);
}

.nostr-explorer .event-content {
  margin-top: 10px;
}

.nostr-explorer .content-preview {
  margin-bottom: 10px;
  white-space: pre-line;
}

/* Nested details in content - simplified */
.nostr-explorer .content-preview details {
  margin-top: 10px;
  background-color: var(--background);
  border-radius: 4px;
  padding: 10px;
}

.nostr-explorer .content-preview summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

.nostr-explorer .content-preview pre {
  background-color: var(--surface);
  padding: 10px;
  border-radius: 4px;
  font-size: 0.85em;
  margin: 10px 0 0 0;
}

/* Status messages */
.nostr-explorer .loading-summary {
  padding: 10px;
  background-color: var(--surface);
  border-radius: 4px;
  margin-bottom: 15px;
  color: #2e7d32;
  border-left: 3px solid #2e7d32;
}

.nostr-explorer .error-display {
  padding: 10px;
  background-color: var(--surface);
  border-radius: 4px;
  margin-bottom: 15px;
  color: #d32f2f;
  border-left: 3px solid #d32f2f;
}

/* Relay status items */
.nostr-explorer .relay-status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: var(--background);
  border-radius: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.nostr-explorer .relay-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nostr-explorer .relay-url {
  font-weight: 500;
  color: var(--text);
}

.nostr-explorer .relay-status {
  font-size: 0.85em;
}

.nostr-explorer .relay-status.connected {
  color: #2e7d32;
}

.nostr-explorer .relay-status.disconnected {
  color: #d32f2f;
}

.nostr-explorer .relay-status.error {
  color: #f57c00;
}

.nostr-explorer .relay-status.connecting {
  color: var(--text-secondary);
}

.nostr-explorer .relay-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85em;
}

.nostr-explorer .connection-indicator {
  font-size: 1.2em;
}

noscript {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f2f2f2;
}

.noscript-content {
  text-align: center;
  padding: 40px;
  height: 100vh;
}

.noscript-content h2 {
  color: #777777;
}

.noscript-content p {
  font-size: 16px;
}

.tagPage-title {
  margin: 0;
  padding: 0;
  color: var(--primary);
}
.tag-title-label {
  color: var(--text-secondary);
  margin: 0;
  margin-top: 8px;
}
/* Tag Filter Form Styles */
.tag-filter-form {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.tag-filter-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tag-filter-controls label {
  font-weight: bold;
}

#tag-input {
  flex: 1;
  min-width: 300px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

#filter-btn {
  padding: 8px 16px;
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--primary);
  border-radius: 4px;
  cursor: pointer;
}



/* Enhanced chip section header */
.chip-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.chip-section-header:hover {
  background-color: var(--surface);
}

.chip-section-header h3 {
  margin: 0;
  pointer-events: none; /* Prevent text selection issues */
}

.toggle-tags-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  pointer-events: none; /* Let the parent handle clicks */
}

.toggle-tags-btn:hover {
  background-color: transparent;
}

.chevron-icon {
  transition: transform 0.2s ease;
}

.toggle-tags-btn.collapsed .chevron-icon {
  transform: rotate(-90deg);
}

.chip-grid-container {
  margin: 4px;
  transition: height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
}
/* Ensure selected chips are visible when collapsed */
.selected-chips-container {
  display: block;
}

/* Optional: Add subtle visual feedback for collapsed state */
.chip-section.collapsed {
  opacity: 0.9;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, auto));
  gap: 8px;
  padding: 8px 0;
}

.chip-grid .chip {
  display: flex;
  padding: 8px;
  margin: 2px;
  gap: 4px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: auto;
}

.chip-grid .chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Additional styles for tag page */
.add-tag-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.add-tag-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

#custom-tag-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background-color: var(--background);
  color: var(--text);
  font-size: 14px;
}

#custom-tag-input:focus {
  outline: none;
  border-color: var(--primary);
}

.add-tag-button {
  padding: 8px 16px;
  background-color: var(--primary);
  color: #000;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.add-tag-button:hover {
  opacity: 0.8;
}

.remove-tag {
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: var(--background);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.remove-tag:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-tags-btn {
  margin: 4px;
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}

.edit-tags-btn.active,
.edit-tags-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--primary);
}

.remove-tag {
  margin-left: 4px;
  color: #dc3545;
  font-weight: bold;
}
/*************************/

/* Universal Modal Extensions */
.universal-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--surface);
  z-index: 1000;
}

.universal-modal-content {
  background-color: var(--surface);
  margin: auto;
  padding: 20px;
  border-radius: 5px;
  width: 300px;
  max-width: 80%;
}

/* Size variants */
.modal-small .universal-modal-content {
  width: 250px;
}

.modal-medium .universal-modal-content {
  width: 300px;
}

.modal-large .universal-modal-content {
  width: 500px;
}

.modal-fullscreen .universal-modal-content {
  width: 90%;
  height: 80%;
  margin: 5% auto;
  overflow-y: auto;
}

.qr-modal-inner .input-container {
  margin-bottom: 20px;
}

.qr-modal-inner .input-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--text);
}

.qr-modal-inner .input-container input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.qr-modal-inner .input-container button {
  padding: 8px 16px;
  background: var(--primary);
  color: var(--text);
  border: 1px solid var(--primary);
  border-radius: 4px;
  cursor: pointer;
}

/* Confirm Modal styling */
.confirm-modal-inner {
  text-align: center;
}

.confirm-message {
  margin-bottom: 20px;
  color: var(--text);
  font-size: 1.1em;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-actions button {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}

.confirm-actions button:hover {
  border-color: var(--primary);
}

.confirm-actions button.danger {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}

.confirm-actions button.danger:hover {
  background: #c82333;
}

.modal-title {
  color: var(--text);
  margin-bottom: 15px;
  text-align: center;
}

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

@media (max-width: 769px) {
  .modal-large .universal-modal-content,
  .modal-medium .universal-modal-content,
  .modal-small .universal-modal-content {
    width: 90%;
    margin: 10% auto;
  }

  .modal-fullscreen .universal-modal-content {
    width: 95%;
    height: 85%;
    margin: 2.5% auto;
  }
}

/**************************************/
/***********local follows**************/

.profiles-listview .profile-card {
  display: flex;
  align-items: center;
  padding: 16px;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.profiles-listview .profile-card:hover {
  background-color: var(--surface);
}

.profiles-listview .profile-avatar img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 16px;
}

.profiles-listview .profile-details {
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  height: auto;
  gap: 8px;
}

.profiles-listview .profile-name {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: bold;
}

.profiles-listview .profile-username {
  margin: 0 0 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.profiles-listview .profile-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.profiles-listview .nip05-badge {
  color: var(--primary);
}

.profiles-listview .profile-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.profiles-listview .profile-actions {
  margin-left: 16px;
}

.unfollow-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}

.unfollow-btn:hover {
  background-color: var(--danger);
  color: white;
}

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

.following-actions {
  display: flex;
  gap: 12px;
}

.following-actions button {
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}

/************************************************/
.follows-feed-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.follows-feed-header-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 4px;
  margin: 4px;
  font-size: small;
}

.follows-feed-header h2 {
  white-space: wrap; /* Default: keep in one line */
}

.sort-controls {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin: 4px;
  padding: 4px;
}

#stop-query-btn {
  padding: 8px;
  margin: 8px;
  width: 150px;
  background-color: var(--background);
  color: var(--text);
  border: 1px solid rgba(139, 42, 42, 0.829);
  border-radius: 4px;
  cursor: pointer;
}

#stop-query-btn:hover {
  background-color: var(--surface);
}

#apply-options-btn {
  background-color: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  margin: 8px;
  cursor: pointer;
}

#apply-options-btn:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

@media (max-width: 600px) {
  /* Adjust the width as needed */
  .follows-feed-header h2 {
    white-space: normal;
    word-break: normal;
    text-align: center;
  }

  .sort-controls {
    flex-direction: column;

    gap: 8px;
  }
  .follows-feed-header .sort-controls label {
    display: none;
  }
}

.follows-feed-header .sort-controls label {
  /* display: none; */
  font-weight: bold;
}

.sort-controls select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.favorite-toggle-btn {
  background: none;
  border: none;
  font-size: 2em;
  cursor: pointer;
  color: var(--text);
  margin: 8px;
  padding: 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.favorite-toggle-btn:hover {
  background: var(--surface);
}

.favorite-toggle-btn.favorited {
  color: var(--primary);
}

.following-actions {
  display: flex;
  gap: 10px;
}

.follows-feed-btn {
  background: var(--background);
  color: var(--text);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.follows-feed-btn:hover {
  background: var(--surface);
}

@media (max-width: 769px) {
  .following-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .profiles-listview .profile-card {
    flex-direction: column;
    text-align: center;
  }

  .profiles-listview .profile-meta {
    justify-content: center;
  }

  .following-actions {
    align-self: stretch;
  }

  .unfollow-btn {
    width: 100%;
  }
}

/*************************************/
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-info,
.btn-small {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: var(--background);
  color: var(--text);
}

.btn-primary:hover {
  border-color: var(--surface);
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.btn-secondary {
  background-color: var(--background);
  color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-info {
  background-color: var(--background);
  color: var(--text);
}

.btn-info:hover {
  background-color: var(--surface);
  border-color: var(--primary);
}

.btn-small {
  padding: 8px 8px;
  font-size: 12px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--background);
  padding: 20px;
  border-radius: 8px;
  min-width: 300px;
  max-width: 500px;
}

.relay-info-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

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

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

.close-btn:hover {
  color: #333;
}

.modal-content h3 {
  margin: 0 0 15px 0;
  color: var(--text);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Network Settings Page Styles */

.network-container-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
}

.network-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2px;
  width: 98%;
}

.network-container h1 {
  color: var(--text);
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
}

.network-container h2 {
  margin-bottom: 15px;
  font-size: 1.2em;
}

.active-set-title {
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-weight: 900;
  font-size: xx-large;
}

.share-relay-set-modal .set-preview {
  margin-bottom: 20px;
}

.relay-list-preview {
  background: var(--background);
  padding: 10px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.share-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.add-relay-section {
  background: var(--background);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.add-relay-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.relay-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}

.relay-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--text-secondary);
}

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

#activeSetName {
  font-size: x-large;
}

.active-relay-section {
  background: var(--surface);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 2px solid var(--border);
}

.active-relay-section h2 {
  color: var(--primary);
}

.import-relay-section {
  margin: 8px;
}

/* Base relay list styles */
.relay-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

/* Main relay item container */
.relay-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s ease;
}



/* Relay header section */
.relay-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
  color: var(--text);
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 12px;
}




.relay-main-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  width: 99%;
  max-width: 600px;
}

.relay-identity {
  display: flex;
 background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
  width: inherit;
  gap: 12px;
  margin: 2px;
  padding: 2px;
  flex: 1;
  min-width: 0; /* Allow text truncation */
  border-bottom: 1px solid var(--border);
}

.relay-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  
  flex-shrink: 0;
}

.relay-text-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0; /* Allow text truncation */
}

.relay-name {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relay-url {
  font-size: 0.85em;
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relay-description {
  color: var(--text);
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0;
}

/* Status indicators */
.relay-status {

  width: 99%;
  max-width: 600px;

}

.status-checking {
  color: #fbbf24;
}

.status-checking::after {
  content: "...";
  animation: ellipsis 1.5s infinite;
}

.status-online {
  color: #22c55e;
}

.status-offline {
  color: #ef4444;
}

.status-warning {
  color: #f59e0b;
}

@keyframes ellipsis {
  0%, 33% { content: "..."; }
  34%, 66% { content: ""; }
  67%, 100% { content: "..."; }
}

/* Badges */
.relay-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75em;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge-info {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Action buttons */
.relay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-width: 0;
}

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

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

.btn-primary:hover {
  background: var(--primary);
  opacity: 0.9;
}



.btn-danger {
  border-color: #ef4444;
  color: #ef4444;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn svg {
  flex-shrink: 0;
}

/* Status detailed view */
.status-detailed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 8px;
}

.relay-info-header.compact {
  display: none;
  background: var(--background);
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.relay-info-header.compact .relay-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.relay-info-header.compact .relay-description {
  color: var(--text);
  line-height: 1.4;
  font-size: 0.9em;
}

.relay-info-header.compact .relay-additional-info {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-top: 8px;
}

.technical-analysis {
  padding: 16px;
}

.analysis-header {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.analysis-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--background);
  border-radius: 6px;
  font-size: 0.85em;
}

.analysis-item.error {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

.item-label {
  color: var(--text);
  font-weight: 500;
}

.item-value {
  font-weight: 600;
  color: var(--text);
}

/* Utility classes for status values */
.status-yes { color: #22c55e; }
.status-no { color: #6b7280; }
.speed-fast { color: #22c55e; }
.speed-medium { color: #eab308; }
.speed-slow { color: #f97316; }
.speed-very-slow { color: #ef4444; }

/* Empty state */
.no-relays {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 40px 20px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

/* Responsive design */
@media (max-width: 768px) {
  .relay-item {
    padding: 8px;
  }
  

  
  .relay-icon {
    width: 40px;
    height: 40px;
  }
  
  .relay-name {
    font-size: 1em;
  }

}

@media (max-width: 600px) {
  .relay-actions {
    padding: 12px;
  }
  
  .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }
  

}

@media (max-width: 480px) {
  .btn span {
    display: none; /* Show only icons on very small screens */
  }
  
  .btn {
    padding: 10px;
    min-width: 44px; /* Minimum touch target */
    justify-content: center;
  }
  
  .relay-identity {
    gap: 8px;
  }
  

}


/***/

.relay-actions {
  display: flex;
  margin: 4px;
  padding: 4px;
  background-color: transparent;
  border: none;
  border-radius: 4px;
  gap: 5px;
}

.no-relays {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
}

.all-sets-section {
  background: var(--background);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.relay-sets-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.relay-set-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 15px;
  transition: box-shadow 0.2s;
}

.relay-set-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.relay-set-card.active-set {
  border-color: var(--primary);
  background: var(--background);
}

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

.set-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.1em;
}

.relay-count {
  background: var(--surface);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px;
}

.relay-info-body pre {
  background: var(--background);
  padding: 15px;
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.4;
}

.global-set .set-summary {
  background-color: var(--background);
  border-left: 4px solid var(--primary);
}

.global-set .set-info h4::before {
  content: "🌐 ";
}

.relay-url {
  display: flex;
  align-items: center;
}

.relay-icon {
  /*  display: none; */
  margin-right: 8px;
  width: 50px;
  height: 50px;
  border-radius: 2px;
  object-fit: contain;
}

/***********/

/* Tab Navigation */
.network-tab-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: start;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}

.relay-set-discovery-btn {
  margin: 4px;
  margin-top: 8px;
  padding: 16px;
  color: var(--text);
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: medium;
  width: 90%;
  max-width: 800px;
}

.relay-set-discovery-btn:hover {
  background-color: var(--surface);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.network-tab-button {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.network-tab-button:hover {
  background: var(--surface);
}

.network-tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: bold;
}

/* Tab Content */
.network-tab-content {
  display: none;
}

.network-tab-content.active {
  display: block;
}

/* Active Set Tab */
.active-set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  margin-top: 8px;
  padding: 8px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.set-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.set-selector label {
  display: none;
}
.set-dropdown {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
  min-width: 200px;
}

.set-dropdown:focus {
  outline: none;
  border-color: var(--primary);
}

.active-relay-list h3,
.add-relay-section h3,
.import-relay-section h3 {
  margin-bottom: 10px;
  color: var(--text);
}

.add-relay-section,
.import-relay-section {
  background: var(--background);
  padding: 15px;
  border-radius: 8px;
  margin: 8px;
  border: 1px solid var(--border);
}

.active-relay-list {
  background: var(--surface);
  border-radius: 8px;
}

.active-relay-list .relay-item {
  border: none;
  margin: 4px;
}


/* All Sets Tab */
.all-sets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.relay-sets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.relay-set-details {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  justify-content: center;
  align-items: center;
}

.relay-set-details.active-set {
  border-color: var(--primary);
  background: var(--surface);
}

.set-summary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  user-select: none;
}

.set-summary:hover {
  background: var(--surface);
}

.set-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.set-info h4 {
  margin: 0;
  color: var(--text);
}

.relay-count {
  background: var(--surface);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.set-relays {
  padding: 0 15px 15px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.relay-url-item {
  padding: 8px 12px;
  margin: 8px 0;
  background: var(--background);
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
}

.no-relays {
  padding: 15px;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

@media (max-width: 769px) {
  .active-set-header {
    flex-direction: column;
    gap: 4px;
  }

  .set-selector {
    width: 100%;
  }

  .set-dropdown {
    flex: 1;
  }

  .all-sets-header {
    flex-direction: column;
    gap: 10px;
  }
}

/* Create Set Tab */
.create-set-container {
  max-width: 600px;
}

.create-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.create-option {
  background: var(--background);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.create-option h4 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 1.1em;
}

.create-option p {
  margin: 0 0 15px 0;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.create-empty-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.create-empty-form .relay-input {
  flex: 1;
  max-width: 300px;
}

.import-form {
  display: flex;
  align-items: center;
}

@media (max-width: 769px) {
  .create-empty-form {
    flex-direction: column;
    align-items: stretch;
  }

  .create-empty-form .relay-input {
    max-width: none;
  }

  .create-options {
    gap: 15px;
  }

  .create-option {
    padding: 15px;
  }
}

.create-set-container {
  max-width: 600px;
  margin: 0 auto;
}

.create-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.create-option {
  background: var(--background);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.create-option h4 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 1.1em;
}

.create-option p {
  margin: 0 0 15px 0;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.create-empty-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.create-empty-form .relay-input {
  flex: 1;
  max-width: 300px;
}

.import-form {
  display: flex;
  align-items: center;
}

@media (max-width: 769px) {
  .create-empty-form {
    flex-direction: column;
    align-items: stretch;
  }

  .create-empty-form .relay-input {
    max-width: none;
  }

  .create-options {
    gap: 15px;
  }

  .create-option {
    padding: 15px;
  }
}
/*******************************/
/************************/
/*****single relay*******/
.single-relay-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.single-relay-page-header h1 {
  color: var(--primary);
  margin: 0;
}

.relay-input-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.relay-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
}

.relay-input:focus {
  outline: none;
  border-color: var(--primary);
}

.connect-btn {
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.connect-btn:hover {
  background: var(--surface);
  border: 1px solid var(--primary);
}

.connect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--text-secondary);
  color: var(--surface);
}



.current-relay-section {
  margin-bottom: 16px;
}


.relay-actions {
  display: flex;
  gap: 10px;
}

.relay-set-selector-modal .set-list {
  max-height: 200px;
  overflow-y: auto;
}

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

.set-item:not(.already-added):hover {
  background-color: var(--surface);
}

.set-item.already-added {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--border);
}

.set-name {
  font-weight: 500;
}

.set-count {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.already-added-indicator {
  color: var(--accent);
  font-size: 0.9em;
  font-weight: 500;
}

.create-set-section {
  margin-top: 20px;
}

.create-set-form .form-input {
  width: 100%;
  margin-bottom: 12px;
}

.copy-relay-btn,
.add-to-set-btn,
.block-relay-btn.unblocked,
.block-relay-btn {
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.copy-relay-btn:hover,
.add-to-set-btn:hover {
  background: var(--surface);
}

.copy-relay-btn.copied {
  background: var(--primary);
  color: white;
}

.block-relay-btn.blocked {
  background-color: #dc354698;
  color: var(--text);
  border: 1px solid black;
}


.block-relay-btn.blocked:hover {
  background-color: var(--surface);

}

.block-relay-btn.unblocked:hover {
  background-color: #dc354698;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-content h2 {
  color: var(--text);
  margin-bottom: 16px;
}

.empty-state-content p {
  margin-bottom: 32px;
  font-size: 16px;
}

.example-relays h3 {
  color: var(--text);
  margin-bottom: 16px;
  font-size: 18px;
}

.example-relay-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 8px 16px;
  margin: 4px;
  border-radius: 4px;
  cursor: pointer;
  font-family: monospace;
  font-size: 14px;
  transition: all 0.2s;
}

.example-relay-btn:hover {
  background: var(--primary);
  color: white;
}

.relay-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}

.relay-info.no-info {
  padding: 16px;
  text-align: center;
}

.relay-info.no-info h3 {
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.relay-info.no-info p {
  color: var(--text-secondary);
  margin: 0;
}

.relay-info-header {
  padding: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  user-select: none;
  transition: background-color 0.2s;
}

.relay-info-header:hover {
  background: var(--background);
}

.relay-info-header.expanded {
  background: var(--background);
}

.relay-info-collapsed {
  flex: 1;
}

/* Icon styles */
.relay-name-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.relay-icon {

  border-radius: 3px;
  flex-shrink: 0;
  object-fit: cover;
}

.relay-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.operator-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin: 1em 0;
  box-shadow: 0 0 0 1px var(--border);
}

.operator-container:hover {
  box-shadow: 0 0 0 1px var(--primary);
}

.operator-label {
  font-weight: bold;
}

.relay-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

.relay-description {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.relay-nips {
  font-size: 14px;
  color: var(--text-secondary);
}

.expand-icon {
  font-size: 12px;
  color: var(--primary);
  margin-left: 16px;
}

.relay-info-expanded {
  padding: 0 16px 16px 16px;
}

.info-section {
  margin: 8px;
}

.info-section h4 {
  margin: 0 0 12px 0;
  color: var(--primary);
  font-size: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.info-field {
  display: flex;
  margin-bottom: 8px;
  align-items: flex-start;
}

.field-label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 140px;
  flex-shrink: 0;
}

.field-value {
  color: var(--text);
  word-break: break-word;
}

.field-value a {
  color: var(--primary);
  text-decoration: none;
}

.field-value a:hover {
  text-decoration: underline;
}

.nips-list {
  font-family: monospace;
  font-size: 13px;
}

.raw-json-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 20px;
}

.json-display {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
}

.no-content {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.error-message {
  background: var(--surface);
  border: 1px solid var(--border);
  color: #c33;
  padding: 16px;
  border-radius: 4px;
  margin: 16px 0;
}

.back-button {
  display: flex;
  align-items: center;
  background-color: var(--background);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.back-button:hover {
  background-color: var(--surface);
}

@media (max-width: 769px) {
  .input-group {
    flex-direction: column;
  }

  .relay-input {
    width: 100%;
  }

  .connect-btn {
    width: 100%;
  }



  .operator-container {
    justify-content: center;
  }

  .copy-relay-btn,
  .add-to-set-btn,
  .block-relay-btn {
    width: 100%;
  }

  .single-relay-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
/*************************************************************/

/* Loading and Error States */
.loading-indicator,
.error-message {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state h1 {
  margin-bottom: 1rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--background);
  color: var(--text);
}

.btn-primary:hover {
  background: var(--surface);
}

.btn-secondary {
  background: var(--background);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface);
}

.btn-danger {
  background: var(--background);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger:hover {
  background: darkred;
}
/*****************************************/
/* Playlists Grid */
.playlists-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem;
  gap: 1rem;
}

.playlists-header h1 {
  margin: 0;
}

.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.playlists-grid .playlist-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: fit-content;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  margin: 8px;
}

.playlists-grid .playlist-card:hover {
  box-shadow: 0 0 0 1px var(--primary);
}

.playlists-grid .playlist-thumbnail {
  width: 100%;
  height: 160px;
  position: relative;
  overflow: hidden;
}

.playlists-grid .playlist-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlists-grid .no-thumbnail {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  font-size: 2rem;
  color: var(--text-secondary);
}

.playlists-grid .playlist-overlay {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.5rem;
  /*   opacity: 0;
  transition: opacity 0.3s ease; */
}

/* .playlists-grid .playlist-card:hover .playlist-overlay {
  opacity: 1;
} */

.playlists-grid .playlist-overlay button {
  background: var(--background);
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.playlists-grid .playlist-overlay button:hover {
  background: var(--surface);
  transform: scale(1.1);
}

.playlists-grid .playlist-overlay .delete-playlist-btn:hover {
  background: var(--error);
  color: var(--text);
}

.playlists-grid .playlist-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.playlists-grid .playlist-info {
  display: flex;
  flex-direction: column;
}

.playlists-grid .playlist-description {
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.playlists-grid .playlist-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Single Playlist Page */
.playlist-header {
  margin-bottom: 2rem;
}

.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.back-btn:hover {
  text-decoration: underline;
}

.playlist-info {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.playlist-info .playlist-thumbnail {
  width: 200px;
  height: 120px;

  border-radius: 8px;
  overflow: hidden;
}

.playlist-info .playlist-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-info .no-thumbnail {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  font-size: 2rem;
  color: var(--text-secondary);
}

.playlist-details {
  flex: 1;
}

.playlist-details h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  line-height: 1.2;
}

.playlist-details .playlist-description {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.playlist-details .playlist-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.playlist-actions {
  display: flex;
  gap: 0.75rem;
}

/* Improved Playlist Video Items */
.playlist-videos {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 800px;
}

.playlist-video-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  transition: all 0.2s ease;
  position: relative;
}

.playlist-video-item:hover {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.playlist-video-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.playlist-video-item.placeholder-video {
  opacity: 0.7;
  cursor: default;
}

/* Drag handle */
.drag-handle {
  flex-shrink: 0;
  width: 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: grab;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.drag-handle:hover {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Video thumbnail */
.playlist-video-item .video-thumbnail {
  flex-shrink: 0;
  width: 160px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist-video-item .video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-video-item .video-thumbnail .no-thumbnail,
.playlist-video-item .placeholder-thumbnail .placeholder-icon {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.playlist-video-item .duration-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Video details */
.playlist-video-item .video-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playlist-video-item .video-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-video-item .video-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  display: none;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-video-item .video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.playlist-video-item .video-meta span {
  display: flex;
  align-items: center;
}

.playlist-video-item .video-tags {
  display: none;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.playlist-video-item .tag {
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
}

.playlist-video-item .tag-more {
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
}

/* Video actions - just remove button */
.playlist-video-item .video-actions {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 0.25rem;
}

.playlist-video-item .remove-video-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.playlist-video-item .remove-video-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Drag and drop indicators */
.drop-indicator {
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin: 2px 0;
  opacity: 0.8;
}

.empty-playlist {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

/* Responsive design */
@media (max-width: 768px) {
  /*   .playlist-info {
    flex-direction: column;
    gap: 1rem;
  } */

  .playlist-info .playlist-thumbnail {
    height: 180px;
  }

  .playlist-details .playlist-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .playlist-actions {
    flex-wrap: wrap;
  }

  .playlist-video-item .video-thumbnail {
    width: 120px;
    height: 68px;
  }

  .playlist-video-item {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .drag-handle {
    width: 16px;
  }
}

/* Form and other existing styles remain the same */
.playlist-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text);
}

.form-input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--background);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input[type="textarea"] {
  resize: vertical;
  min-height: 5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.existing-playlists {
  margin-bottom: 1.5rem;
}

.existing-playlists h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
}

.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-item:hover {
  background: var(--surface);
  border: 1px solid var(--primary);
}

.playlist-name {
  font-weight: 500;
}

.playlist-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  position: relative;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
  z-index: 1;
}

.divider {
  background: var(--background);
  padding: 0 1rem;
  z-index: 2;
  position: relative;
}

.create-playlist-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
}

.create-playlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.create-playlist-form .form-input {
  flex: 1;
}

/****/

/*********************************************************************/
#selected-tags-list {
  min-height: 30px;
  border: 1px solid var(--border);
  padding: 5px;
  background: var(--background);
}

.selected-tag {
  display: inline-block;
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--primary);
  padding: 3px 8px;
  margin: 2px;
  border-radius: 3px;
  font-size: 12px;
}

.selected-tag-remove-btn {
  background: none;
  border: none;
  color: var(--text);
  margin-left: 5px;
  cursor: pointer;
  font-size: 10px;
}

.no-tags-message {
  color: #666;
  font-style: italic;
}

/****************************************************/
/************contact page************************/
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0 auto;
}

.chat-container h1 {
  padding: 4px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.message {
  display: flex;
  flex-direction: column;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 4px;
  transition: box-shadow 0.2s ease;
  max-width: 800px;
  width: 95%;
}

.message:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message nostr-picture::part(img) {
  width: 40px;
  height: 40px;
}


#messages-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  flex: 1;
  padding-bottom: 8px;
  overflow-y: auto;
  background: var(--background);
  scroll-behavior: smooth;
  max-height: 67vh;
  height: 100%;
  width: 100%;
}

/* Message reference styling */
.message-reference {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 0.85em;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.message-reference:hover {
  background: var(--background);
  color: var(--text);
}

.reference-content {
  display: flex;
  align-items: center;
  gap: 4px;
    background-color: transparent;
  color: var(--text-secondary);
}

.reference-content .author-container {
  pointer-events: none;
}

.reference-icon {
  font-size: 1.1em;
  color: var(--text);
}

.reference-text {
  flex: 1;
  word-break: break-word;
}

.reference-author {
  color: var(--text);
  font-weight: bold;
}

.reference-author nostr-picture::part(img) {
  display: none;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px;
  padding: 8px;
  font-size: large;
  border-bottom: 1px solid var(--border);
}

.author-container {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  gap: 8px;
}


.message-timestamp {
  color: var(--text-secondary);
  font-size: 0.7em;
}

.message-content {
  padding: 4px;
  margin-top: 4px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  
}

.message-tags {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 0.85em;
  font-style: italic;
}

.message-footer {
  display: flex;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.message-footer .tab-scroll-container {
  background-color: transparent;
}

.message-footer .video-action-tab-button {
  background-color: transparent;
}

.message-footer .video-action-tab-button:hover {
  background-color: var(--surface);
}

/* Mobile responsiveness */
@media (max-width: 768px) {

.message {
  padding: 8px;
  
}

}


@media (max-width: 480px) {

.message {
  padding: 4px;
  width: 99%;
}

.chat-input-wrapper {
  width: 99%;
}

}


.see-more-section {
  margin-top: 8px;
}

.see-more-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9em;
  padding: 0;
  text-decoration: underline;
}

.see-more-btn:hover {
  color: var(--text);
}

.chat-input-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  border-top: 1px solid var(--border);
  background: var(--background);
  padding: 8px;
  width: 100%;
  height: 19vh;
}

.chat-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: start;
  width: 95%;
  max-width: 800px;
  height: 17vh;
}

#message-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--background);
  color: var(--text);
  resize: none;
  width: inherit;
  height: 7vh;
}

#message-input:focus {
  outline: none;
  border-color: var(--text);
}

#send-button {
  background: var(--text);
  color: var(--background);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.2s ease;
  width: inherit;
  max-width: 400px;
}

#send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#send-button:not(:disabled):hover {
  opacity: 0.9;
}

.chat-input-info {
  margin-top: 8px;
  font-size: 0.8em;
  color: var(--text-secondary);
  text-align: center;
}

.new-messages-indicator {
  position: sticky;
  bottom: 0;
  background: var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  text-align: center;
  border-radius: 8px 8px 0 0;
  margin: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  width: 95%;
  max-width: 800px;
}

.new-messages-indicator.hidden {
  display: none;
}

#scroll-to-bottom-btn {
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

#scroll-to-bottom-btn:hover {
  background: var(--border);
}



.loading-indicator {
  position: relative;
  text-align: center;
}

.loading-indicator::after {
  content: "│";
  animation: radar-spin 1.5s linear infinite;
  display: inline-block;
  color: var(--text);
  transform-origin: center;
}
@keyframes radar-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* .loading-indicator::after {
  content: "...";
  animation: ellipsis 1.5s infinite;
  display: inline-block;
  color: var(--text);
}

@keyframes ellipsis {
  0% { content: "."; }
  33% { content: ".."; }
  66% { content: "..."; }
}
 */
.error-container {
  text-align: center;
  padding: 40px 20px;
  color: var(--text);
}

.message nostr-name {
  color: var(--primary);
}

@media (max-width: 768px) {
  .chat-container {
    min-height: 75vh;
    max-height: 80vh;
  }

  .chat-container h1 {
    flex-shrink: 0;
  }

  #messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 63vh;
  }

  .chat-input-container {
    flex-shrink: 0;
  }

  .message-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
      margin: 4px;
  padding: 4px;
  }

}
.reference-click-to-load .reference-action {
  color: var(--accent);
  font-size: 0.9em;
  background-color: transparent;
}


.fetched-message {
  box-shadow: 0 0 0 3px var(--primary);
  background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
  transition: all 0.3s ease;
}

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


.reference-loading .reference-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  background-color: var(--background);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.reference-clickable {
  background-color: var(--surface);
  border-left: 1px solid var(--primary);
  transition: background-color 0.2s ease;
}

.reference-clickable:hover {
  background-color: var(--background);
  border: 1px solid var(--primary);
  color: var(--text);
}

.reference-not-found {
  font-style: italic;
  background-color: var(--surface);
  color: var(--text-secondary);
}

.reference-not-found:hover {
  background-color: var(--surface);
  color: var(--text-secondary);
}

.copy-ref-id-btn {
  margin: 4px;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.copy-ref-id-btn:hover {
  background: var(--background);
}

.copy-ref-id-btn.copied {
  background: var(--background);
  border-color: var(--primary);
}

.copy-ref-id-btn.copy-error {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.3);
}

.message.highlighted {
  background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
  transition: background-color 0.3s ease;
}


/****chat messages publishing****/
.reply-indicator {
  background: var(--background);
  border-left: 3px solid var(--border);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reply-indicator.hidden {
  display: none;
}

#reply-text {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}

#cancel-reply-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  color: var(--text);
}

#cancel-reply-btn:hover {
  color: var(--text-secondary);
}






/*****************/
#upload-video {
  pointer-events: none;
}

/**********************************/
/**********************************/
/*************MODAL****************/
/**********************************/
/* Universal Modal Styles */
.universal-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.universal-modal-content {
  background-color: var(--surface);
  color: var(--text);
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-small .universal-modal-content {
  width: 300px;
}

.modal-medium .universal-modal-content {
  width: 500px;
}

.modal-large .universal-modal-content {
  width: 800px;
}

.modal-fullscreen .universal-modal-content {
  width: 95%;
  height: 95vh;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 15px;
  gap: 10px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 99vw;
  height: 99vh;
  background: var(--background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.modal-content {
  background-color: var(--background);
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  height: fit-content;
  overflow-y: auto;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.modal-content textarea {
  flex-grow: 1;
  min-height: 200px;
  resize: none;
  background-color: var(--background);
  color: var(--text);
}

.modal-content h4 {
  color: var(--text);
  margin-bottom: 15px;
  border-bottom: 1px solid var(--secondary);
  padding-bottom: 10px;
  flex-shrink: 0;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background-color: var(--surface);
  border: 1px solid var(--primary);
  color: var(--text);
  flex-shrink: 0;
}

.modal-actions button {
  padding: 10px 15px;
  margin-left: 10px;
  border: 1px solid var(--background);
  background-color: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border 0.3s ease;
}

.modal-actions button:hover {
  border: 1px solid var(--primary);
}

.modal-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
  line-height: 1;
}

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


.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.modal-open body {
  overflow: hidden;
}

.qr-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--surface);
  z-index: 1000;
}

.qr-modal-content {
  background-color: var(--surface);
  margin: 15% auto;
  padding: 20px;
  border-radius: 5px;
  width: 300px;
  max-width: 80%;
  text-align: center;
}

.close-modal {
  color: var(--text);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

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

.qr-container {
  background-color: white;
  margin: 20px 0;
}

.qr-container img {
  max-width: 100%;
}

.url-container {
  display: flex;
  margin-top: 15px;
}

.url-container input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
}

.url-container button {
  padding: 8px 12px;
  background-color: var(--background);
  color: var(--text);
  border: 1px solid var(--background);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.url-container button:hover {
  border: 1px solid var(--primary);
}

#relay-info-modal .modal-content {
  max-width: 600px;
  overflow-y: auto;
}

.relay-info {
  font-size: 14px;
  line-height: 1.5;
}

.info-item {
  margin-bottom: 10px;
}

.info-section {
  margin-bottom: 15px;
}

.relay-icon {
  vertical-align: middle;
}

.relay-banner {
  max-width: 100%;
  max-height: 150px;
  margin-top: 5px;
}

#relay-info-modal .loading {
  padding: 20px;
  text-align: center;
  color: var(--text);
}

#relay-info-modal .error {
  padding: 20px;
  text-align: center;
  color: #f44336;
}

.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.modal-open body {
  overflow: hidden;
}

/***********************************/
/* Blob Processing Page Specific Styles */
.blobing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  color: var(--text);
}

.blobing-container * {
  word-break: break-all;
}

.blobing-container h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary);
  text-align: center;
}

/* URL Input Section */
.url-input-section {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.url-input-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.url-input {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.url-input:focus {
  outline: none;
  border-color: var(--border);
}

.progress-message {
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.progress-percentage {
  font-weight: 600;
  color: var(--text);
}

.progress-size {
  color: var(--text);
}

.progress-bar-container {
  width: 100%;
  margin-bottom: 10px;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background-color: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
  position: relative;
}

/* Indeterminate progress bar animation */
.progress-bar.indeterminate .progress-fill {
  width: 30%;
  animation: indeterminate 2s infinite linear;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 50%, var(--primary) 100%);
}

@keyframes indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

.result.loading {
  border-left: 4px solid #2196F3;
  background-color: var(--surface);
}

.result.success {
  border-left: 4px solid #4CAF50;
  background-color: var(--surface);
}

.result.error {
  border-left: 4px solid #f44336;
  background-color: var(--surface);
}

.result {
  padding: 12px 16px;
  border-radius: 4px;
  margin: 10px 0;
}
/* Processing Sections Grid */
.processing-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.blobing-container .section {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.blobing-container .section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.blobing-container .btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background-color 0.2s;
}

.blobing-container .btn:hover:not(:disabled) {
  background-color: var(--surface);
  border: 1px solid var(--primary);
}

.blobing-container .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.blobing-container .btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.workflow-steps {
  max-width: 800px;
  margin: 0 auto;
}

.step {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.step.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.step h2 {
  color: #333;
  margin-bottom: 1rem;
}

.metadata-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.metadata-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metadata-form input,
.metadata-form textarea {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.hash-validation {
  padding: 1rem;
  background: var(--surface);
  border-radius: 4px;
}

.code-block {
  background: var(--surface);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.9rem;
}

.copy-section {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.result-section {
  margin-top: 1rem;
  padding: 1rem;
  background-color: var(--background);
  border-radius: 4px;
  border-left: 4px solid var(--border);
  min-height: 50px;
}

.result-section.success {
  border-left-color: #4caf50;
}

.result-section.error {
  border-left-color: #f44336;
}

.result-section .success {
  color: #4caf50;
}

.result-section .error {
  color: #f44336;
}

.result-section h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.result-section div {
  margin-bottom: 0.3rem;
}

.hash-result {
  font-family: monospace;
  word-break: break-all;
  background-color: var(--surface);
  padding: 0.5rem;
  border-radius: 4px;
}

.analysis-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}

.analysis-section:last-child {
  border-bottom: none;
}

.analysis-section h5 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.video-preview-section {
  margin-top: 1rem;
  background-color: var(--background);
  padding: 1rem;
  border-radius: 4px;
  display: flex;
  justify-content: center;
}

.blobing-container .loading {
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 769px) {
  .blobing-container {
    padding: 1rem;
  }

  .processing-sections {
    grid-template-columns: 1fr;
  }
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid var(--border);
}

.color-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Color assignments */
.color-text {
  background-color: var(--text);
}
.color-text-secondary {
  background-color: var(--text-secondary);
}
.color-background {
  background-color: var(--background);
}
.color-surface {
  background-color: var(--surface);
}
.color-primary {
  background-color: var(--primary);
}
.color-primary-hover {
  background-color: var(--primary-hover);
}
.color-secondary {
  background-color: var(--secondary);
}
.color-secondary-hover {
  background-color: var(--secondary-hover);
}
.color-accent {
  background-color: var(--accent);
}
.color-border {
  background-color: var(--border);
}

/************************************/
/***************relay set discovery page***********************/
/********************************************/
.videos-listview .relay-set-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  border: 2px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--background);
  overflow: hidden;
  padding: 4px;
  width: 100%;
  max-width: 550px;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* .videos-listview .relay-set-card:hover {
  background: var(--surface);
} */

.videos-listview .relay-set-title {
  font-weight: bold;
  font-size: 1.1em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  margin: 0;
  text-align: left;
}

.videos-listview .relay-set-main {
  display: flex;
  flex-direction: column;
  align-items: start;
  padding: 16px;
  width: 100%;
  max-width: 600px;
}

.videos-listview .relay-set-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.videos-listview .publisher-section {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.videos-listview .publisher-section:hover {
  background-color: var(--surface);
}

.videos-listview .publisher-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.videos-listview .publish-time {
  font-size: 12px;
  color: var(--text-secondary, #666);
}

.videos-listview .relay-count {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.videos-listview .relay-count-number {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}

.videos-listview .relay-count-label {
  font-size: 11px;
  color: var(--text-secondary, #666);
  text-transform: uppercase;
}

.videos-listview .relay-urls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: inherit;
}

.videos-listview .relay-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  gap: 8px;
  font-size: large;
}

.videos-listview .relay-item.more-relays {
  justify-content: center;
  font-style: italic;
  color: var(--text-secondary);
}

.videos-listview .relay-item.more-relays.clickable-more {
  justify-content: center;
  font-style: italic;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.videos-listview .relay-item.more-relays.clickable-more:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.videos-listview .relay-item.collapse-relays.clickable-collapse {
  justify-content: center;
  font-style: italic;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.videos-listview .relay-item.collapse-relays.clickable-collapse:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.videos-listview .relay-url {
  font-size: large;
  color: var(--text);
  flex: 1;
  word-break: break-all;
}

.videos-listview .relay-action-btn {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  padding: 24px;
  color: var(--text);
  font-size: larger;
  transition: all 0.2s ease;
}

.videos-listview .relay-action-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.videos-listview .relay-set-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin: 4px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  width: 98%;
}

.videos-listview .show-json-btn,
.videos-listview .import-relay-set-btn {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  transition: all 0.2s ease;
  width: 90%;
}

.videos-listview .show-json-btn:hover,
.videos-listview .import-relay-set-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.videos-listview .relay-set-json {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.videos-listview .relay-set-json.hidden {
  display: none;
}

.videos-listview .json-content {
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 16px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre;
  margin: 0;
  max-height: 400px;
  word-break: break-all;
  word-wrap: break-word;
  box-sizing: border-box;
}

/* Skeleton animations */
.videos-listview .skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.videos-listview .skeleton-name {
  height: 16px;
  width: 120px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 4px;
}

.videos-listview .skeleton-time {
  height: 12px;
  width: 80px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Mobile responsiveness */
@media (max-width: 770px) {
  .videos-listview .relay-set-main {
    padding: 4px;
    width: 100%;
  }

  .videos-listview .relay-set-info {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .videos-listview .publisher-section {
    justify-content: flex-start;
  }

  .videos-listview .relay-count {
    align-self: center;
  }

  .videos-listview .json-content {
    padding: 12px;
    font-size: 11px;
    max-height: 300px;
  }
}

@media (max-width: 480px) {


  .videos-listview .relay-set-title {
    font-size: 1em;
    padding: 10px 12px;
  }

  .videos-listview .json-content {
    padding: 10px;
    font-size: 10px;
    max-height: 250px;
  }

  .videos-listview .relay-url {
    font-size: medium;
  }
}

/* Ensure container doesn't overflow */
.videos-listview {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/* Ensure container doesn't overflow */
.videos-listview {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/************************/
/******kind-1 follows*****/
/* Skeleton loading states */
.profile-item.skeleton {
  opacity: 0.7;
  animation: pulse 1.5s ease-in-out infinite;
}

.profile-item:hover {
  background: var(--surface);
  border: 1px solid var(--primary);
}

.profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.profile-details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.profile-actions {
  flex-shrink: 0;
}

.action-follow-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.action-follow-btn:hover {
  background: var(--surface);
  border: 1px solid var(--primary);
}

.action-follow-btn.following {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--primary);
}

.action-follow-btn.following:hover {
  background: var(--background);
  border: 1px solid var(--border);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.skeleton-name {
  height: 16px;
  width: 120px;
  margin-left: 10px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.4;
  }
}

/*********************/
.validation-status {
  position: relative;
  display: inline;
  cursor: help;
}

.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--surface);
  color: var(--text);
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--border);
}

.validation-status:hover .tooltip,
.validation-status.tooltip-visible .tooltip {
  visibility: visible;
  opacity: 1;
}

/******************************************************/
/***************login modal*************************/
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.login-modal {
  background: var(--background);
  color: var(--text);
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.login-modal h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.login-modal p {
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-buttons button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: 1px solid var(--border);
}

.primary-btn {
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
}

.primary-btn:hover {
  background: var(--surface);
  border: 1px solid var(--primary);
}

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  border: 1px solid var(--primary);
}







/***************************************************/
/* WebSocket Page Styles */
#websocketsPage-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

#websocketsPage-container h1 {
  color: var(--text);
  margin-bottom: 20px;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.stat-item {
  background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
  color: var(--text);
  padding: 20px 15px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border);

}


.stat-value {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Controls */
#controls {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

#controls button {
  padding: 12px 24px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  min-width: 120px;
}

#controls button:hover {
  border-color: var(--primary);

}

#refresh-btn {
  display: none;
  background-color: var(--background);
  border-color: var(--background);
}

#refresh-btn:hover {
  border-color: var(--primary);
}

#clear-closed-btn {
  display: none;
  background-color: var(--text-secondary);
  color: var(--background);
  border-color: var(--accent);
}

#clear-closed-btn:hover {
  opacity: 0.9;
}

/* Tabs */
#tabs-container {
  margin: 30px 0;
}

.tabs-header {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 25px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  padding: 16px 28px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  background-color: var(--surface);
  color: var(--text);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: var(--surface);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Connection Items */
.connection-item {
  border: 1px solid var(--border);
  margin: 20px 0;
  padding: 24px;
  border-radius: 12px;
  background-color: var(--surface);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.connection-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--border);
  transition: background-color 0.3s ease;
}

.connection-item.working::before {
  background-color: #00e676;
}

.connection-item.connecting::before {
  background-color: var(--accent);
}

.connection-item.failed::before {
  background-color: #ff5252;
}

.connection-item.blocked-item::before {
  background-color: #ff5252;
}

.connection-item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.connection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.connection-url {
  font-weight: bold;
  font-size: 24px;
  color: var(--text);
  word-break: break-word;
}

.connection-url.blocked {
  color: #ff5252;
  opacity: 0.9;
}

.connection-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.connection-time {
  background-color: var(--background);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.connection-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--background);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 16px 0;
}

.connection-details small {
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.connection-details strong {
  color: var(--text);
}

.connection-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Action Buttons */
.action-btn {
  background-color: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-btn:hover {
  border: 1px solid var(--primary);
}

.close-all-btn {
  display: none;
  background-color: var(--background);
  border-color: var(--background);
  color: var(--text);
}

.close-all-btn:hover {
  border-color: var(--primary);
}

.block-btn {
  background-color: var(--background);
  border-color: var(--surface);
  color: var(--text);
}

.block-btn:hover {
  border-color: red;
}

.unblock-btn {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.unblock-btn:hover {
  border-color: var(--primary);
}

/* Status Badges */
.status-badge {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.working {
  background-color: var(--text-secondary);
  color: var(--background);
}

.status-badge.connecting {
  background-color: var(--accent);
  color: var(--background);
}

.status-badge.failed {
  background-color: #ff5252;
  color: white;
}

.blocked-badge {
  background-color: #ff5252;
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.connection-count {
  background-color: var(--background);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: bold;
  border: 1px solid var(--border);
}

/* No Connections State */
.no-connections {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  background-color: var(--background);
  border-radius: 12px;
  margin: 30px 0;
  border: 2px dashed var(--border);
}

.no-connections p {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.no-connections small {
  font-size: 14px;
  opacity: 0.8;
}

/* Error States */
.error {
  background-color: #ff5252;
  color: white;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #websocketsPage-container {
    padding: 15px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .stat-item {
    padding: 16px 12px;
  }
  
  .connection-item {
    padding: 20px 16px;
  }
  
  .connection-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .connection-meta {
    width: 100%;
    justify-content: space-between;
  }
  
  .tabs-header {
    margin-bottom: 20px;
  }
  
  .tab-btn {
    padding: 14px 20px;
    font-size: 13px;
  }
  
  #controls {
    flex-direction: column;
  }
  
  #controls button {
    min-width: unset;
  }
  
  .connection-actions {
    flex-direction: column;
  }
  
  .action-btn {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .connection-details {
    padding: 12px;
  }
  
  .connection-details small {
    font-size: 12px;
  }
  
  .connection-url {
    font-size: 14px;
  }
}



/***************************nak****************/
.subscription-dashboard {
  display: flex;
  flex-direction: column;
  
  justify-content: start;
  max-width: 800px;
 
  padding: 20px;
  color: var(--text);
  background-color: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.subscription-dashboard .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.subscription-dashboard .section-header h3 {
  margin: 0;
  font-size: 1.2em;
}

.subscription-dashboard .filter-section, .subscriptions-section, .events-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.subscription-dashboard .collapsible {
  display: block;
}

.subscription-dashboard .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.subscription-dashboard .form-field {
  display: flex;
  flex-direction: column;
}

.subscription-dashboard .form-field label {
  font-size: 12px;
  margin-bottom: 4px;
  font-weight: 600;
}

.subscription-dashboard .form-field input, .form-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.subscription-dashboard .form-field input:focus, .form-field textarea:focus {
  outline: none;
  border-color: #0a84ff;
}

.subscription-dashboard .btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.subscription-dashboard .count-badge {
  background: var(--surface);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.subscription-dashboard .subscription-item {
  background: #252525;
  border: 1px solid #333;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}

.subscription-dashboard .sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
}

.subscription-dashboard .sub-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}



.subscription-dashboard .sub-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;

}

.subscription-dashboard .sub-controls {
  display: flex;
  gap: 8px;
}

.subscription-dashboard .btn-toggle, .btn-close {
  background: none;

  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.subscription-dashboard .btn-close {
  color: #ff3b30;
  border-color: #ff3b30;
}

.subscription-dashboard .sub-details {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.subscription-dashboard .sub-filter {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 12px;
  font-family: monospace;
}

.subscription-dashboard .relay-states {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subscription-dashboard .relay-state {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  background: var(--surface);
  border-radius: 4px;
  font-size: 12px;
}



.subscription-dashboard .relay-status {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}


.subscription-dashboard .events-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.subscription-dashboard .events-container {
  max-height: 600px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 6px;
  padding: 16px;
}

.subscription-dashboard .event-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.subscription-dashboard .event-header {
  margin-bottom: 8px;
}

.subscription-dashboard .event-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.subscription-dashboard .kind-badge, .time-badge, .relay-badge, .sub-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.subscription-dashboard .event-content {
  background: var(--surface);
  padding: 8px;
  border-radius: 4px;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.4;
}

.subscription-dashboard .event-json {
  background: var(--background);
  padding: 8px;
  border-radius: 4px;
  margin: 8px 0;
  font-size: 11px;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-x: auto;
}

.subscription-dashboard .event-details {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text);
  margin-top: 8px;
}

.subscription-dashboard .no-subscriptions, .no-events {
  text-align: center;
  color: var(--text);
  padding: 40px 20px;
  font-style: italic;
}

@media (max-width: 768px) {
  .subscription-dashboard .form-grid {
    grid-template-columns: 1fr;
  }
  
  .subscription-dashboard .sub-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .subscription-dashboard .event-meta {
    flex-direction: column;
    gap: 4px;
  }
}

.subscription-dashboard .relay-state {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  margin: 2px 0;
  border-radius: 4px;
  font-size: 0.85em;
}

.subscription-dashboard .relay-state.relay-connecting {
  border-left: 3px solid #ffc107;
}

.subscription-dashboard .relay-state.relay-connected {
  border-left: 3px solid #0d6efd;
}

.subscription-dashboard .relay-state.relay-error,
.subscription-dashboard .relay-state.relay-timeout {
  border-left: 3px solid #dc3545;
}

.subscription-dashboard .relay-state.relay-closed {
  border-left: 3px solid #6c757d;
}

.subscription-dashboard .relay-url {
  flex: 1;
  overflow: hidden;
}

.subscription-dashboard .relay-status {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8em;
  text-transform: uppercase;
}



.subscription-dashboard .relay-events {
  font-weight: bold;
  min-width: 60px;
  text-align: right;
}

.subscription-dashboard .relay-eose {
  background-color: var(--background);
  color: var(--text);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.75em;
}

.subscription-dashboard .relay-error {
  cursor: help;
}