/* Sky Bridge Firmware Updater Styles */

@font-face {
  font-family: 'Chalet';
  src: url('../assets/chalet-newyork-1960.woff2') format('woff2'),
       url('../assets/chalet-newyork-1960.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Venice';
  src: url('../assets/flyer-venice.woff2') format('woff2'),
       url('../assets/flyer-venice.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #0066FF;
  --color-gold: #FFD700;
  --color-green: #00FF9D;
  --color-red: #FF6B6B;
  --bg-deep: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1e1e1e;
  --bg-input: #1a1a1a;
  --border: #333;
  --border-light: #444;
  --text: #f0f0f0;
  --text-dim: #888;
  --accent: var(--color-primary);
  --accent-glow: rgba(0, 102, 255, 0.3);
  --success: var(--color-green);
  --warning: var(--color-gold);
  --error: var(--color-red);
  --font-title: 'Venice', Georgia, serif;
  --font-body: 'Chalet', system-ui, sans-serif;
  --font-mono: 'Chalet', 'Consolas', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: linear-gradient(180deg, rgba(20,20,20,0.95) 0%, rgba(20,20,20,0.85) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-logo .logo-icon {
  font-size: 2.5rem;
  color: var(--accent);
}

.app-logo h1 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: normal;
  margin: 0;
}

.connection-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: normal;
  margin: 0 0 1.5rem 0;
  color: var(--accent);
}

.card h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: normal;
  margin: 0 0 1rem 0;
}

/* Device Info */
.device-info {
  background: rgba(0, 102, 255, 0.1);
  border: 1px solid rgba(0, 102, 255, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-label {
  color: var(--text-dim);
}

.info-value {
  font-family: var(--font-mono);
  color: var(--text);
}

/* Update Controls */
.update-controls {
  margin-bottom: 1.5rem;
}

.update-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.update-row label {
  min-width: 180px;
  color: var(--text-dim);
}

.update-row wa-select {
  flex: 1;
  min-width: 200px;
}

.update-row input[type="file"] {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Progress */
.progress-section {
  margin: 1.5rem 0;
}

.progress-bar {
  height: 24px;
  background: var(--bg-deep);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
  width: 0%;
  transition: width 0.2s ease-out;
}

.progress-text {
  text-align: center;
  margin: 0.75rem 0 0 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Instructions */
.instructions {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--text-dim);
}

.instructions li {
  margin-bottom: 0.5rem;
}

/* Log Panel */
.log-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.log-header {
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.log-content {
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.log-content:empty::after {
  content: "No activity yet";
  color: var(--text-dim);
}

.log-entry {
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.log-entry.error {
  color: var(--error);
}

.log-entry.success {
  color: var(--success);
}

.log-entry.warning {
  color: var(--warning);
}

.log-entry .timestamp {
  color: var(--text-dim);
  opacity: 0.6;
  margin-right: 0.5rem;
}

/* Footer */
.app-footer {
  padding: 1rem 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.app-footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .connection-controls {
    width: 100%;
    justify-content: space-between;
  }

  .main-content {
    padding: 1rem;
  }

  .update-row {
    flex-direction: column;
    align-items: stretch;
  }

  .update-row label {
    min-width: auto;
    margin-bottom: 0.5rem;
  }
}

/* Web Awesome button styling */
wa-button {
  --wa-button-font-family: var(--font-mono);
}

wa-button[variant="brand"] {
  --wa-color-brand-600: var(--color-primary);
}

/* Callouts */
wa-callout {
  margin-top: 1rem;
}

/* Troubleshooting Section */
.troubleshooting-details {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.troubleshooting-details::part(base) {
  background: transparent;
  border: none;
}

.troubleshooting-details::part(header) {
  padding: 1rem 1.25rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.troubleshooting-details::part(content) {
  padding: 0 1.25rem 1.25rem;
}

.troubleshooting-details p {
  color: var(--text);
  margin: 0.75rem 0;
}

.troubleshooting-details strong {
  color: var(--text);
}

.troubleshooting-details .instructions {
  color: var(--text);
}

.troubleshooting-details .other-tips {
  margin-top: 1.5rem;
}

.troubleshooting-details code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  display: inline-block;
  margin-top: 0.25rem;
}

.troubleshooting-details .flags-list {
  margin-top: 0.5rem;
  color: var(--text);
}

.troubleshooting-details .flags-list li {
  margin-bottom: 0.5rem;
}

/* Device selector dropdown */
.device-selector {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.device-selector wa-select {
  flex: 1;
}
