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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.login-container .subtitle {
  color: #888;
  margin-bottom: 2rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 320px;
  gap: 12px;
}

#login-form input {
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #16213e;
  color: #eee;
  font-size: 1rem;
}

#login-form input:focus {
  outline: none;
  border-color: #4a9eff;
}

#login-form button {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #4a9eff;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#login-form button:hover {
  background: #3a8eef;
}

.error {
  color: #ff6b6b;
  font-size: 0.875rem;
  text-align: center;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #16213e;
  border-bottom: 1px solid #333;
}

header h1 {
  font-size: 1.5rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

#user-email {
  color: #888;
  font-size: 0.875rem;
}

#logout-btn {
  padding: 8px 16px;
  border: 1px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #eee;
  cursor: pointer;
  transition: background 0.2s;
}

#logout-btn:hover {
  background: #333;
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: #16213e;
  border-bottom: 1px solid #333;
  align-items: center;
  flex-wrap: wrap;
}

.filters select {
  padding: 8px 12px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a2e;
  color: #eee;
  font-size: 0.875rem;
  cursor: pointer;
}

.filters select:focus {
  outline: none;
  border-color: #4a9eff;
}

#clip-count {
  color: #888;
  font-size: 0.875rem;
  margin-left: auto;
}

/* Clips Grid */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 24px;
}

.clip-card {
  background: #16213e;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.clip-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.clip-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  background: #0f0f1a;
}

.clip-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clip-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.clip-card:hover .play-icon {
  opacity: 1;
}

.play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 16px solid #1a1a2e;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}

.clip-info {
  padding: 12px 16px;
}

.clip-camera {
  font-weight: 600;
  margin-bottom: 4px;
}

.clip-time {
  color: #888;
  font-size: 0.875rem;
}

/* Loading & Empty States */
.loading, .no-clips {
  text-align: center;
  padding: 48px 24px;
  color: #888;
}

/* Video Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-content {
  background: #16213e;
  border-radius: 16px;
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

#video-player {
  width: 100%;
  max-height: 60vh;
  background: black;
}

.video-info {
  padding: 20px;
}

.video-info h3 {
  margin-bottom: 8px;
}

.video-info p {
  color: #888;
  margin-bottom: 16px;
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

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

.btn-primary {
  background: #4a9eff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #3a8eef;
}

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

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.share-feedback {
  color: #4ade80;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
  header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

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

  #clip-count {
    margin-left: 0;
    text-align: center;
  }

  .clips-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}
