body.videowall-view .header-bar {
  display: none !important;
}

.videowall-header {
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: #000000 !important;
  text-shadow: none !important;
  padding: 24px 16px 12px;
  letter-spacing: 3px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

body.dark-theme .videowall-header {
  color: #ffffff !important;
  text-shadow: none !important;
}

body.videowall-view:not(.active-videowall-view) .pagination-container {
  display: none !important;
}

body.active-videowall-view .videowall-header {
  display: none !important;
}

body.dark-theme.active-videowall-view {
  background-color: #273542 !important;
}

body.active-videowall-view #devices-grid {
  display: grid;
  grid-template-columns: var(--vw-cols-template, repeat(auto-fill, minmax(0, 1fr)));
  grid-template-rows: var(--vw-rows-template, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  height: calc(100vh - 40px); /* Leave 40px for header */
  gap: 12px;
  padding: 10px 10px 90px 10px; /* 90px bottom padding to clear the absolute pagination */
  box-sizing: border-box;
  overflow-y: auto; /* Allow scrolling if items hit minimum size */
  overflow-x: hidden;
}

body.active-videowall-view .card-header {
  flex-shrink: 0 !important;
}

body.active-videowall-view .card-body {
  flex-shrink: 1 !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
}

body.active-videowall-view .card {
  height: 100% !important;
  min-height: 0;
  min-width: 0;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  overflow: hidden;
}

body.active-videowall-view .video-container {
  flex-grow: 1;
  min-height: 0;
  height: auto;
  aspect-ratio: 16/9;
}

body.active-videowall-view .video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Llenar completamente el contenedor sin mostrar bordes negros */
  background-color: #000;
}

body.videowall-view .scroll-fade-top,
body.videowall-view .scroll-fade-bottom {
  display: none !important;
}

/* Custom items per page dropdown */
.grid-icon {
  display: grid;
  gap: 2px;
  width: 22px;
  height: 16px;
}
.grid-icon span {
  background: currentColor;
  opacity: 0.6;
  border-radius: 1px;
}
.grid-2x1 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.grid-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.grid-4x2 { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; }
.grid-3x3 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; gap: 1px; }

.custom-select-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 8px; 
  background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid var(--border-color); cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.custom-select-trigger:hover { 
  background: var(--bg-hover); 
  border-color: var(--accent);
}
.custom-select-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; cursor: pointer; transition: all 0.2s;
  white-space: nowrap; color: var(--text-primary);
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.custom-select-option:last-child {
  border-bottom: none;
}
.custom-select-option:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.custom-select-option.selected {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}
.custom-select-option.selected .grid-icon span {
  opacity: 1;
}

/* INTERNAL TAB BAR STYLES */
.internal-tab-bar {
  display: flex;
  background: var(--bg-secondary, #1e1e1e);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 10px;
  height: 48px;
  align-items: flex-end;
  gap: 4px;
}

body:not(.dark-theme) .internal-tab-bar {
  background: #f0f2f5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.internal-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  color: var(--text-secondary, #a0a0a0);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  min-width: 150px;
  max-width: 240px;
  position: relative;
  margin-right: 2px;
  flex-shrink: 0;
}

body.dark-theme .internal-tab {
  background: rgba(39, 53, 66, 0.4);
  color: #889bb5;
}

body:not(.dark-theme) .internal-tab {
  background: rgba(0, 0, 0, 0.05);
  color: #666;
}

.internal-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #ffffff);
  z-index: 1;
}

body:not(.dark-theme) .internal-tab:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #333;
}

body.dark-theme .internal-tab.active {
  background: #273542;
  color: #ffffff;
}

.internal-tab.active {
  background: var(--bg-color, #121212);
  color: var(--accent, #0a84ff);
  z-index: 2;
  font-weight: 600;
}

body:not(.dark-theme) .internal-tab.active {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  border-bottom-color: #ffffff;
}

.internal-tab-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.internal-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  opacity: 0.6;
  flex-shrink: 0;
}

.internal-tab-close:hover {
  opacity: 1;
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
}

.tab-content-container {
  width: 100%;
  flex: 1;
  background: #000;
  overflow: hidden;
  display: block; /* Ensure container is displayed properly when shown */
}

.internal-tab-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block; /* Fix inline iframe issues */
}
