/* Luna AI Health Custom Styles */

/* Font size customizations based on reference file */
body {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 0.855rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: left;
  background-color: #fff;
}

/* Brand and Logo */
.brand-image {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.brand-image:hover {
  opacity: 1;
}

/* Custom color scheme */
:root {
  --luna-primary: #007bff;
  --luna-secondary: #6c757d;
  --luna-success: #28a745;
  --luna-danger: #dc3545;
  --luna-warning: #ffc107;
  --luna-info: #17a2b8;
  --luna-light: #f8f9fa;
  --luna-dark: #343a40;
}

/* Button customizations from reference file */
.btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.855rem;
  transition: all 0.2s ease;
}

.btn-primary {
  font-size: 0.855rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-secondary {
  font-size: 0.8rem;
}

.btn-sm {
  font-size: 0.75rem;
}

.btn-lg {
  font-size: 1rem;
}

.btn-group .btn {
  font-size: 0.8rem;
}

.btn .fas,
.btn .far,
.btn .fab {
  font-size: 0.855rem;
}

.btn-slim {
  height: 1.8rem;
  font-size: 0.855rem;
  padding: 0.2rem;
}

/* Dashboard cards */
.small-box {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.small-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Audio player enhancements */
audio {
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Event level badges */
.badge-emergency {
  background-color: #dc3545;
  color: white;
}

.badge-warning {
  background-color: #ffc107;
  color: #212529;
}

.badge-normal {
  background-color: #28a745;
  color: white;
}

/* Device status indicators */
.device-status-online {
  color: #28a745;
}

.device-status-inactive {
  color: #ffc107;
}

.device-status-offline {
  color: #dc3545;
}

/* Dropzone customization */
.dropzone {
  border: 2px dashed #007bff;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

.dropzone:hover {
  border-color: #0056b3;
  background: #e9ecef;
}

.dropzone .dz-message {
  text-align: center;
  margin: 2em 0;
}

.dropzone .dz-icon {
  color: #007bff;
  margin-bottom: 10px;
}

/* Data tables enhancements - removed border-radius */
.dataTables_wrapper .dataTables_filter input {
  padding: 5px 15px;
}

.dataTables_wrapper .dataTables_length select {
  /* Use default AdminLTE select styling */
}

/* DataTables font size from reference */
table.dataTable tbody th, table.dataTable tbody td {
  padding: 7px;
  font-size: 0.855rem;
}

/* Modal enhancements from reference */
.modal {
  text-align: center;
}

.modal-title {
  font-size: 1.25rem;
}

.modal::before {
  margin-top: -25rem;
  content: "";
  display: inline-block;
  height: 100%;
  margin-right: -4px;
  vertical-align: middle;
  horiz-align: center;
  max-width: unset !important;
  right: 0;
}

.modal-dialog {
  display: inline-block;
  text-align: left;
  vertical-align: middle;
  horiz-align: center;
  max-width: unset !important;
  right: 0;
}

.modal-body {
  min-width: 30rem;
}

.modal-content {
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
  border-bottom: 1px solid #dee2e6;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
}

/* Form enhancements - removed border-radius for better select display */
.form-control {
  border: 1px solid #ddd;
  font-size: 0.855rem;
  padding: 0.375rem 0.75rem;
}

.form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Remove input-group rounded corners that interfere with selects */
.input-group-text {
  border: 1px solid #ddd;
  background-color: #f8f9fa;
}

/* Card enhancements */
.card {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

.card-header .card-title {
  color: white;
  font-weight: 600;
}

/* Login page specific styles */
.login-page, .register-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: cover;
  min-height: 100vh;
}

.login-box {
  width: 400px;
  margin: 7% auto;
}

.login-logo {
  text-align: center;
  margin-bottom: 25px;
}

.login-logo a {
  color: white;
  font-size: 35px;
  font-weight: 300;
  text-decoration: none;
}

.login-logo img {
  margin-bottom: 10px;
}

.login-card-body {
  padding: 30px;
}

.login-box-msg {
  margin: 0 0 20px 0;
  text-align: center;
  color: #666;
  font-size: 0.855rem;
}

.white {
  color: white;
}

.text-red {
  color: #dc3545;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.forgot-password {
  text-align: center;
  margin-top: 20px;
}

.forgot-password a {
  color: #667eea;
  text-decoration: none;
}

.forgot-password a:hover {
  text-decoration: underline;
}

.loading {
  display: none;
}

.loading.show {
  display: inline-block;
}

/* Sidebar enhancements */
.main-sidebar {
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.nav-sidebar .nav-link {
  margin: 2px 8px;
  transition: all 0.2s ease;
}

.nav-sidebar .nav-link:hover {
  background-color: rgba(255,255,255,0.1);
  transform: translateX(5px);
}

.nav-sidebar .nav-link.active {
  background-color: #007bff;
  color: white;
}

/* Notification enhancements */
.navbar-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Chart container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
}

.status-online {
  background-color: #28a745;
  animation: blink 2s infinite;
}

.status-offline {
  background-color: #dc3545;
}

.status-inactive {
  background-color: #ffc107;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0.3;
  }
}

/* Audio file list enhancements */
.audio-file-item {
  border-left: 4px solid transparent;
  transition: border-color 0.3s ease;
}

.audio-file-item.emergency {
  border-left-color: #dc3545;
}

.audio-file-item.warning {
  border-left-color: #ffc107;
}

.audio-file-item.normal {
  border-left-color: #28a745;
}

/* Device grid view */
.device-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.device-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.device-card .card-body {
  text-align: center;
}

.device-icon {
  font-size: 3rem;
  color: #007bff;
  margin-bottom: 15px;
}

/* Organization cards */
.org-card {
  overflow: hidden;
  transition: all 0.3s ease;
}

.org-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Event level color picker */
.color-picker-container {
  position: relative;
}

.color-preview {
  width: 40px;
  height: 38px;
  border: 1px solid #ced4da;
  display: inline-block;
  vertical-align: top;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .small-box .inner h3 {
    font-size: 1.5rem;
  }

  .card-tools .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
  }

  .table-responsive {
    font-size: 0.875rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }
}

/* Print styles */
@media print {
  .main-sidebar,
  .main-header,
  .main-footer,
  .card-tools,
  .btn {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .card {
    background-color: #2d3748;
    color: #e2e8f0;
  }

  .modal-content {
    background-color: #2d3748;
    color: #e2e8f0;
  }

  .form-control {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
  }

  .table {
    color: #e2e8f0;
  }

  .table th,
  .table td {
    border-color: #4a5568;
  }
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid;
  }

  .card {
    border: 2px solid #000;
  }

  .badge {
    border: 1px solid;
  }
}

.luna.middle-button-margin {
  margin-left: 10px;
  margin-right: 10px;
}
