/* ================================================================
   Project Cost Tracker — Custom Styles (Tailwind supplement)
   Only styles that Tailwind CDN cannot generate
   ================================================================ */

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

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

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

.animate-fade-in {
  animation: fadeIn 0.4s ease-out both;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out both;
}

.animate-shimmer {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Stagger delays */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }

/* Safe area for bottom nav on iOS */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Budget bar */
.budget-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}

.budget-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.budget-bar__fill--warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.budget-bar__fill--danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.timeline__item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline__dot {
  position: absolute;
  left: -1.625rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  background: #3b82f6;
  border: 3px solid #dbeafe;
  border-radius: 50%;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Before/After Slider */
.before-after-container {
  width: 100%;
  max-height: 600px;
  overflow: hidden;
}

.before-after-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.before-after-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.before-after-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  z-index: 2;
}

.before-after-overlay .before-after-img {
  width: 200%;
  max-width: none;
}

.before-after-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.before-after-handle-line {
  flex: 1;
  width: 3px;
  background: white;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.before-after-handle-circle {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.before-after-handle-circle svg {
  color: #374151;
  transform: rotate(90deg);
}

/* Print styles */
@media print {
  header, nav, .bottom-nav, .safe-area-bottom, button, .btn {
    display: none !important;
  }
  main {
    padding: 0 !important;
  }
  body {
    background: white !important;
  }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection */
::selection {
  background: #dbeafe;
  color: #1e3a8a;
}

/* Responsive table wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Box sizing */
:root {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

/* ================================================================
   Cookie Consent Banner
   ================================================================ */
@keyframes consentSlideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes consentSlideDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(100%); }
}

.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 1rem 1rem;
  pointer-events: none;
}

.consent-banner--visible {
  pointer-events: auto;
}

.consent-banner--visible .consent-banner__inner {
  animation: consentSlideUp 0.35s ease-out both;
}

.consent-banner--hiding .consent-banner__inner {
  animation: consentSlideDown 0.3s ease-in both;
}

.consent-banner__inner {
  max-width: 40rem;
  margin: 0 auto;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
}

.consent-banner__title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem;
}

.consent-banner__text {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #4b5563;
  margin: 0 0 0.75rem;
}

.consent-banner__details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: #3b82f6;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.75rem;
}

.consent-banner__details-toggle:hover {
  color: #2563eb;
}

.consent-banner__chevron {
  transition: transform 0.2s ease;
}

.consent-banner__details {
  border-top: 1px solid #e5e7eb;
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.consent-banner__category {
  padding: 0.5rem 0;
}

.consent-banner__category + .consent-banner__category {
  border-top: 1px solid #f3f4f6;
}

.consent-banner__category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.consent-banner__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #111827;
}

.consent-banner__checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}

.consent-banner__checkbox:disabled {
  opacity: 0.6;
  cursor: default;
}

.consent-banner__badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.consent-banner__badge--required {
  background: #ecfdf5;
  color: #059669;
}

.consent-banner__category-desc {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0.25rem 0 0 1.5rem;
  line-height: 1.4;
}

.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.consent-banner__btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.consent-banner__btn--primary {
  background: #2563eb;
  color: white;
}

.consent-banner__btn--primary:hover {
  background: #1d4ed8;
}

.consent-banner__btn--secondary {
  background: #f3f4f6;
  color: #374151;
}

.consent-banner__btn--secondary:hover {
  background: #e5e7eb;
}

.consent-banner__btn--ghost {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.consent-banner__btn--ghost:hover {
  background: #f9fafb;
  color: #374151;
}

.consent-banner__links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.consent-banner__links a {
  font-size: 0.6875rem;
  color: #9ca3af;
  text-decoration: none;
}

.consent-banner__links a:hover {
  color: #6b7280;
}

@media (max-width: 480px) {
  .consent-banner {
    padding: 0 0.5rem 0.5rem;
  }
  .consent-banner__inner {
    padding: 1rem;
    border-radius: 0.75rem;
  }
  .consent-banner__actions {
    flex-direction: column;
  }
  .consent-banner__btn {
    width: 100%;
  }
}

@media print {
  .consent-banner {
    display: none !important;
  }
}
