/* CareSuite Admin - Modern UI Enhancements */

:root {
  /* Modern Color Palette */
  --cs-primary: #0066cc;
  --cs-primary-hover: #0052a3;
  --cs-secondary: #6c757d;
  --cs-success: #28a745;
  --cs-warning: #ffc107;
  --cs-danger: #dc3545;
  --cs-info: #17a2b8;
  
  /* Neutral Colors */
  --cs-gray-50: #f8f9fa;
  --cs-gray-100: #e9ecef;
  --cs-gray-200: #dee2e6;
  --cs-gray-300: #ced4da;
  --cs-gray-400: #adb5bd;
  --cs-gray-500: #6c757d;
  --cs-gray-600: #495057;
  --cs-gray-700: #343a40;
  --cs-gray-800: #212529;
  
  /* Spacing */
  --cs-border-radius: 8px;
  --cs-border-radius-lg: 12px;
  --cs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --cs-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --cs-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --cs-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Base Typography */
body {
  font-family: var(--cs-font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--cs-gray-700);
  background-color: #f5f7fa;
}

/* Enhanced Navbar */
.navbar-dark {
  background: var(--cs-primary) !important;
  box-shadow: var(--cs-shadow);
  border: none;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
  transform: translateY(-1px);
}

.dropdown-menu {
  border: none;
  box-shadow: var(--cs-shadow-lg);
  border-radius: var(--cs-border-radius);
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--cs-gray-50);
  color: var(--cs-primary);
}

/* Modern Hero Section (Jumbotron Replacement) */
.hero-section {
  background: white;
  color: var(--cs-gray-700);
  padding: 4rem 0 3rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--cs-gray-200);
}

.hero-section h1 {
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--cs-gray-800);
}

.hero-section p {
  font-size: 1.125rem;
  color: var(--cs-gray-600);
  margin-bottom: 1.5rem;
}

.hero-section .btn {
  box-shadow: var(--cs-shadow);
  border: none;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: var(--cs-border-radius);
  transition: all 0.3s ease;
}

.hero-section .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--cs-shadow-lg);
}

/* Card Enhancements */
.card {
  border: none;
  border-radius: var(--cs-border-radius-lg);
  box-shadow: var(--cs-shadow);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--cs-shadow-lg);
}

.card-header {
  background: var(--cs-gray-50);
  border-bottom: 1px solid var(--cs-gray-200);
  border-radius: var(--cs-border-radius-lg) var(--cs-border-radius-lg) 0 0 !important;
  font-weight: 600;
  color: var(--cs-gray-700);
}

/* List Group (Settings Menu) Enhancements */
.list-group {
  box-shadow: var(--cs-shadow);
  border-radius: var(--cs-border-radius-lg);
  overflow: hidden;
}

.list-group-item {
  border: none;
  border-bottom: 1px solid var(--cs-gray-100);
  font-weight: 500;
  transition: all 0.2s ease;
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item:hover {
  background-color: var(--cs-gray-50);
  color: var(--cs-primary);
  transform: translateX(4px);
}

.list-group-item.active {
  background: linear-gradient(135deg, var(--cs-primary) 0%, var(--cs-primary-hover) 100%);
  border-color: var(--cs-primary);
  color: white;
}

/* Table Enhancements */
.table {
  background: white;
}

.table thead th {
  background: var(--cs-gray-50);
  border-bottom: 2px solid var(--cs-gray-200);
  font-weight: 600;
  color: var(--cs-gray-700);
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  padding: 1rem 1.25rem;
}

.table tbody td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background-color: var(--cs-gray-50);
}

.table-responsive {
  box-shadow: var(--cs-shadow);
}

/* Card table specific styling */
.card .table {
  border: none;
  margin-bottom: 0;
}

.card .table thead th:first-child {
  border-top-left-radius: 0;
}

.card .table thead th:last-child {
  border-top-right-radius: 0;
}

/* DataTables standalone styling */
.dataTables_wrapper {
  background: white;
  border-radius: var(--cs-border-radius-lg);
  box-shadow: var(--cs-shadow);
  overflow: hidden;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  padding: 1rem;
  background: var(--cs-gray-50);
  border-bottom: 1px solid var(--cs-gray-200);
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: 1rem;
  background: var(--cs-gray-50);
  border-top: 1px solid var(--cs-gray-200);
}

.dataTables_wrapper .table {
  margin-bottom: 0;
  background: white;
}

/* Button Enhancements */
.btn {
  border-radius: var(--cs-border-radius);
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  height: calc(1.5em + 0.75rem + 4px); /* Match form-control height */
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--cs-primary);
  box-shadow: var(--cs-shadow-sm);
}

.btn-primary:hover {
  background: var(--cs-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--cs-shadow);
}

.btn-outline-primary {
  border: 2px solid var(--cs-primary);
  color: var(--cs-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--cs-primary);
  border-color: var(--cs-primary);
  color: white;
  transform: translateY(-1px);
}

.btn-outline-danger {
  border: 2px solid var(--cs-danger);
  color: var(--cs-danger);
  background: transparent;
}

