/* Terminal styles for session logs modal */

/* Terminal content styling */
.terminal-content {
  background-color: #000;
  color: #f0f0f0;
  font-family: "Menlo", "Monaco", "Consolas", monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 0.125rem 0.75rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Empty logs placeholder */
.empty-logs-placeholder {
  height: 362px;
  width: 100%;
  background-color: #000;
  color: #f0f0f0;
  font-family: "Menlo", "Monaco", "Consolas", monospace;
  font-size: 14px;
  border-radius: 0.375rem;
  border: 1px solid #333;
  margin: 0;
  padding: 6px 0 0 14px;
  text-align: left;
  opacity: 0.8;
  box-sizing: border-box;
}

/* Fixed height for both tab panels - prevents "jumping" */
#system-logs-panel,
#container-logs-panel {
  height: 362px !important;
  min-height: 362px !important;
  max-height: 362px !important;
  overflow: hidden !important;
}

/* Fixed height for terminal controllers inside panels */
#container-logs-panel [data-controller="terminal"] {
  height: 362px !important;
  max-height: 362px !important;
  overflow: hidden !important;
}

/* For system logs remove height restrictions, as they have .system-logs-container */
#system-logs-panel [data-controller="terminal"] {
  max-height: none !important;
  overflow: visible !important;
}

/* Terminal content styles in container logs panel */
#container-logs-panel .terminal-content {
  height: 362px !important;
  max-height: 362px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* For system logs terminal-content remove restrictions, use inherit */
#system-logs-panel .terminal-content {
  max-height: none !important;
  overflow-y: visible !important;
  overflow-x: hidden !important;
}

/* System logs container styles */
.system-logs-container {
  height: 362px;
  min-height: 362px;
  max-height: 362px;
  background-color: #000;
  color: #f0f0f0;
  font-family: "Menlo", "Monaco", "Consolas", monospace;
  border-radius: 0.375rem;
  border: 1px solid #333;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* UL logs container styles */
#system-logs-panel > .system-logs-container > ul {
  height: 100%;
  background-color: transparent;
  color: inherit;
  font-family: inherit;
  border: none;
  margin: 0;
  padding: 0.5rem 0 0 0;
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ==============================================
   FULLSCREEN MODE STYLES
   ============================================== */

/* Fullscreen mode for both panels */
.modal-fullscreen #system-logs-panel,
.modal-fullscreen #container-logs-panel {
  height: calc(100vh - 220px) !important;
  min-height: calc(100vh - 220px) !important;
  max-height: calc(100vh - 220px) !important;
  overflow-y: auto !important;
}

/* System logs container in fullscreen */
.modal-fullscreen .system-logs-container {
  height: calc(100vh - 220px) !important;
  min-height: calc(100vh - 220px) !important;
  max-height: calc(100vh - 220px) !important;
}

/* Container logs in fullscreen mode */
.modal-fullscreen #container-logs-panel [data-controller="terminal"] {
  height: calc(100vh - 220px) !important;
  max-height: calc(100vh - 220px) !important;
}

.modal-fullscreen #container-logs-panel .terminal-content {
  height: calc(100vh - 220px) !important;
  max-height: calc(100vh - 220px) !important;
}

/* Empty logs placeholder in fullscreen */
.modal-fullscreen .empty-logs-placeholder {
  height: calc(100vh - 220px) !important;
  min-height: calc(100vh - 220px) !important;
  max-height: calc(100vh - 220px) !important;
}

/* ==============================================
   DARK SCROLLBARS
   ============================================== */

/* Scrollbar styles for terminal content - dark theme */
.terminal-content::-webkit-scrollbar {
  width: 10px;
}

.terminal-content::-webkit-scrollbar-track {
  background: #111;
}

.terminal-content::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}

.terminal-content::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* Firefox scrollbar styles */
.terminal-content {
  scrollbar-width: thin;
  scrollbar-color: #333 #111;
}

/* Scrollbars for system logs UL */
#system-logs-panel > .system-logs-container > ul::-webkit-scrollbar {
  width: 10px;
}

#system-logs-panel > .system-logs-container > ul::-webkit-scrollbar-track {
  background: #111;
}

#system-logs-panel > .system-logs-container > ul::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}

#system-logs-panel > .system-logs-container > ul::-webkit-scrollbar-thumb:hover {
  background: #444;
}

#system-logs-panel > .system-logs-container > ul {
  scrollbar-width: thin;
  scrollbar-color: #333 #111;
}

/* ==============================================
   ANSI COLORS
   ============================================== */

/* Basic ANSI colors */
.ansi-black { color: #3A3A3A; }
.ansi-red { color: #E84F4F; }
.ansi-green { color: #B8D68C; }
.ansi-yellow { color: #E1AA5D; }
.ansi-blue { color: #7DC1CF; }
.ansi-magenta { color: #9B64FB; }
.ansi-cyan { color: #6D878D; }
.ansi-white { color: #DDDDDD; }

/* Bright ANSI colors */
.ansi-bright-black { color: #666666; }
.ansi-bright-red { color: #FF6C5C; }
.ansi-bright-green { color: #A8FF60; }
.ansi-bright-yellow { color: #FFFFB6; }
.ansi-bright-blue { color: #96CBFE; }
.ansi-bright-magenta { color: #FF73FD; }
.ansi-bright-cyan { color: #93E0E3; }
.ansi-bright-white { color: #FFFFFF; }

/* Background colors */
.ansi-bg-black { background-color: #3A3A3A; }
.ansi-bg-red { background-color: #E84F4F; }
.ansi-bg-green { background-color: #B8D68C; }
.ansi-bg-yellow { background-color: #E1AA5D; }
.ansi-bg-blue { background-color: #7DC1CF; }
.ansi-bg-magenta { background-color: #9B64FB; }
.ansi-bg-cyan { background-color: #6D878D; }
.ansi-bg-white { background-color: #DDDDDD; }

/* Text styles */
.ansi-bold { font-weight: bold; }
.ansi-italic { font-style: italic; }
.ansi-underline { text-decoration: underline; }

/* ==============================================
   ADDITIONAL STYLES
   ============================================== */

/* Fix for black text in logs */
#idle_job_logs .terminal-content b span[style="color:#000"] {
  color: rgb(240, 240, 240) !important;
  font-weight: normal !important;
}

/* Styles for li elements */
#system-logs-panel ul > li {
  margin: 0;
  padding: 0;
  background: transparent;
}

/* Styles for time elements (timestamps) */
#system-logs-panel ul > li > time {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.125rem 0.75rem;
  background-color: #000;
  color: #0AA;
  font-family: "Menlo", "Monaco", "Consolas", monospace;
  font-size: 13px;
}

/* Remove height restrictions from individual terminal controllers inside li */
#system-logs-panel li .terminal-content {
  min-height: auto !important;
  max-height: none !important;
}

/* ==============================================
   MODAL ANIMATIONS
   ============================================== */

/* Modern spring-like scale + fade animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalScaleOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

/* Animation classes */
.animate-fadeIn {
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fadeOut {
  animation: modalFadeOut 0.15s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.animate-scaleIn {
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scaleOut {
  animation: modalScaleOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* View Transition API support */
@supports (view-transition-name: auto) {
  #session-logs-modal {
    view-transition-name: session-logs-modal;
  }

  ::view-transition-old(session-logs-modal),
  ::view-transition-new(session-logs-modal) {
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }

  ::view-transition-old(session-logs-modal) {
    animation-name: modalScaleOut;
  }

  ::view-transition-new(session-logs-modal) {
    animation-name: modalScaleIn;
  }
}
