/* Shadcn-inspired styling with Bootstrap integration */

:root {
  /* Light mode colors */
  --bs-primary: #0f172a;
  --bs-secondary: #64748b;
  --bs-success: #059669;
  --bs-info: #0ea5e9;
  --bs-warning: #d97706;
  --bs-danger: #dc2626;
  --bs-light: #f8fafc;
  --bs-dark: #1e293b;
  
  /* Custom shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Border radius */
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --radius-lg: 0.75rem;
}

/* Dark mode colors */
[data-bs-theme="dark"] {
  --bs-primary: #f1f5f9;
  --bs-secondary: #94a3b8;
  --bs-success: #10b981;
  --bs-info: #38bdf8;
  --bs-warning: #f59e0b;
  --bs-danger: #ef4444;
  --bs-light: #1e293b;
  --bs-dark: #f8fafc;
}

/* Global styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Enhanced card styles */
.card {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  font-weight: 600;
}

/* Service card styles */
.service-card {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.plan-selector {
  font-size: 0.875rem;
  transition: all 0.3s ease;
  border: 1px solid var(--bs-border-color);
}

.plan-selector:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Favorites styles */
.favorite-item {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  background: var(--card-bg);
}

.favorite-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.favorite-item.has-access {
  border-left: 4px solid var(--bs-success);
}

.favorite-item.no-access {
  border-left: 4px solid var(--bs-danger);
}

.content-selector-item {
  cursor: pointer;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--radius);
  padding: 0.75rem;
  transition: all 0.3s ease;
  background: var(--card-bg);
  position: relative;
}

.content-selector-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  border-color: var(--bs-primary);
}

.content-selector-item.selected {
  border-color: var(--bs-success);
  background-color: rgba(var(--bs-success-rgb), 0.1);
}

.content-selector-item .selection-checkbox {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.content-selector-item:hover .selection-checkbox,
.content-selector-item.selected .selection-checkbox {
  opacity: 1;
}

.service-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  color: white;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  display: inline-block;
}

/* Bundle optimization styles */
.optimization-suggestions .alert {
  border-left: 4px solid;
}

.inefficient-service {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 1rem;
}

.inefficient-service:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.similar-content {
  background-color: var(--bs-light);
  padding: 0.5rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--bs-primary);
}

.cost-comparison {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1rem 0;
}

.cost-before, .cost-after {
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius);
  margin: 0.5rem;
}

.cost-before {
  background-color: rgba(var(--bs-danger-rgb), 0.1);
  border: 2px solid var(--bs-danger);
}

.cost-after {
  background-color: rgba(var(--bs-success-rgb), 0.1);
  border: 2px solid var(--bs-success);
}

.savings-highlight {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  margin: 1rem 0;
  font-weight: bold;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Collapsible section styles */
.collapse-icon {
  transition: transform 0.3s ease;
}

.collapse-icon[aria-expanded="false"] {
  transform: rotate(-90deg);
}

.btn-link:focus {
  box-shadow: none;
}

/* Ensure collapsible buttons take full width */
.card-header .btn-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.potential-savings-badge {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 0.5rem;
  border-radius: var(--radius);
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: bold;
}

.service-category {
  border-bottom: 1px solid rgba(var(--bs-gray-300-rgb), 0.3);
  padding-bottom: 1.5rem;
}

.service-category:last-child {
  border-bottom: none;
}

.category-title {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  position: relative;
}

.category-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 40px;
  height: 3px;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
}

.service-logo {
  border-radius: 4px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

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

.service-card.selected {
  border-color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.service-card .card-body {
  padding: 1rem;
}

.service-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bs-success);
}

.service-features {
  font-size: 0.875rem;
  color: var(--bs-secondary);
}

/* Cost summary styles */
.cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

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

.cost-total {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.savings-badge {
  background: linear-gradient(135deg, var(--bs-success), var(--bs-info));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  margin-top: 1rem;
  display: inline-block;
}

/* Content analysis styles */
.content-coverage {
  position: relative;
  background: var(--bs-light);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.progress {
  height: 0.75rem;
  border-radius: var(--radius);
  background-color: var(--bs-secondary);
}

.progress-bar {
  border-radius: var(--radius);
  transition: width 0.6s ease;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.content-item {
  background: var(--bs-light);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--bs-info);
  transition: all 0.3s ease;
}

.content-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.content-unavailable {
  opacity: 0.6;
  border-left-color: var(--bs-secondary);
}

/* Button enhancements */
.btn {
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-outline-secondary {
  --bs-btn-color: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-light);
  --bs-btn-hover-border-color: var(--bs-primary);
}

/* Dark mode toggle */
#darkModeToggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#darkModeToggle:hover {
  transform: rotate(15deg);
}

/* Navbar enhancements */
.navbar {
  backdrop-filter: blur(8px);
  background-color: rgba(var(--bs-light-rgb), 0.95) !important;
}

[data-bs-theme="dark"] .navbar {
  background-color: rgba(var(--bs-dark-rgb), 0.95) !important;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Footer styles */
footer {
  margin-top: auto;
  background-color: var(--bs-light) !important;
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bs-light) 25%, rgba(var(--bs-secondary-rgb), 0.1) 50%, var(--bs-light) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .display-4 {
    font-size: 2rem;
  }
  
  .service-card .card-body {
    padding: 0.75rem;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
  }
}

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

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

.slide-up {
  animation: slideUp 0.4s ease-out;
}

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

/* Accessibility improvements */
.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;
}

/* Focus states */
.service-card:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .navbar,
  footer,
  #darkModeToggle {
    display: none !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
}
