/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f0f0f;
  color: #ffffff;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #333;
}

.header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #d3ba17;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: #d3ba17;
  color: #000;
}

.btn-primary:hover {
  background: #b89a14;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #333;
  color: #fff;
  border: 1px solid #555;
}

.btn-secondary:hover {
  background: #444;
  border-color: #666;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-success {
  background: #28a745;
  color: #fff;
}

.btn-success:hover {
  background: #218838;
  transform: translateY(-1px);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 30px;
  background: #222;
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

.tab-btn.active {
  background: #d3ba17;
  color: #000;
}

.tab-btn:hover:not(.active) {
  background: #333;
  color: #fff;
}

/* Tab Content */
.tab-content {
  display: none;
  flex: 1;
}

.tab-content.active {
  display: block;
}

/* Asset Management */
.asset-sections {
  display: grid;
  gap: 30px;
}

.asset-section {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #333;
}

.asset-section h2 {
  margin-bottom: 20px;
  color: #d3ba17;
  font-size: 1.5rem;
}

.upload-area {
  border: 2px dashed #555;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.upload-area:hover {
  border-color: #d3ba17;
  background: rgba(211, 186, 23, 0.05);
}

.upload-area.dragover {
  border-color: #d3ba17;
  background: rgba(211, 186, 23, 0.1);
}

.upload-area input[type="file"] {
  display: none;
}

.upload-area .material-symbols-outlined {
  font-size: 48px;
  color: #888;
  margin-bottom: 12px;
}

.upload-area p {
  color: #888;
  font-size: 16px;
}

/* Asset Grid */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* Sponsor Asset Grid */
.sponsor-asset-grid {
  display: grid;
  /*grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));*/
  gap: 16px;
}

.asset-item {
  background: #222;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #333;
  transition: all 0.2s ease;
}

.asset-item:hover {
  border-color: #d3ba17;
  transform: translateY(-2px);
}

.asset-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 12px;
}

.asset-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.asset-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.asset-actions {
  display: flex;
  gap: 8px;
}

.asset-btn {
  padding: 6px;
  background: #333;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.asset-btn:hover {
  background: #d3ba17;
  color: #000;
}

/* Configuration Forms */
.config-sections {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #333;
}

.json-panel {
  background: #222;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #333;
}

.json-panel h2 {
  color: #d3ba17;
  margin-bottom: 16px;
  font-size: 1.3rem;
}

/* Form Elements */
label {
  display: block;
  margin-bottom: 8px;
  color: #ccc;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: #333;
  border: 1px solid #555;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 16px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d3ba17;
  box-shadow: 0 0 0 2px rgba(211, 186, 23, 0.2);
}

.color-input {
  width: 60px !important;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Collapsible Sections */
.collapsible {
  background: #333;
  color: #fff;
  cursor: pointer;
  padding: 12px 16px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.collapsible:hover {
  background: #444;
}

.collapsible.active {
  background: #d3ba17;
  color: #000;
}

.content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  background: #222;
  border-radius: 6px;
  margin-bottom: 16px;
}

.content.show {
  max-height: 1000px;
  padding: 16px;
  overflow: auto;
}

/* Enhanced Collapsible Sections with Add/Remove */
.collapsible-section {
  margin-bottom: 16px;
}

.collapsible-section .content {
  display: none;
  padding: 12px;
}

.collapsible-section .content.show {
  display: none;
}

.collapsible-section .collapsible {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px 12px;
  text-align: left;
  width: 100%;
  font-weight: bold;
}

.collapsible-section .collapsible:hover {
  background: rgba(255, 255, 255, 0.1);
}

.collapsible-section .collapsible.active {
  background: rgba(211, 186, 23, 0.2);
}

/* Preview */
.preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 600px;
}

.preview-frame {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #333;
}

.preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Tenant Navigation */
.tenant-navigation {
  background: rgba(26, 26, 26, 0.95);
  border-bottom: 1px solid #333;
  padding: 12px 20px;
  margin-bottom: 20px;
}

.navigation-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: #d3ba17;
  color: #000;
  transform: translateY(-1px);
}

.nav-link .material-symbols-outlined {
  font-size: 18px;
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #1a1a1a;
  border-radius: 8px;
  margin-top: 20px;
  border: 1px solid #333;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #888;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
}

.status-indicator.online {
  background: #4caf50;
}