.btn-outline-danger:hover {
  background: var(--cs-danger);
  border-color: var(--cs-danger);
  color: white;
  transform: translateY(-1px);
}

.btn-lg {
  height: calc(1.5em + 1rem + 4px);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm {
  height: calc(1.5em + 0.5rem + 4px);
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  white-space: nowrap;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Form Enhancements */
.form-control {
  border-radius: var(--cs-border-radius);
  border: 2px solid var(--cs-gray-200);
  transition: all 0.2s ease;
  font-size: 0.875rem;
  height: calc(1.5em + 0.75rem + 4px); /* Consistent height */
  padding: 0.375rem 0.75rem;
}

.form-control:focus {
  border-color: var(--cs-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-group label {
  font-weight: 600;
  color: var(--cs-gray-700);
  margin-bottom: 0.5rem;
}

/* File input improvements */
input[type="file"].form-control {
  height: calc(1.5em + 1.5rem + 4px); /* Taller for file inputs */
  padding: 0.75rem;
  line-height: 1.5;
}

/* Button height matching - sizes already defined above */

/* Input group alignment */
.input-group .form-control,
.input-group .btn {
  height: calc(1.5em + 0.75rem + 4px);
  border: 2px solid var(--cs-gray-200);
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  font-size: 0.875rem;
}

/* Input Group Seamless Styling */
.input-group > .form-control:not(:last-child),
.input-group > .input-group-prepend > .form-control,
.input-group > .input-group-prepend > .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .input-group-append > .form-control,
.input-group > .input-group-append > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group > .form-control:not(:last-child) {
  border-right: 0;
}

.input-group > .input-group-append > .btn,
.input-group > .input-group-prepend > .btn {
  border: 2px solid var(--cs-gray-200);
  margin-left: -2px;
  height: calc(1.5em + 0.75rem + 4px);
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.input-group > .input-group-append > .btn:hover,
.input-group > .input-group-prepend > .btn:hover {
  border-color: var(--cs-primary);
  z-index: 3;
}

.input-group > .form-control:focus {
  z-index: 3;
  border-color: var(--cs-primary);
}

.input-group > .form-control:focus + .input-group-append > .btn {
  border-color: var(--cs-primary);
}

/* Force exact height matching for input groups */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control,
.input-group .input-group-append .btn,
.input-group .input-group-prepend .btn {
  height: 38px !important;
  min-height: 38px;
  max-height: 38px;
  border-width: 2px;
  box-sizing: border-box;
}

/* Quill editor background */
.ql-container {
  background-color: white !important;
}

.ql-editor {
  background-color: white !important;
}

/* Container and Spacing */
main {
  background: #f5f7fa;
}

.container {
  max-width: 1200px;
}

/* Modern Footer */
.modern-footer {
  background: white;
  border-top: 1px solid var(--cs-gray-200);
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
}

.footer-brand {
  max-width: 350px;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.footer-logo:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.footer-description {
  color: var(--cs-gray-600);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.footer-heading {
  color: var(--cs-gray-800);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--cs-gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--cs-primary);
  transform: translateX(4px);
  text-decoration: none;
}

.footer-divider {
  border: none;
  height: 1px;
  background: var(--cs-gray-200);
  margin: 2rem 0 1.5rem;
}

.footer-copyright,
.footer-powered {
  font-size: 0.875rem;
  color: var(--cs-gray-500);
  margin-bottom: 0;
}

.footer-powered a {
  color: var(--cs-gray-600);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-powered a:hover {
  color: var(--cs-primary);
  text-decoration: none;
}

/* Flash Messages Enhancement */
.alert {
  border: none;
  border-radius: var(--cs-border-radius);
  box-shadow: var(--cs-shadow-sm);
  font-weight: 500;
}

/* Modal Enhancements */
.modal-content {
  border: none;
  border-radius: var(--cs-border-radius-lg);
  box-shadow: var(--cs-shadow-lg);
}

.modal-header {
  background: var(--cs-gray-50);
  border-bottom: 1px solid var(--cs-gray-200);
  border-radius: var(--cs-border-radius-lg) var(--cs-border-radius-lg) 0 0;
}

.modal-title {
  font-weight: 600;
  color: var(--cs-gray-700);
}

/* App Icons */
.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--cs-gray-50);
  border-radius: var(--cs-border-radius);
  margin-right: 1rem;
}

.app-icon img,
.app-icon svg {
  transition: all 0.3s ease;
}

.card:hover .app-icon img,
.card:hover .app-icon svg {
  transform: scale(1.1);
}

/* Bootstrap 4 compatibility - use mr-3 instead of me-3 */
.me-3 {
  margin-right: 1rem !important;
}

/* Utility Classes */
.shadow-modern {
  box-shadow: var(--cs-shadow);
}

.shadow-modern-lg {
  box-shadow: var(--cs-shadow-lg);
}

.rounded-modern {
  border-radius: var(--cs-border-radius-lg) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0 2rem;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .list-group-item:hover {
    transform: none;
  }
  
  .table tbody tr:hover {
    transform: none;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}