/* Modern Design System for KatBox Drone Portal */

:root {
  /* Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --background: #ffffff;
  --surface: #f8fafc;
  --surface-elevated: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.header {
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text-primary);
}

.logo img {
  height: 42px;
  width: auto;
}

.logo-text {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--primary);
}

/* User Dropdown */
.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.user-button:hover {
  background: var(--surface-elevated);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}


.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-2);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--surface);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

/* Main Content */
.main {
  padding: var(--space-8) 0;
  min-height: calc(100vh - 80px);
}

.card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.card-header {
  margin-bottom: var(--space-6);
}

.card-title {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Video Player */
.video-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: var(--space-6) 0;
  border: none !important;
  outline: none !important;
  background: transparent !important;
}

.video-player {
  width: 100%;
  max-height: 70vh;
  background: #000 !important;
  border-radius: 0;
  box-shadow: var(--shadow-md);
  border: none !important;
  outline: none !important;
  display: block;
  object-fit: cover;
  margin: 0 !important;
  padding: 0 !important;
}

/* Remove any default video styling */
video {
  border: none !important;
  outline: none !important;
  background: #000 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Remove card border from video container */
.card .video-container {
  border: none !important;
  background: transparent !important;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  background: var(--surface-elevated);
  color: var(--text-primary);
  transition: all 0.2s ease;
  height: 48px;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-button {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-button:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-sm);
}

/* Inline Form Layout */
.form-inline {
  display: flex;
  align-items: end;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.form-inline .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.form-inline .form-label {
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.form-inline .form-input {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  height: 40px;
}

.form-inline .btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  white-space: nowrap;
  width: auto;
  height: 40px;
}

/* Checkbox Styling */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.form-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.form-checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.form-checkbox:checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.form-button:active {
  transform: translateY(1px);
}

/* Snackbar */
/* Footer */
.footer {
  position: fixed;
  bottom: var(--space-3);
  right: var(--space-3);
  z-index: 100;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-separator {
  color: var(--color-text-muted);
  opacity: 0.5;
}

.snackbar {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 400px;
  text-align: center;
}

.snackbar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.snackbar.error {
  background: var(--error);
}

.snackbar.success {
  background: var(--success);
}

.snackbar.warning {
  background: var(--warning);
}

/* Snackbar Content */
.snackbar-message {
  flex: 1;
  line-height: 1.4;
}

.snackbar-close,
.snackbar-copy {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s ease;
  margin-left: var(--space-2);
  flex-shrink: 0;
  line-height: 1;
  text-align: center;
}

.snackbar-close:hover,
.snackbar-copy:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.snackbar-copy {
  font-size: 16px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.3) !important;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.snackbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.badge.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.badge.success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

/* Responsive */
@media (max-width: 768px) {
  /* Header adjustments */
  .header-content {
    padding: var(--space-3) var(--space-4);
  }
  
  
  .user-button {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }
  
  .user-button span {
    display: none;
  }
  
  .user-button svg:first-child {
    margin-right: 0;
  }
  
  /* Main content */
  .main {
    padding: var(--space-4) var(--space-3);
  }
  
  .container {
    padding: 0;
    max-width: 100%;
  }
  
  /* Cards */
  .card {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }
  
  /* Video player */
  .video-player {
    max-height: 50vh;
    border-radius: 0;
  }
  
  .video-container {
    margin: var(--space-4) 0;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: var(--space-4);
  }
  
  .form-control {
    padding: var(--space-3);
    font-size: var(--text-base);
  }
  
  .btn {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    width: 100%;
  }
  
  /* Tables */
  .table-responsive {
    font-size: var(--text-sm);
  }
  
  .table th,
  .table td {
    padding: var(--space-2);
  }
  
  /* User dropdown */
  .user-dropdown {
    right: var(--space-3);
    left: auto;
    min-width: 200px;
  }
  
  /* Snackbar mobile */
  .snackbar {
    min-width: 90%;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    bottom: var(--space-4);
  }
  
  .snackbar.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .header-content {
    padding: var(--space-2) var(--space-3);
  }
  
  .main {
    padding: var(--space-3) var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .card {
    padding: var(--space-3);
  }
  
  .video-player {
    max-height: 40vh;
  }
  
  .user-dropdown {
    right: var(--space-2);
    min-width: 180px;
  }
  
  .dropdown-item {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }
  
  .dropdown-item svg {
    width: 14px;
    height: 14px;
  }
  
  /* Footer - make it sticky at bottom on mobile */
  .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-3);
    text-align: center;
    background: var(--color-background);
    border-top: 1px solid var(--color-border);
    z-index: 50;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  /* Add bottom padding to body to prevent content from being hidden behind footer */
  body {
    padding-bottom: 60px;
  }
  
  /* Admin page - footer should be at bottom of content, not fixed */
  body.admin-page .footer {
    position: static;
    margin-top: var(--space-6);
    border-top: 1px solid var(--color-border);
  }
  
  body.admin-page {
    padding-bottom: 0;
  }
  
}
