/* style.css - Premium dark glassmorphism design */

/* Global reset & font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, hsl(220, 15%, 12%), hsl(220, 15%, 18%));
  color: #e0e0e0;
  overflow-x: hidden;
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  position: relative;
}

h1,
h2 {
  font-weight: 600;
  color: #fafafa;
  text-align: center;
}

.glass {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.5rem;
  width: 100%;
  max-width: 800px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.camera-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

video {
  width: 100%;
  max-width: 640px;
  border-radius: 8px;
  background: #000;
}

.btn {
  background: linear-gradient(135deg, hsl(210, 70%, 55%), hsl(210, 70%, 45%));
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 120, 255, 0.3);
}

.results-section table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.results-section th,
.results-section td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: middle;
}

/* Editable Cells */
.editable {
  position: relative;
  cursor: text;
  transition: background-color 0.2s;
  border-radius: 4px;
}

.editable:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.editable:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1px hsl(210, 70%, 55%);
}

/* Save Indicator */
.save-flash {
  animation: flashGreen 1s ease-out;
}

@keyframes flashGreen {
  0% {
    background-color: rgba(74, 222, 128, 0.3);
  }

  100% {
    background-color: transparent;
  }
}

/* Delete Button */
.delete-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.results-section th {
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.results-section tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Sidebar & Settings */
.settings-toggle {
  position: absolute;
  top: 0;
  right: 1rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}

.settings-toggle:hover {
  color: #fff;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  /* Hidden by default */
  width: 350px;
  height: 100%;
  background: rgba(30, 35, 45, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border-radius: 0;
  /* Override glass radius */
}

.sidebar.open {
  right: 0;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.sidebar-header h3 {
  font-size: 1.5rem;
  color: #fff;
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.sidebar-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #ccc;
}

.input-group input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: hsl(210, 70%, 55%);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #666;
  transition: background-color 0.3s;
}

.dot.active {
  background-color: #4ade80;
  /* Green */
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

/* AI Status Badge */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.ai-badge:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.ai-badge .icon {
  font-size: 1.1rem;
}

.ai-badge .text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.ai-badge.active {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.4);
}

.ai-badge.active .text {
  color: #4ade80;
}

/* Header Section */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 2rem;
  position: relative;
  gap: 1rem;
}

.header-left {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.header-center {
  flex: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.app-logo {
  height: 50px;
  width: auto;
  display: block;
  transition: transform 0.2s;
}

.logo-link:hover .app-logo {
  transform: scale(1.05);
}

.github-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.github-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.github-link:hover {
  color: #fff;
}

.host-msg {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  white-space: nowrap;
}

.privacy-badge {
  font-size: 0.85rem;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .header-section {
    flex-direction: column;
    gap: 1.5rem;
  }

  .header-left,
  .header-right {
    justify-content: center;
    flex: auto;
  }

  .github-container {
    align-items: center;
  }
}

/* Sidebar Updates */
select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: hsl(210, 70%, 55%);
}

.validation-msg {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  min-height: 1.2em;
}

.validation-msg.valid {
  color: #4ade80;
}

.validation-msg.invalid {
  color: #ef4444;
}

/* Export Actions */
.export-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Promo Footer */
.promo-footer {
  margin-top: 2rem;
  text-align: center;
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.05), rgba(30, 35, 45, 0.9));
  padding: 2rem;
}

.promo-content h3 {
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.tagline {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.promo-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.promo-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.divider {
  color: rgba(255, 255, 255, 0.3);
}

.promo-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.promo-link:hover {
  color: #fff;
  text-decoration: underline;
}

.promo-link.highlight {
  color: #4ade80;
  font-weight: 600;
  background: rgba(74, 222, 128, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.promo-link.highlight:hover {
  background: rgba(74, 222, 128, 0.2);
  text-decoration: none;
}

@media (max-width: 600px) {
  .container {
    padding: 0.5rem;
  }

  .btn {
    width: 100%;
  }

  .sidebar {
    width: 100%;
    right: -100%;
  }

  .export-actions {
    flex-direction: column;
  }
}