/* Vidtest simple stylesheet */

:root {
  --color-bg: #f8f9fa;
  --color-text: #212529;
  --color-muted: #6c757d;
  --color-primary: #0d6efd;
  --color-primary-hover: #0b5ed7;
  --color-danger: #dc3545;
  --color-danger-hover: #bb2d3b;
  --color-success: #198754;
  --color-warning: #ffc107;
  --color-border: #dee2e6;
  --radius: 0.375rem;
  --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover {
  background: #e9ecef;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--color-border);
}

.user-name {
  font-weight: 600;
  color: var(--color-text);
}

.user-role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
  background: #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.btn-logout {
  width: auto;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Forms */

label,
input,
select,
button {
  display: block;
  width: 100%;
}

label {
  margin: 0.75rem 0 0.25rem;
  font-weight: 500;
}

input,
select {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
}

input:focus,
select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

.password-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.password-wrapper input {
  flex: 1;
}

.password-wrapper .toggle-btn {
  width: auto;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.checks {
  border: none;
  padding: 0;
  margin: 1rem 0;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-weight: normal;
}

.checks input {
  width: auto;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  width: auto;
  line-height: 1.25;
}

.btn:hover {
  background: #e9ecef;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--color-danger-hover);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.inline-form {
  display: inline;
}

/* Tables */

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table th {
  background: #e9ecef;
  font-weight: 600;
}

.table .actions {
  white-space: nowrap;
}

/* Cards / helpers */

.auth-card {
  max-width: 360px;
  margin: 3rem auto;
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.empty {
  color: var(--color-muted);
  font-style: italic;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--color-muted);
  color: #fff;
}

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

.badge-secondary {
  background: var(--color-muted);
}

/* Flash messages */

.flash-messages {
  margin: 1rem 0;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.flash-success {
  background: #d1e7dd;
  color: #0f5132;
}

.flash-danger {
  background: #f8d7da;
  color: #842029;
}

.flash-warning {
  background: #fff3cd;
  color: #664d03;
}

.flash-info {
  background: #cff4fc;
  color: #055160;
}

/* Metadata */

.metadata {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metadata dt {
  font-weight: 600;
  color: var(--color-muted);
}

.metadata dd {
  margin: 0;
  word-break: break-all;
}

.token-details {
  margin-top: 1.5rem;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#video-container {
  min-height: 240px;
  height: calc(100vh - 280px);
  max-height: 560px;
  background: #0f0f1a;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  margin: 1rem 0;
}

#remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#local-video {
  width: 30%;
  max-width: 200px;
  aspect-ratio: 4 / 3;
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 0.5rem;
  border: 2px solid #fff;
  background: #000;
  z-index: 10;
  object-fit: cover;
}

.call-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius);
  color: #fff;
  z-index: 20;
  text-align: center;
  padding: 1rem;
}

.call-overlay p {
  margin: 0.25rem 0;
}

.receive-only-banner {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  z-index: 15;
}