.status-indicator.offline {
  background: #f44336;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .tabs {
    flex-direction: column;
  }

  .preview-container {
    grid-template-columns: 1fr;
    height: 400px;
  }

  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .sponsor-asset-current-img {
    /*grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));*/
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #d3ba17;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  color: #fff;
  font-weight: 500;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.notification.success {
  background: #4caf50;
}

.notification.error {
  background: #f44336;
}

.notification.warning {
  background: #ff9800;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Team Logo Sections */
.team-logo-section {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #1a1a1a;
  transition: all 0.2s ease;
}

.team-logo-section:hover {
  border-color: #d3ba17;
  box-shadow: 0 2px 8px rgba(211, 186, 23, 0.1);
}

.team-logo-section h3 {
  margin: 0 0 12px 0;
  color: #d3ba17;
  font-size: 18px;
  font-weight: 600;
}

.team-logo-section .upload-area {
  border: 2px dashed #555;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #0f0f0f;
}

.team-logo-section .upload-area:hover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

.team-logo-section .upload-area.dragover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

.no-data {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 32px;
}

/* Sponsor Asset Sections */
.sponsor-asset-section {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #1a1a1a;
  transition: all 0.2s ease;
}

.sponsor-asset-section:hover {
  border-color: #d3ba17;
  box-shadow: 0 2px 8px rgba(211, 186, 23, 0.1);
}

.sponsor-asset-section h3 {
  margin: 0 0 12px 0;
  color: #d3ba17;
  font-size: 18px;
  font-weight: 600;
}

.sponsor-asset-section .upload-area {
  border: 2px dashed #555;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #0f0f0f;
}

.sponsor-asset-section .upload-area:hover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

.sponsor-asset-section .upload-area.dragover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

/* Team Logo Section Styles */
.team-logo-section {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #1a1a1a;
  transition: all 0.2s ease;
}

.team-logo-section:hover {
  border-color: #d3ba17;
  box-shadow: 0 2px 8px rgba(211, 186, 23, 0.1);
}

.team-logo-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.team-logo-name {
  margin: 0;
  color: #d3ba17;
  font-size: 18px;
  font-weight: 600;
}

.team-logo-tag {
  background: #333;
  color: #ccc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid #555;
}

.team-logo-current-section {
  margin-bottom: 12px;
}

.team-logo-current-label {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #ccc;
}

.team-logo-current-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-logo-current-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border: 1px solid #555;
  border-radius: 4px;
  background: #222;
}

.team-logo-current-path {
  font-family: monospace;
  font-size: 12px;
  color: #888;
}

.team-logo-no-asset {
  color: #666;
  font-style: italic;
}

.team-logo-upload-area {
  border: 2px dashed #555;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #0f0f0f;
}

.team-logo-upload-area:hover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

.team-logo-upload-area.dragover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

/* Sponsor Asset Section Styles */
.sponsor-asset-section {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #1a1a1a;
  transition: all 0.2s ease;
}

.sponsor-asset-section:hover {
  border-color: #d3ba17;
  box-shadow: 0 2px 8px rgba(211, 186, 23, 0.1);
}

.sponsor-asset-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.sponsor-asset-name {
  margin: 0;
  color: #d3ba17;
  font-size: 18px;
  font-weight: 600;
}

.sponsor-asset-type {
  background: #333;
  color: #ccc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid #555;
}

.sponsor-asset-current-section {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #0f0f0f;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #333;
}

.sponsor-asset-video-section,
.sponsor-asset-image-section {
  padding: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  border: 1px solid #333;
}

.sponsor-asset-label {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #ccc;
}

.sponsor-asset-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sponsor-asset-video-icon {
  font-size: 24px;
}

.sponsor-asset-path {
  font-family: monospace;
  font-size: 12px;
  color: #888;
}

.sponsor-asset-current-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 1px solid #555;
  border-radius: 4px;
  background: #222;
}

.sponsor-asset-no-asset {
  color: #666;
  font-style: italic;
}

.sponsor-asset-upload-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.sponsor-asset-upload-area {
  border: 2px dashed #555;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #0f0f0f;
}

.sponsor-asset-upload-area:hover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

.sponsor-asset-upload-area.dragover {
  border-color: #d3ba17;
  background: #1a1a1a;
}

.sponsor-asset-upload-icon {
  font-size: 24px;
  color: #888;
  margin-bottom: 8px;
}

.sponsor-asset-upload-text {
  margin: 0;
  color: #ccc;
}

.sponsor-asset-upload-hint {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #666;
}
