/*
 * Application CSS - Stone Medical Systems
 */

/* ==========================================================================
   Base Layout
   ========================================================================== */

.responsive-layout {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Main Content - default state, overridden by inline styles in nav */
.main-content {
  min-height: 100vh;
  padding: 20px 0;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .main-content {
    padding: 15px 0;
  }

  .container-fluid {
    padding: 0 10px;
  }

  .card {
    margin-bottom: 1rem;
  }

  .card-body dl.row {
    margin-bottom: 0;
  }

  .card-body dt.col-4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }

  .card-body dd.col-8 {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }

  .table-responsive {
    border: none;
  }

  .table td, .table th {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 576px) {
  .main-content {
    padding: 10px 0;
  }

  .container-fluid {
    padding: 0 5px;
  }

  .card-body .row.g-3 > .col-md-6 {
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
   UI Improvements
   ========================================================================== */

/* Card hover effects */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Focus improvements */
.btn:focus, .form-control:focus, .nav-link:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  outline: none;
}

/* Prevent zoom on iOS */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
  font-size: 16px !important;
}

/* Smooth scrolling */
.main-content {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Better tap highlights */
a, button, .btn {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Scrollbar styling */
.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Page transition animation */
.main-content > .container-fluid {
  animation: fadeIn 0.2s ease-in;
}

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

/* ==========================================================================
   Breadcrumbs - Modern App Style
   ========================================================================== */

.breadcrumb-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.breadcrumb-modern {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-modern-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-modern-link {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: white;
  border-radius: 8px;
  color: #495057;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.breadcrumb-modern-link:hover {
  background: #0d6efd;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(13, 110, 253, 0.3);
  border-color: #0d6efd;
}

.breadcrumb-modern-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(13, 110, 253, 0.2);
}

.breadcrumb-modern-current {
  padding: 6px 12px;
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.breadcrumb-separator {
  color: #6c757d;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Mobile responsive breadcrumbs */
@media (max-width: 768px) {
  .breadcrumb-container {
    padding: 10px 15px;
    border-radius: 10px;
  }

  .breadcrumb-modern {
    gap: 6px;
  }

  .breadcrumb-modern-link,
  .breadcrumb-modern-current {
    padding: 5px 10px;
    font-size: 0.85rem;
  }

  .breadcrumb-separator {
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  .breadcrumb-container {
    padding: 8px 12px;
  }

  .breadcrumb-modern-link span,
  .breadcrumb-modern-current {
    font-size: 0.8rem;
  }

  /* Hide home icon on very small screens */
  .breadcrumb-modern-link i.bi-house-door {
    display: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .breadcrumb-container {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .breadcrumb-modern-link {
    background: #374151;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .breadcrumb-modern-link:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
  }

  .breadcrumb-separator {
    color: #9ca3af;
  }
}

/* ==========================================================================
   PWA Specific
   ========================================================================== */

@media (display-mode: standalone) {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
  }
}

@supports (padding: max(0px)) {
  .main-content {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
}
