/* ConWifi - Retro Terminal Theme */

:root {
  --bg: #050505;
  --text: #00ff08;
  --text-dim: #00cc06;
  --text-bright: #33ff33;
  --accent: #00ffc0;
  --orange: #ffb000;
  --red: #ff4444;
  --border: #00ff2080;
  --card-bg: #0a0a0a;
  --glow-sm: 0 0 3px #00ffc0, 0 0 8px #00ff6640;
  --glow-lg: 0 0 5px #00ffc0, 0 0 15px #00ff66, 0 0 30px #00ff6640;
  --font: 'Courier New', Courier, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  padding: 1rem;
  min-height: 100vh;
}

/* Header */

header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.conf-name {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: bold;
  color: var(--text-bright);
  text-shadow: var(--glow-lg);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.subtitle {
  font-size: clamp(0.7rem, 2vw, 1.1rem);
  color: var(--text-dim);
  text-shadow: var(--glow-sm);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.description {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 700px;
  margin: 0 auto;
}

/* Links */

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:visited {
  color: var(--orange);
}

a:hover {
  color: var(--red);
  text-decoration: underline;
  text-shadow: 0 0 8px var(--red);
}

/* Network Cards */

#network-cards {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.network-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  flex: 1 1 320px;
  max-width: 500px;
  min-width: 280px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.network-card:hover {
  border-color: var(--text);
  box-shadow: var(--glow-sm);
}

.card-header {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-bright);
  text-shadow: var(--glow-sm);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.card-row {
  margin-bottom: 0.75rem;
}

.card-label {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

.card-value {
  color: var(--text);
  font-size: 1rem;
  word-break: break-all;
}

.card-value .credential {
  color: var(--orange);
  font-weight: bold;
}

/* Download Buttons */

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:visited {
  color: var(--text);
}

.btn:hover {
  border-color: var(--text-bright);
  color: var(--text-bright);
  text-shadow: var(--glow-sm);
  box-shadow: var(--glow-sm);
  text-decoration: none;
}

.btn:active {
  background: #00ff0810;
}

/* QR Code */

.qr-container {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.card-row:has(.qr-container) {
  text-align: center;
}

.card-row:has(.qr-container) .card-value {
  display: flex;
  justify-content: center;
}

.qr-container canvas,
.qr-container img {
  border: 2px solid var(--border);
  border-radius: 4px;
  max-width: 100%;
  height: auto;
}

.qr-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* Extra Sections (ToorCamp hosting creds) */

#extra-sections {
  max-width: 700px;
  margin: 0 auto 2rem;
}

.extra-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.extra-section h3 {
  color: var(--orange);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.extra-section p {
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.extra-cred {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-left: 2px solid var(--border);
}

.extra-cred .ssid {
  color: var(--text);
  font-weight: bold;
}

.extra-cred .detail {
  color: var(--orange);
  font-size: 0.9rem;
}

/* Cert Info */

#cert-info {
  max-width: 700px;
  margin: 0 auto 2rem;
  text-align: center;
}

#cert-info h3 {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cert-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Loading state */

#loading {
  text-align: center;
  padding: 4rem 1rem;
  font-size: 1.2rem;
  color: var(--text-dim);
}

#loading .blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Error state */

#error {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--red);
  display: none;
}

/* Footer */

footer {
  text-align: center;
  padding: 1rem 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* Android Setup Modal */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  position: relative;
  max-width: 380px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  font-family: var(--font);
  transition: all 0.2s;
}

.modal-close:hover {
  border-color: var(--text-bright);
  color: var(--text-bright);
  box-shadow: var(--glow-sm);
}

/* Android phone mock */

.android-phone {
  background: #121212;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #333;
  font-family: 'Segoe UI', Roboto, sans-serif;
  max-width: 100%;
}

.android-topbar {
  background: #2a2a2a;
  padding: 16px;
}

.android-topbar-title {
  color: #fff;
  font-size: 20px;
  font-weight: 400;
}

.android-form {
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.android-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.android-label {
  font-size: 13px;
  color: #9e9e9e;
  letter-spacing: 0.02em;
  padding-left: 4px;
}

.android-dropdown {
  background: #2e2e2e;
  border-radius: 28px;
  padding: 14px 40px 14px 16px;
  color: #e0e0e0;
  font-size: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.android-input {
  color: #e0e0e0;
  font-size: 16px;
  padding: 8px 4px 6px;
  border-bottom: 1px solid #555;
}

/* ChromeOS Setup Modal */

.chromeos-modal-content {
  max-width: 570px;
}

.chromeos-dialog {
  background: #263232;
  border-radius: 12px;
  padding: 24px;
  overflow: hidden;
  color: #e8eaed;
  font-family: 'Segoe UI', Roboto, sans-serif;
}

.chromeos-title {
  font-size: 18px;
  font-weight: 500;
  color: #e8eaed;
  margin-bottom: 22px;
}

.chromeos-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.chromeos-label {
  font-size: 13px;
  color: #9aa0a6;
}

.chromeos-input,
.chromeos-dropdown {
  background: #1e2d2d;
  border: 1px solid #3c4f4f;
  border-radius: 6px;
  padding: 10px 14px;
  color: #e8eaed;
  font-size: 14px;
  font-family: 'Segoe UI', Roboto, sans-serif;
}

.chromeos-dropdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chromeos-chevron {
  color: #9aa0a6;
  font-size: 18px;
}

/* Linux Setup Modal */

.linux-modal-content {
  max-width: 540px;
}

.linux-dialog {
  background: #2d2d2d;
  border-radius: 12px;
  overflow: hidden;
}

.linux-tabs {
  display: flex;
  border-bottom: 1px solid #444;
  background: #252525;
}

.linux-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  color: #888;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
}

.linux-tab:hover {
  color: #c0c0c0;
}

.linux-tab.active {
  color: #fff;
  border-bottom-color: var(--text);
}

.linux-tab-content {
  display: none;
}

.linux-tab-content.active {
  display: block;
}

.linux-code-section {
  padding: 20px 24px;
  font-family: 'Segoe UI', Cantarell, sans-serif;
}

.linux-instructions {
  color: #a0a0a0;
  font-size: 13px;
  margin-bottom: 10px;
  margin-top: 16px;
}

.linux-instructions:first-child {
  margin-top: 0;
}

.linux-instructions code {
  color: #e0e0e0;
  background: #3d3d3d;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font);
  font-size: 12px;
}

.linux-code {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0;
}

.linux-code code {
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}

/* GNOME dialog (inside Linux modal GUI tab) */

.gnome-dialog {
  overflow: hidden;
  font-family: 'Segoe UI', Cantarell, sans-serif;
  color: #e0e0e0;
}

.gnome-header {
  padding: 24px 28px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.gnome-wifi-icon {
  margin-top: 4px;
  flex-shrink: 0;
  color: #c0c0c0;
}

.gnome-header-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 10px;
}

.gnome-header-sub {
  font-size: 13px;
  color: #a0a0a0;
  line-height: 1.5;
}

.gnome-form {
  padding: 4px 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gnome-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  min-height: 42px;
  gap: 12px;
}

.gnome-row-label {
  font-size: 13.5px;
  color: #c0c0c0;
  text-align: right;
  padding-right: 4px;
}

.gnome-row-label.gnome-dimmed {
  color: #6a6a6a;
}

.gnome-field-input {
  background: #3d3d3d;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 7px 10px;
  color: #e0e0e0;
  font-size: 13.5px;
  font-family: 'Segoe UI', Cantarell, sans-serif;
  min-height: 32px;
}

.gnome-field-input.gnome-empty {
  background: #363636;
}

.gnome-dropdown {
  background: #3d3d3d;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 7px 10px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gnome-chevron {
  color: #a0a0a0;
  font-size: 14px;
}

.gnome-cert-link {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.gnome-cert-link:visited {
  color: #fff;
}

.gnome-cert-link:hover {
  text-decoration: underline;
  color: #fff;
  text-shadow: none;
}

.gnome-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 20px;
}

.gnome-btn {
  padding: 8px 22px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  background: #3d3d3d;
  color: #e0e0e0;
  border: 1px solid #555;
}

@media (max-width: 768px) {
  .gnome-row {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: auto;
    margin-bottom: 8px;
  }

  .gnome-row-label {
    text-align: left;
  }
}

/* Responsive */

@media (max-width: 768px) {
  body {
    padding: 0.75rem;
  }

  .network-card {
    max-width: 100%;
  }

  #network-cards {
    flex-direction: column;
    align-items: stretch;
  }

  .conf-name {
    letter-spacing: 0;
  }
}
