/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* ============================================
   Warp Core Shutdown Easter Egg
   ============================================ */

/* Klickbarer Warp Core */
#warp-core-status {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#warp-core-status:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(255, 153, 0, 0.3);
}

#warp-core-status:active {
  transform: scale(0.98);
}

/* Klickbare Crew-Karte */
#crew-status {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

#crew-status:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(204, 68, 68, 0.3);
}

#crew-status:active {
  transform: scale(0.98);
}

/* Crew Count Animation */
#crew-count {
  transition: color 0.3s;
}

#crew-count.crew-danger {
  color: #cc4444;
  animation: crew-pulse 0.5s infinite;
}

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

/* Crew Message Popup */
.crew-message {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  right: 0;
  padding: 12px 15px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 8px;
  animation: crew-message-in 0.3s ease-out;
  z-index: 100;
  white-space: normal;
  line-height: 1.4;
}

.crew-message-warning {
  background: rgba(204, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid #ff6666;
}

.crew-message-success {
  background: rgba(68, 204, 68, 0.95);
  color: #000000;
  border: 1px solid #66ff66;
}

/* ============================================
   Life Support Mode Easter Egg
   ============================================ */

/* Klickbare Life Support Karte */
#life-support-status {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

#life-support-status:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(68, 204, 68, 0.3);
}

#life-support-status:active {
  transform: scale(0.98);
}

/* Status Dot Farben fuer verschiedene Modi */
.lcars-status-dot.life-support-klingon {
  background: #cc4444;
  box-shadow: 0 0 8px #cc4444;
}

.lcars-status-dot.life-support-benzite {
  background: #44aacc;
  box-shadow: 0 0 8px #44aacc;
}

.lcars-status-dot.life-support-android {
  background: #cccc44;
  box-shadow: 0 0 8px #cccc44;
  animation: none;
}

/* Life Support Nachrichten */
.life-support-message {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  right: 0;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 8px;
  animation: crew-message-in 0.3s ease-out;
  z-index: 100;
  white-space: normal;
  line-height: 1.3;
}

.life-support-message-klingon {
  background: rgba(204, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid #ff6666;
}

.life-support-message-benzite {
  background: rgba(68, 170, 204, 0.95);
  color: #000000;
  border: 1px solid #66ddff;
}

.life-support-message-android {
  background: rgba(204, 204, 68, 0.95);
  color: #000000;
  border: 1px solid #ffff66;
}

/* ============================================
   Shields Attack Easter Egg
   ============================================ */

/* Klickbare Shields Karte */
#shields-status {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

#shields-status:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(153, 153, 255, 0.3);
}

#shields-status:active {
  transform: scale(0.98);
}

/* Shields Wert Farben */
#shields-value {
  transition: color 0.3s;
}

#shields-value.shields-caution {
  color: #ffcc00;
}

#shields-value.shields-warning {
  color: #ff9900;
}

#shields-value.shields-critical {
  color: #ff4444;
  animation: shields-critical-pulse 0.5s infinite;
}

@keyframes shields-critical-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Shields Nachrichten */
.shields-message {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  right: 0;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 8px;
  animation: crew-message-in 0.3s ease-out;
  z-index: 100;
  white-space: normal;
  line-height: 1.3;
}

.shields-message-attack {
  background: rgba(204, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid #ff6666;
}

.shields-message-worf {
  background: rgba(153, 102, 51, 0.95);
  color: #ffffff;
  border: 1px solid #cc9966;
}

.shields-message-critical {
  background: rgba(255, 0, 0, 0.95);
  color: #ffffff;
  border: 2px solid #ff6666;
  font-weight: bold;
  text-align: center;
  animation: critical-flash 0.3s infinite;
}

.shields-message-info {
  background: rgba(68, 136, 204, 0.95);
  color: #ffffff;
  border: 1px solid #6699cc;
}

@keyframes critical-flash {
  0%, 100% { background: rgba(255, 0, 0, 0.95); }
  50% { background: rgba(200, 0, 0, 0.95); }
}

/* Screen Shake bei Treffer */
.shields-hit {
  animation: screen-shake 0.3s ease-out;
}

@keyframes screen-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Red Alert Effekt */
.red-alert {
  animation: red-alert-flash 0.5s infinite;
}

@keyframes red-alert-flash {
  0%, 100% {
    box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.3);
  }
  50% {
    box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.1);
  }
}

/* ============================================
   Mobile Status Bar
   ============================================ */

.mobile-status-bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 153, 0, 0.1);
  border-radius: 12px;
  border: 1px solid var(--lcars-orange);
}

.mobile-status-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--lcars-tan);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.mobile-status-btn:hover,
.mobile-status-btn:active {
  background: rgba(255, 153, 0, 0.2);
  border-color: var(--lcars-orange);
  transform: scale(1.02);
}

.mobile-status-icon {
  font-size: 20px;
  line-height: 1;
}

.mobile-status-label {
  font-size: 10px;
  color: var(--lcars-peach);
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.mobile-status-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lcars-green);
}

.mobile-status-dot.online {
  background: var(--lcars-green);
  animation: pulse 2s infinite;
}

.mobile-status-dot.warning {
  background: var(--lcars-yellow);
}

.mobile-status-dot.danger {
  background: var(--lcars-red);
  animation: none;
}

.mobile-status-dot.klingon {
  background: #cc4444;
  box-shadow: 0 0 5px #cc4444;
}

.mobile-status-dot.benzite {
  background: #44aacc;
  box-shadow: 0 0 5px #44aacc;
}

.mobile-status-dot.android {
  background: #cccc44;
  box-shadow: 0 0 5px #cccc44;
  animation: none;
}

