/* Custom CSS for Analytics Dashboard */

/* Mobile responsive fixes */
@media (max-width: 768px) {
  /* Stack dashboard header elements on mobile */
  .dashboard-header {
    margin-bottom: 1rem;
  }
  
  .dashboard-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .dashboard-header .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  .dashboard-header select,
  .dashboard-header button {
    width: 100% !important;
    margin-bottom: 0.5rem;
  }
  
  /* Make value boxes stack on mobile */
  .bslib-value-box {
    margin-bottom: 1rem;
  }
  
  /* Adjust card spacing */
  .card {
    margin-bottom: 1rem;
  }
  
  /* Make plots responsive */
  .plotly {
    width: 100% !important;
    height: auto !important;
  }
  
  /* Adjust data table for mobile */
  .dataTables_wrapper {
    overflow-x: auto;
  }
}

/* Login container styling */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0081A7 0%, #00AFB9 100%);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card .card {
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-card .card-header {
  background-color: #white;
  border-bottom: 2px solid #0081A7;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0081A7;
  text-align: center;
}

.login-card .form-group {
  margin-bottom: 1rem;
}

.login-card input {
  font-size: 16px !important; /* Prevent zoom on mobile */
}

.btn-block {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

/* Dashboard styling */
#dashboard_content {
  padding: 1rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dashboard-header .d-flex {
  gap: 0.5rem;
}

/* Value box tweaks */
.bslib-value-box {
  transition: transform 0.2s;
}

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

/* Card styling */
.card {
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 2px solid #0081A7;
  font-weight: 600;
  color: #0081A7;
}

/* Responsive charts */
.plotly {
  width: 100%;
}

/* Data table styling */
.dataTables_wrapper {
  font-size: 0.9rem;
}

.dataTables_wrapper table {
  width: 100% !important;
}

/* Alert styling */
.alert {
  margin-bottom: 1rem;
  border-radius: 0.25rem;
}

/* Button styling */
.btn-primary {
  background-color: #0081A7;
  border-color: #0081A7;
}

.btn-primary:hover {
  background-color: #00AFB9;
  border-color: #00AFB9;
}

/* Form styling for mobile */
@media (max-width: 768px) {
  input[type="text"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important; /* Prevent iOS zoom */
  }
}

/* User menu styling */
#user_menu {
  margin-left: auto;
}

#username_display {
  font-weight: 500;
  color: #0081A7;
}

/* Loading spinner */
.shiny-busy-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 129, 167, 0.9);
  color: white;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  z-index: 9999;
}
