/* ============================================
   Air Purifier Portal - Production Styles
   ============================================ */

/* === Base Styles === */
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --border-radius: 0.5rem;
  --transition: all 0.3s ease-in-out;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--dark-color);
  background-color: #f5f7fa;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === Focus Styles === */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

/* === Navigation === */
.navbar {
  background: white !important;
  box-shadow: var(--box-shadow-sm);
  padding: 1rem 0;
  transition: var(--transition);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.navbar-brand:hover {
  transform: translateY(-2px);
  color: #0a58ca !important;
}

.nav-link {
  font-weight: 500;
  color: var(--dark-color) !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background-color: var(--light-color);
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

.nav-link.text-primary:hover {
  background-color: rgba(13, 110, 253, 0.1);
}

.nav-link.text-danger:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* === Cards === */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

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

.card-header {
  background-color: white;
  border-bottom: 2px solid var(--light-color);
  font-weight: 600;
  padding: 1rem 1.5rem;
}

.card-footer {
  background-color: var(--light-color);
  border-top: 1px solid #dee2e6;
}

/* === Product Cards === */
.product-card {
  height: 100%;
  transition: var(--transition);
}

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

.product-card .card-img-top {
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .card-img-top {
  transform: scale(1.05);
}

/* === Filter Sidebar === */
.filter-section {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.filter-section::-webkit-scrollbar {
  width: 6px;
}

.filter-section::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.filter-section::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.filter-section::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.filter-section .form-check {
  padding-left: 1.75rem;
}

.filter-section .form-check-input {
  margin-top: 0.25rem;
}

.filter-section .form-check-label {
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
}

.filter-section .form-check-label:hover {
  color: var(--primary-color);
}

.filter-section .badge {
  font-size: 0.75rem;
  padding: 0.25em 0.5em;
}

/* Sticky filter sidebar */
.sticky-top {
  position: sticky;
  z-index: 100;
}

/* Active filter tags */
.badge .bi-x {
  cursor: pointer;
  transition: var(--transition);
}

.badge .bi-x:hover {
  transform: scale(1.2);
}

/* Collapsible filter sections */
.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 0.875rem;
}

a[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

a[aria-expanded="false"] .toggle-icon {
  transform: rotate(0deg);
}

/* Filter section headers */
.card-body h6 a {
  width: 100%;
  padding: 0.5rem;
  margin: -0.5rem;
  border-radius: 0.25rem;
  transition: var(--transition);
}

.card-body h6 a:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

.card-body h6 a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Smooth collapse animation */
.collapse {
  transition: height 0.35s ease;
}

.collapsing {
  transition: height 0.35s ease;
}

/* Search box */
#searchInput {
  border-radius: 0.25rem 0 0 0.25rem;
}

#searchInput:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  border-color: var(--primary-color);
}

.input-group .btn {
  border-radius: 0;
}

.input-group .btn:last-child {
  border-radius: 0 0.25rem 0.25rem 0;
}

/* Price range inputs */
.input-group-sm .form-control {
  font-size: 0.875rem;
}

.input-group-sm .input-group-text {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

/* Quick price range buttons */
.btn-outline-secondary.btn-sm small {
  font-size: 0.75rem;
}

/* Sort dropdown */
.dropdown-menu {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  padding: 0.5rem 1rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: rgba(13, 110, 253, 0.1);
}

.dropdown-item.active {
  background-color: var(--primary-color);
  color: white;
}

.dropdown-item i {
  width: 1.25rem;
  display: inline-block;
}

.dropdown-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* === Buttons === */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-primary);
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

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

/* === Badges === */
.badge {
  padding: 0.5em 0.75em;
  font-weight: 500;
  border-radius: 0.375rem;
  font-size: 0.75em;
}

/* === Forms === */
.form-control,
.form-select {
  border-radius: var(--border-radius);
  border: 2px solid #e0e0e0;
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-check-input {
  width: 1.25em;
  height: 1.25em;
  border: 2px solid #dee2e6;
  transition: var(--transition);
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* === Tables === */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table thead {
  background-color: var(--light-color);
}

.table-hover tbody tr {
  transition: var(--transition);
}

.table-hover tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
  transform: scale(1.01);
}

/* === Alerts === */
.alert {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow-sm);
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: currentColor;
}

.alert-success::before { background-color: var(--success-color); }
.alert-danger::before { background-color: var(--danger-color); }
.alert-warning::before { background-color: var(--warning-color); }
.alert-info::before { background-color: var(--info-color); }

/* === Main Content === */
main {
  flex: 1 0 auto;
  padding-bottom: 3rem;
}

/* === Footer === */
.footer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
  flex-shrink: 0;
}

.footer h5 {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
}

.footer a:hover {
  color: white;
  transform: translateX(5px);
}

.footer .text-white-50:hover {
  color: white !important;
}

.footer .social-links a {
  transition: var(--transition);
}

.footer .social-links a:hover {
  transform: translateY(-3px);
  color: white !important;
}

.footer ul li {
  line-height: 1.8;
}

.footer .text-break {
  word-break: break-word;
  overflow-wrap: break-word;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1.5rem;
  margin-top: 2rem;
  text-align: center;
}

/* === Responsive Footer === */
@media (max-width: 768px) {
  .footer {
    padding: 2rem 0 1rem;
  }

  .footer h5 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .footer p.small,
  .footer ul li {
    font-size: 0.875rem;
  }

  .footer .social-links {
    gap: 1rem !important;
  }

  .footer .social-links i {
    font-size: 1.25rem !important;
  }

  .footer .col-lg-4,
  .footer .col-lg-2,
  .footer .col-lg-3 {
    margin-bottom: 2rem !important;
  }

  .footer-bottom {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .footer-bottom small {
    font-size: 0.75rem;
  }
}

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

/* === Utilities === */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient {
  background: var(--gradient-primary);
  color: white;
}

.shadow-custom {
  box-shadow: var(--box-shadow);
}

.rounded-custom {
  border-radius: var(--border-radius);
}

/* === Page Header === */
.page-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
}

.page-header h1 {
  font-weight: 700;
  color: var(--dark-color);
}

/* === Loading Spinner === */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* === Responsive === */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.25rem;
  }

  .card {
    margin-bottom: 1rem;
  }

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

/* === Print Styles === */
@media print {
  .navbar,
  .footer,
  .btn,
  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
  }
}

/* === Accessibility === */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* === Dark Mode Support (Optional) === */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if needed */
}
