/* =========================================================================
   Component: Device Detail (e.g. /devices/gts4lvwifi)
   Covers: branch selector, OTA summary panel, spec grid, maintainer row,
   flashing-instructions / changelog buttons, download CTAs, and the three
   modal dialogs (Thermonuclear warning, Build-type info, Unmaintained warning).
   ========================================================================= */

.evox-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
@media (min-width: 992px) {
  .evox-detail { gap: 1.5rem; }
}

.evox-detail__branches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
@media (min-width: 992px) {
  .evox-detail__branches { gap: 0.75rem; }
}

/* Outer OTA panel: image + specs side by side on desktop, stacked on mobile */
.evox-ota-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  padding: 1rem 1.5rem 1rem 1rem;
  padding-top: 3rem;
  border: 2px solid var(--evox-primary);
  border-radius: var(--evox-radius-md);
  background-color: var(--evox-surface);
}
@media (min-width: 768px) {
  .evox-ota-panel {
    flex-direction: row;
    padding: 2.75rem 3.5rem 2.75rem 2.75rem;
    gap: 1.5rem;
  }
}
@media (min-width: 992px) {
  .evox-ota-panel { gap: 4rem; }
}

.evox-ota-panel__device {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  text-align: center;
}
@media (min-width: 768px) {
  .evox-ota-panel__device {
    width: 25%;
    flex-shrink: 0;
  }
}
.evox-ota-panel__device img {
  width: 100%;
  max-height: 14rem;
  min-height: 12rem;
  object-fit: contain;
}
.evox-ota-panel__device-name {
  font-size: 1.5rem;
  margin-bottom: 0;
}
.evox-ota-panel__device-codename {
  font-size: 1.125rem;
  margin-bottom: 0;
}

/* Inner "current build" card — swaps content with a fade when branch changes */
.evox-build-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
  width: 100%;
  padding: 1.25rem 1rem;
  border: 2px solid var(--evox-primary);
  border-radius: var(--evox-radius-md);
  background-color: var(--evox-bg);
  box-shadow: var(--evox-shadow-middle);
  min-height: 450px;
  animation: evoxFadeSlideIn 0.3s ease;
}
@media (min-width: 768px) {
  .evox-build-card {
    width: 66.6667%;
    justify-content: space-between;
  }
}
@keyframes evoxFadeSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .evox-build-card { animation: none; }
}

.evox-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding-bottom: 1rem;
  padding-left: 0.5rem;
}
@media (min-width: 992px) {
  .evox-spec-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}
.evox-spec-grid__label {
  font-size: 1rem;
  color: var(--evox-primary);
}
.evox-spec-grid__value {
  font-size: 1.5rem;
  color: var(--evox-text);
}

/* Maintainer strip inside the build card */
.evox-maintainer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--evox-primary);
  border-radius: var(--evox-radius-md);
  background-color: var(--evox-surface);
}
@media (min-width: 992px) {
  .evox-maintainer-strip { gap: 2.25rem; }
}
.evox-maintainer-strip__who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.evox-maintainer-strip__who img {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  flex-shrink: 0;
}
@media (min-width: 992px) {
  .evox-maintainer-strip__who img { width: 4rem; height: 4rem; }
}
.evox-maintainer-strip__name {
  max-width: 12rem;
  font-size: 1.125rem;
  font-weight: 500;
}
@media (min-width: 992px) {
  .evox-maintainer-strip__name { font-size: 1.25rem; }
}
.evox-maintainer-strip__links {
  display: flex;
  gap: 0.5rem;
}
.evox-maintainer-strip__links img {
  width: 2rem;
  height: 2rem;
}
@media (min-width: 992px) {
  .evox-maintainer-strip__links img { width: 2.5rem; height: 2.5rem; }
}

/* Action row: Flashing Instructions / Changelog buttons */
.evox-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .evox-action-row { grid-template-columns: repeat(2, 1fr); }
}

.evox-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--evox-primary);
  border-radius: var(--evox-radius-pill);
  background-color: transparent;
  color: var(--evox-text);
  font-size: 1.125rem;
  transition: background-color 0.15s ease;
}
.evox-action-btn:hover,
.evox-action-btn:focus-visible {
  background-color: var(--evox-primary-hover);
  color: var(--evox-text);
}

/* Download CTA row: Download ROM / Download GApps */
.evox-download-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.evox-download-row.has-gapps {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .evox-download-row.has-gapps { grid-template-columns: repeat(2, 1fr); }
}

/* --- Code block used inside the flashing-instructions modal --- */
.evox-code {
  display: block;
  margin: 0.5rem 0;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  background-color: var(--evox-bg);
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.875rem;
  color: var(--evox-text);
}

/* =========================================================================
   Modals: Thermonuclear Warning / Build-type Info / Unmaintained Warning
   Structurally identical to a Bootstrap .modal, restyled to match the brand.
   If you'd rather use Bootstrap's own modal JS, keep the .modal/.modal-dialog
   classes and just add these brand classes alongside them.
   ========================================================================= */
.evox-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
}

.evox-modal {
  width: 100%;
  max-width: 36rem;
  margin: 1rem;
  padding: 1.5rem;
  border-radius: var(--evox-radius-md);
  background-color: var(--evox-surface);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.evox-modal--warning {
  border: 4px dashed var(--evox-warning);
}
.evox-modal--info {
  border: 2px solid var(--evox-primary);
}

.evox-modal__title {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}
@media (min-width: 992px) {
  .evox-modal__title { font-size: 1.875rem; }
}
.evox-modal--warning .evox-modal__title {
  color: var(--evox-warning);
}
.evox-modal--info .evox-modal__title {
  color: var(--evox-primary);
}

.evox-modal__body {
  margin-bottom: 1rem;
  font-weight: 300;
}
@media (min-width: 992px) {
  .evox-modal__body { font-size: 1.125rem; }
}
.evox-modal__body a {
  color: var(--evox-primary);
  font-weight: 700;
}

.evox-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.evox-modal__actions button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  color: var(--evox-text);
}
.evox-modal__actions .is-danger {
  background-color: var(--evox-warning);
}
.evox-modal__actions .is-danger:hover {
  background-color: var(--evox-warning-hover);
}
.evox-modal__actions .is-primary {
  background-color: var(--evox-primary);
}
.evox-modal__actions .is-primary:hover {
  background-color: var(--evox-primary-hover);
}