/* Mobile Shields Farben */
#mobile-shields .mobile-status-label.caution {
  color: #ffcc00;
}

#mobile-shields .mobile-status-label.warning {
  color: #ff9900;
}

#mobile-shields .mobile-status-label.critical {
  color: #ff4444;
  animation: shields-critical-pulse 0.5s infinite;
}

/* Mobile Crew Danger */
#mobile-crew .mobile-status-label.danger {
  color: #ff4444;
  animation: crew-pulse 0.5s infinite;
}

/* Mobile Toast Container */
.mobile-toast-container {
  position: fixed;
  bottom: 80px;
  left: 10px;
  right: 10px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.mobile-toast {
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  animation: toast-in 0.3s ease-out;
  pointer-events: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.mobile-toast.toast-attack {
  background: rgba(204, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid #ff6666;
}

.mobile-toast.toast-worf {
  background: rgba(153, 102, 51, 0.95);
  color: #ffffff;
  border: 1px solid #cc9966;
}

.mobile-toast.toast-critical {
  background: rgba(255, 0, 0, 0.95);
  color: #ffffff;
  border: 2px solid #ff6666;
  font-weight: bold;
  text-align: center;
  animation: toast-in 0.3s ease-out, critical-flash 0.3s infinite;
}

.mobile-toast.toast-info {
  background: rgba(68, 136, 204, 0.95);
  color: #ffffff;
  border: 1px solid #6699cc;
}

.mobile-toast.toast-warning {
  background: rgba(204, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid #ff6666;
}

.mobile-toast.toast-success {
  background: rgba(68, 204, 68, 0.95);
  color: #000000;
  border: 1px solid #66ff66;
}

.mobile-toast.toast-klingon {
  background: rgba(204, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid #ff6666;
}

.mobile-toast.toast-benzite {
  background: rgba(68, 170, 204, 0.95);
  color: #000000;
  border: 1px solid #66ddff;
}

.mobile-toast.toast-android {
  background: rgba(204, 204, 68, 0.95);
  color: #000000;
  border: 1px solid #ffff66;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-toast.toast-out {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes crew-message-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Overlay */
.warp-shutdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: warp-overlay-fadein 0.5s ease-out;
}

@keyframes warp-overlay-fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.warp-shutdown-overlay.warp-fade-out {
  animation: warp-overlay-fadeout 0.5s ease-in forwards;
}

@keyframes warp-overlay-fadeout {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Container */
.warp-shutdown-container {
  width: 90%;
  max-width: 900px;
  height: 85vh;
  background: #0a0a0a;
  border: 2px solid #ff9900;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(255, 153, 0, 0.2);
}

/* Header */
.warp-shutdown-header {
  background: linear-gradient(90deg, #ff9900 0%, #cc6600 100%);
  padding: 10px 20px;
  text-align: center;
}

.warp-shutdown-title {
  color: #000;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 2px;
}

/* Console Output */
.warp-shutdown-console {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.4;
  background: #0a0a0a;
}

.warp-shutdown-console::-webkit-scrollbar {
  width: 8px;
}

.warp-shutdown-console::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.warp-shutdown-console::-webkit-scrollbar-thumb {
  background: #ff9900;
  border-radius: 4px;
}

/* Console Lines */
.warp-console-line {
  color: #33ff33;
  margin-bottom: 2px;
  text-transform: none;
  letter-spacing: 0;
}

.warp-console-line.warp-warning {
  color: #ffcc00;
  font-weight: bold;
  text-align: center;
  animation: warp-blink 1s infinite;
}

@keyframes warp-blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.5; }
}

.warp-console-line.warp-info {
  color: #66ccff;
}

.warp-console-line.warp-error {
  color: #ff4444;
  font-weight: bold;
}

.warp-console-line.warp-success {
  color: #44ff44;
  font-weight: bold;
}

.warp-console-line.warp-separator {
  color: #666666;
}

.warp-console-line.warp-command {
  color: #ffffff;
}

.warp-console-line.warp-typewriter {
  color: #ffcc99;
}

/* System Lines */
.warp-system-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.warp-bracket {
  color: #888888;
  font-weight: bold;
}

.warp-system-name {
  color: #cccccc;
  min-width: 280px;
}

.warp-dots {
  flex: 1;
  border-bottom: 1px dotted #444444;
  min-width: 20px;
}

.warp-status-fail {
  color: #ff6666;
  font-weight: bold;
  text-align: right;
  min-width: 180px;
}

.warp-status-ok {
  color: #66ff66;
  font-weight: bold;
  text-align: right;
  min-width: 180px;
}

/* Input Container */
.warp-input-container {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #1a1a1a;
  border-top: 1px solid #333333;
}

.warp-prompt {
  color: #66ff66;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  white-space: nowrap;
}

.warp-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  outline: none;
  caret-color: #66ff66;
}

.warp-input::placeholder {
  color: #666666;
}

/* Power Fluctuation Effect on Body */
.warp-power-fluctuation {
  animation: power-flicker 0.1s ease-in-out 3;
}

@keyframes power-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .warp-shutdown-container {
    width: 95%;
    height: 90vh;
  }

  .warp-shutdown-title {
    font-size: 12px;
    letter-spacing: 1px;
  }

  .warp-shutdown-console {
    padding: 10px;
    font-size: 11px;
  }

  .warp-system-name {
    min-width: 150px;
  }

  .warp-status-fail,
  .warp-status-ok {
    min-width: 100px;
    font-size: 10px;
  }

  .warp-input-container {
    padding: 10px;
  }

  .warp-prompt,
  .warp-input {
    font-size: 12px;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

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

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

