/* OBS Overlay Component Styling */

/* OBS Toggle Button */
.obs-overlay-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
  color: white;
  border: 2px solid rgba(99, 102, 241, 0.9);
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
  font-family: inherit;
}

.obs-overlay-toggle:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(139, 92, 246, 1) 100%);
  border-color: rgba(99, 102, 241, 1);
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 8px 25px rgba(99, 102, 241, 0.5),
    0 0 20px rgba(99, 102, 241, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.obs-overlay-toggle:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow:
    0 4px 12px rgba(99, 102, 241, 0.4),
    inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.obs-overlay-toggle::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.obs-overlay-toggle:hover::before {
  opacity: 1;
}

.obs-status-online {
  color: #22c55e;
  font-size: 12px;
  animation: pulse-green 2s infinite, glow-green 1.5s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  font-weight: bold;
}

.obs-status-offline {
  color: #ef4444;
  font-size: 12px;
  animation: pulse-red 1s infinite;
  font-weight: bold;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes pulse-red {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes glow-green {
  0%, 100% { text-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
  50% { text-shadow: 0 0 16px rgba(34, 197, 94, 0.9); }
}

/* Battle Arena Toggle Position */
.obs-battle-toggle {
  top: 80px;
}

/* OBS Overlay Modal */
.obs-overlay-modal {
  position: fixed;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

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

/* Modal Mode */
.obs-overlay-modal.mode-modal {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-height: 70vh;
  border-radius: 12px;
  overflow: hidden;
}

/* Side Panel Mode */
.obs-overlay-modal.mode-side {
  right: 0;
  top: 0;
  width: 400px;
  height: 100vh;
  border-radius: 0;
  background: rgba(10, 10, 20, 0.95);
  border-left: 3px solid rgba(99, 102, 241, 0.6);
}

/* Bottom Panel Mode */
.obs-overlay-modal.mode-bottom {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  border-radius: 0;
  background: rgba(10, 10, 20, 0.95);
  border-top: 3px solid rgba(99, 102, 241, 0.6);
}

/* Fullscreen Wrapper */
.obs-overlay-wrapper.mode-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  background: transparent;
}

.obs-fullscreen-overlay {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 30, 0.9) 100%);
  display: flex;
  flex-direction: column;
}

/* OBS Overlay Container */
.obs-overlay-container {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(20, 20, 30, 0.8) 100%);
  border: 2px solid rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: #ffffff;
}

.obs-overlay-container.fullscreen {
  border: none;
  border-radius: 0;
}

/* OBS Header */
.obs-overlay-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(30, 30, 40, 0.9) 100%);
  border-bottom: 2px solid rgba(99, 102, 241, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.obs-overlay-header h2,
.obs-overlay-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: #e0e7ff;
}

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

/* Display Mode Control */
.obs-display-mode-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 8px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.obs-display-info {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.obs-display-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.obs-mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.obs-mode-indicator.mode-broadcast {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.obs-mode-indicator.mode-extension {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.obs-display-toggle {
  padding: 8px 12px;
  border: 2px solid;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.obs-display-toggle .toggle-label {
  display: inline;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.obs-display-toggle.obs-mode-broadcast {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

.obs-display-toggle.obs-mode-broadcast:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: #60a5fa;
  color: #bfdbfe;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.obs-display-toggle.obs-mode-broadcast:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.obs-display-toggle.obs-mode-extension {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #d8b4fe;
}

.obs-display-toggle.obs-mode-extension:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: #c084fc;
  color: #e9d5ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.obs-display-toggle.obs-mode-extension:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.15);
}

.obs-mode-select {
  padding: 6px 10px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #e0e7ff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.obs-mode-select:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.8);
}

.obs-close-btn {
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.obs-close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.8);
  color: #ef4444;
}

/* OBS Content Area */
.obs-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.obs-overlay-content.fullscreen-content {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Visibility Badge */
.obs-visibility-badge {
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  border: 2px solid;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.obs-visibility-badge.all {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #86efac;
}

.obs-visibility-badge.own {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

/* Battle Items */
.obs-battles-list {
  flex: 1;
}

.obs-battles-list h4,
.obs-packs-list h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.obs-battle-item,
.obs-item {
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #e0e7ff;
  transition: all 0.2s ease;
}

.obs-battle-item:hover,
.obs-item:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateX(3px);
  border-left-color: #818cf8;
}

.obs-vs {
  font-weight: bold;
  color: #f0f9ff;
}

/* Pack Items */
.obs-packs-list {
  flex: 1;
}

.obs-pack-item {
  padding: 10px 12px;
  background: rgba(168, 85, 247, 0.1);
  border-left: 3px solid #a855f7;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #e0e7ff;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.obs-pack-item:hover {
  background: rgba(168, 85, 247, 0.2);
  transform: translateX(3px);
  border-left-color: #d946ef;
}

.obs-pack-name {
  font-weight: bold;
  color: #f0f9ff;
}

.obs-pack-type {
  font-size: 11px;
  background: rgba(168, 85, 247, 0.3);
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  color: #d8b4fe;
}

/* Sections for Fullscreen */
.obs-section {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(20, 20, 30, 0.5) 100%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 15px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.obs-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #e0e7ff;
  border-bottom: 2px solid rgba(99, 102, 241, 0.4);
  padding-bottom: 8px;
}

.obs-section.battles-section {
  border-color: rgba(99, 102, 241, 0.5);
}

.obs-section.packs-section {
  border-color: rgba(168, 85, 247, 0.5);
}

/* Empty State */
.obs-empty {
  text-align: center;
  color: #94a3b8;
  font-style: italic;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 13px;
}

/* OBS Footer */
.obs-overlay-footer {
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.obs-status {
  color: #94a3b8;
  margin: 0;
}

/* Scrollbar Styling */
.obs-overlay-content::-webkit-scrollbar {
  width: 6px;
}

.obs-overlay-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.obs-overlay-content::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 3px;
}

.obs-overlay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

/* Responsive Design */

/* Tablet */
@media (max-width: 1024px) {
  .obs-overlay-modal.mode-modal {
    width: 400px;
    max-height: 60vh;
  }

  .obs-overlay-content.fullscreen-content {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .obs-overlay-toggle {
    padding: 8px 12px;
    font-size: 12px;
    top: 15px;
    right: 15px;
  }

  .obs-overlay-modal.mode-modal {
    width: calc(100% - 30px);
    max-height: 50vh;
  }

  .obs-overlay-modal.mode-side {
    width: 100%;
    height: 60vh;
    border-left: none;
    border-top: 3px solid rgba(99, 102, 241, 0.6);
  }

  .obs-overlay-modal.mode-bottom {
    height: 40vh;
  }

  .obs-overlay-content {
    padding: 10px;
    gap: 10px;
  }

  .obs-overlay-content.fullscreen-content {
    padding: 15px;
    gap: 15px;
  }

  .obs-header-controls {
    flex-direction: column;
    gap: 5px;
  }

  .obs-mode-select,
  .obs-close-btn {
    font-size: 11px;
    padding: 5px 8px;
  }
}

/* Focus States */
.obs-overlay-toggle:focus,
.obs-mode-select:focus,
.obs-close-btn:focus {
  outline: 2px solid rgba(99, 102, 241, 0.8);
  outline-offset: 2px;
}

/* Animation for Item Entry */
.obs-battle-item,
.obs-pack-item,
.obs-item {
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Print Styles */
@media print {
  .obs-overlay-toggle,
  .obs-overlay-modal,
  .obs-overlay-wrapper {
    display: none !important;
  }
}
