/* Global Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #1a1a1a;
  color: #fff;
}

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

/* Header */
header {
  background: #0a0a0a;
  padding: 20px;
  border-bottom: 1px solid #333;
  margin-bottom: 20px;
}

header img.header-logo {
  max-height: 80px;
  width: auto;
  display: block;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  display: inline-block;
}

/* Main Content Layout */
.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Stream Section */
.stream-section {
  background: #222;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

.stream-container {
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stream-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.stream-header {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  padding: 20px 20px 15px 20px;
  color: #fff !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  background-clip: unset !important;
}

/* Control Section */
.control-section {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #333;
}

.control-section h2 {
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: 600;
}

.control-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* Buttons */
button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #0066cc;
  color: white;
}

.btn-primary:hover {
  background-color: #0052a3;
}

.btn-danger {
  background-color: #cc0000;
  color: white;
}

.btn-danger:hover {
  background-color: #990000;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Patrol Status */
.patrol-status {
  padding: 15px;
  background: #1a1a1a;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 4px solid #0066cc;
}

.patrol-status.inactive {
  border-left-color: #666;
}

.status-text {
  margin: 5px 0;
  font-size: 14px;
}

.status-label {
  font-weight: 600;
  color: #aaa;
}

/* Presets Grid */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Preset Card */
.preset-card {
  background: #222;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
  transition: border-color 0.2s;
}

.preset-card:hover {
  border-color: #0066cc;
}

.preset-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preset-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preset-image.loading {
  color: #666;
  font-size: 12px;
}

.preset-info {
  padding: 15px;
}

.preset-name {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
}

.preset-timestamp {
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
}

.preset-button {
  width: 100%;
  padding: 8px 12px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.preset-button:hover {
  background: #0052a3;
}

/* Footer */
footer {
  background: #0a0a0a;
  border-top: 1px solid #333;
  margin-top: 40px;
  padding: 20px;
}

footer p {
  margin: 0;
  font-size: 14px;
  color: #999;
  text-align: center;
}

footer a {
  color: #999;
  text-decoration: none;
}

/* ============================================
   MOBILE STYLES (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
  header {
    padding: 15px;
  }

  header .container {
    text-align: center;
    padding: 10px;
  }

  header img.header-logo {
    max-height: 50px;
    margin: 0 auto;
  }

  .info-section {
    font-size: 14px !important;
  }

  .presets-grid {
    grid-template-columns: 1fr;
  }

  .preset-image {
    aspect-ratio: 16 / 9;
  }

  .control-buttons {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
