:root {
  --primary-color: #0d6efd;
  --primary-dark: #0a58ca;
  --secondary-color: #6c757d;
  --background-light: #f8f9fa;
  --text-dark: #212529;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --card-hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius-default: 12px;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background-color: var(--background-light);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
}

/* Navbar Customization */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

.navbar-brand, .navbar-nav .nav-link {
  color: white !important;
  font-weight: 500;
}

.navbar-nav .nav-link:hover {
  opacity: 0.9;
}

/* Cards */
.card-custom {
  background: white;
  border: none;
  border-radius: var(--radius-default);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.card-custom:hover {
  /* transform: translateY(-2px); */ /* Optional: subtle lift */
  box-shadow: var(--card-hover-shadow);
}

.card-header-custom {
  background-color: white;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1.5rem;
}

.card-body-custom {
  padding: 1.5rem;
}

/* Buttons */
.btn {
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

/* Forms */
.form-control, .form-select {
  border-radius: 8px;
  padding: 0.6rem 1rem;
  border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Table */
.table-custom thead th {
  background-color: #f1f3f5;
  border-bottom: none;
  color: #495057;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table-custom tbody tr {
  transition: background-color 0.1s;
}

.table-custom tbody tr:hover {
  background-color: rgba(0,0,0,0.02);
}

/* Footer */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  background-color: white;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.03);
}

/* Utility */
.shadow-soft {
  box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
}

.radius-lg {
  border-radius: var(--radius-default) !important;
}

/* Video & Camera Container */
.video-container {
  position: relative;
  border-radius: var(--radius-default);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background-color: #000;
}

#video {
  display: block;
  transform: scaleX(-1); /* Espelhar vídeo */
}

#face-status {
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
  border-radius: 6px;
  background-color: rgba(255,255,255,0.9);
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  body {
    margin-bottom: 80px; /* More space for footer or bottom navigation */
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card-header-custom {
    padding: 1rem;
  }

  .card-body-custom {
    padding: 1rem;
  }

  .display-5 {
    font-size: 1.8rem;
  }

  /* Make inputs and buttons larger for touch */
  .form-control, .form-select, .btn {
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .btn-lg {
    padding: 0.8rem 1rem;
  }

  /* Adjust Camera Container */
  .video-container {
    margin-bottom: 1rem;
    max-height: 60vh; /* Prevent camera from taking too much vertical space */
  }
  
  #video {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

/* Page Headers */
.page-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 1rem;
}

.page-title {
  color: var(--primary-dark);
  font-weight: 700;
}
