/* GeoCamera-specific styles
 *
 * Layout: The Camera app uses position:absolute overlays for header/controls
 * on top of a full-viewport video container. GeoCamera's extra UI (geo controls,
 * geo status) must also be absolute/fixed overlays — NOT in-flow —
 * so they don't push the video container down and clip the bottom controls.
 * Group selector lives in the info-modal.
 */

.geo-controls {
  position: absolute;
  top: 48px; /* below camera-header */
  left: 0;
  right: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  justify-content: center;
  z-index: 100;
}

.btn--geo {
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-height: 44px;
}

.btn--geo:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn--geo.active {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.7);
}

/* Geo Status — the custom element itself must be positioned out of flow */
geo-status {
  position: absolute;
  top: 96px; /* below geo-controls */
  left: 0;
  right: 0;
  z-index: 99;
  pointer-events: none;
}

.geo-status-panel {
  padding: 0.5rem 1rem;
  margin: 0 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  pointer-events: auto;
}

.geo-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.geo-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.geo-status-indicator.active {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
}

.geo-status-row--clickable {
  cursor: pointer;
  pointer-events: auto;
}

.geo-status-row--clickable:hover .geo-status-value {
  color: #6366f1;
  text-decoration: underline;
}

.geo-status-label {
  color: rgba(255, 255, 255, 0.5);
  min-width: 5rem;
}

.geo-status-value {
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Permission Prompt Overlay */
.permission-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.permission-dialog {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
  color: #fff;
}

.permission-dialog h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.permission-dialog p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.permission-scope {
  font-size: 0.8rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.permission-ttl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.ttl-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}

.ttl-select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
}

.permission-autorenew {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.permission-autorenew input[type="checkbox"] {
  accent-color: #6366f1;
}

.permission-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.permission-actions .btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 44px;
}

.btn--deny {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}

.btn--location {
  background: rgba(234, 179, 8, 0.8);
  color: #000;
}

.btn--full {
  background: rgba(34, 197, 94, 0.8);
  color: #fff;
}

/* Grants Modal */
.grants-modal {
  max-height: 80vh;
}

.grants-content {
  max-height: 50vh;
  overflow-y: auto;
}

.grants-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 1.5rem;
  font-size: 0.9rem;
}

.grant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.grant-row:last-child {
  border-bottom: none;
}

.grant-info {
  flex: 1;
  min-width: 0;
}

.grant-name {
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grant-row.grant-status--connected .grant-name::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.grant-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.grant-scope {
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

.grant-scope--full {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.grant-scope--location {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.grant-expiry {
  color: rgba(255, 255, 255, 0.5);
}

.grant-expiry--expired {
  color: rgba(239, 68, 68, 0.8);
}

.grant-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.grant-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.grant-toggle input {
  accent-color: #6366f1;
}

.grant-toggle-label {
  user-select: none;
}

.btn--revoke {
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn--revoke:hover {
  background: rgba(239, 68, 68, 0.3);
}
