/* Unified stylesheet for both apps (moved to repo root)
   Copied from media-player/styles.css and kept consistent rules for both apps. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f5f5;
  color: #222;
  line-height: 1.5;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Site header used by root index and accessible from apps */
.site-header {
  color: #ffffff;
  /* Use a warm orange to contrast the blue buttons */
  background: linear-gradient(90deg, #ff7a2b 0%, #ff6600 100%);
}

.site-header .header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 20px;
}

.site-header h1 {
  font-size: 1.6rem;
  margin: 0;
}

.site-header .lead {
  opacity: 0.95;
}

/* Small top navigation for app pages */
.top-nav {
  background: #ffffffea;
  border-bottom: 1px solid #eee;
}

.top-nav .container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 600;
}

.apps-list ul {
  list-style: none;
  margin-top: 18px;
}

.apps-list li {
  padding: 12px 0;
}

.app-link,
.upload-btn {
  /* Shared CTA button style */
  display: inline-block;
  padding: 12px 18px;
  background: #3498db;
  /* primary blue */
  color: #ffffff;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(52, 152, 219, 0.12);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.app-link:hover,
.upload-btn:hover {
  background: #2980b9;
}

.app-link:focus,
.upload-btn:focus {
  outline: 3px solid rgba(41, 130, 201, 0.12);
  outline-offset: 2px;
}

.upload-container {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  text-align: center;
}

input[type="file"] {
  display: none;
}

.upload-btn {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
}

.upload-btn:hover {
  background: #2980b9;
}

.file-list {
  margin-top: 12px;
  text-align: left;
}

.player-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.media-container {
  width: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

video,
audio {
  max-width: 100%;
  max-height: 70vh;
  outline: none;
}

.controls {
  padding: 12px;
  background: #fbfbfb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

button {
  padding: 8px 14px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #2980b9;
}

button:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

#timeDisplay {
  font-family: monospace;
  font-size: 0.9em;
  color: #607d8b;
  min-width: 120px;
  text-align: center;
  display: inline-block;
}

.playlist {
  padding: 12px;
}

.playlist h3 {
  margin-bottom: 8px;
  color: #2c3e50;
}

#playlistItems {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

#playlistItems li {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.12s;
}

#playlistItems li:hover {
  background: #f7f9fb;
}

#playlistItems li.playing {
  background: #eaf6ff;
  color: #1976d2;
  font-weight: 600;
}

.remove-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 2px 8px;
  margin-left: 10px;
  cursor: pointer;
  font-size: 0.9em;
}

.remove-btn:hover {
  background: #c0392b;
}

/* === Hacker News small story list rules === */

.story-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.story-item a {
  flex: 1;
  text-decoration: none;
}

.story-item input[type="checkbox"] {
  margin-right: 8px;
}

#selection-controls {
  margin-top: 8px;
  width: 100%;
}

#selected-links {
  width: 100%;
  box-sizing: border-box;
}

.story {
  margin: 12px 0;
  padding: 10px;
  border-bottom: 1px solid #e9e9e9;
}

.story:last-child {
  border-bottom: none;
}

.story a {
  text-decoration: none;
  color: #ff6600;
  font-weight: 600;
}

.story a:hover {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .container {
    padding: 14px;
  }

  .media-container {
    min-height: 200px;
  }

  .controls {
    gap: 6px;
  }
}

/* ------------------------------------------------------------------
   Podcast Viewer (light theme)
   These rules are intentionally unprefixed — IDs and classes used by
   the podcast viewer are unique so making them part of the unified
   stylesheet keeps the app visually consistent with the rest of the site.
------------------------------------------------------------------ */

main {
  padding: 20px 32px;
}

#search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}

#query {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  background: #fff;
  color: #222;
}


#content {
  display: flex;
  gap: 18px;
}

#results {
  width: 340px;
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #eee;
  color: #222;
}

#episodes {
  flex: 1;
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #eee;
}

h2 {
  margin: 4px 0 12px;
  color: #2c3e50;
}

.pod-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  align-items: center;
  cursor: pointer;
}

.pod-item:hover {
  background: #f7f9fb;
}

.pod-art {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  background: #f1f5f8;
  border-radius: 8px;
  display: inline-block;
  background-size: cover;
  background-position: center;
}

.pod-info {
  flex: 1;
}

.pod-title {
  font-weight: 600;
  color: #1976d2;
}

.pod-author {
  color: #607d8b;
  font-size: 13px;
}

.meta {
  color: #607d8b;
  font-size: 13px;
  margin-bottom: 8px;
}

.episode {
  padding: 8px;
  border-bottom: 1px dashed #eee;
}

.episode .title {
  font-weight: 600;
}

.episode .pub {
  color: #607d8b;
  font-size: 13px;
}

.download-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(52, 152, 219, 0.06);
  color: #1976d2;
  text-decoration: none;
  border: 1px solid rgba(52, 152, 219, 0.12);
}

footer {
  padding: 18px 32px;
  color: #607d8b;
  font-size: 13px;
}

@media (max-width:900px) {
  #content {
    flex-direction: column;
  }

  #results {
    width: 100%;
  }
}

/* ------------------------------------------------------------------
   Matrix Visualizer
   Specific styles for the matrix visualization tool
------------------------------------------------------------------ */

.matrix-visualizer .file-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  align-items: flex-end;
}

.matrix-visualizer .file-input {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 250px;
}

.matrix-visualizer .file-input label {
  white-space: nowrap;
  font-weight: bold;
  font-size: 14px;
}

.matrix-visualizer .file-input input[type="file"] {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.matrix-visualizer .load-button {
  padding: 10px 20px;
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 16px;
  font-weight: bold;
  height: 40px;
  margin-left: 10px;
}

.matrix-visualizer .load-button:hover {
  background-color: #27ae60;
}

.matrix-visualizer .color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.matrix-visualizer .color-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.matrix-visualizer .color-swatch {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  cursor: pointer;
}

.matrix-visualizer .canvas-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

.matrix-visualizer .canvas-wrapper {
  flex: 1;
  min-width: 300px;
  border: 1px solid #ddd;
  background: white;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.matrix-visualizer .canvas-wrapper h3 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  text-align: center;
}

.matrix-visualizer canvas {
  display: block;
  margin: 0 auto;
  image-rendering: pixelized;
  max-width: 100%;
  height: auto;
}

.matrix-visualizer .info {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  font-size: 14px;
}

.matrix-visualizer .info p {
  margin: 5px 0;
}

/* ------------------------------------------------------------------
   Clipboard Tool
------------------------------------------------------------------ */

.clipboard-tool main {
  max-width: 700px;
  margin: 0 auto;
}

.clipboard-tool #input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clipboard-tool #textInput {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
}

.clipboard-tool #textInput:focus {
  outline: 2px solid #3498db;
  outline-offset: 1px;
}

.clipboard-tool .buttons {
  display: flex;
  gap: 10px;
}

.clipboard-tool .buttons button {
  padding: 10px 24px;
  font-size: 15px;
}