/**
 * Feelter.io Custom Stylesheet
 * Custom styles and Tailwind CSS overrides
 */

/* ===== CUSTOM CSS VARIABLES ===== */
:root {
  /* Brand Colors */
  --primary-dark: #000958;
  --primary-blue: #1846FD;
  --accent-yellow: #FFC93E;
  --bg-light: #ffffff;
  --text-dark: #333333;
  --text-gray: #666666;
  --text-light: #999999;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --border-color: rgba(0, 0, 0, 0.1);
  
  /* Fonts */
  --main-font: 'Noto Sans', sans-serif;
  --accent-font: 'Playfair Display', serif;
}

/* ===== FONT UTILITIES ===== */
.font-accent {
  font-family: var(--accent-font);
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ===== MEGA MENU STYLES ===== */
.group:hover .group-hover\:visible {
  visibility: visible;
}

.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

/* Enhanced mega menu animations */
nav .group:hover > div > div {
  animation: slideDown 0.3s ease-out;
}

/* Mega menu shadow enhancement */
nav .group > div > div {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== CHART CONTAINER STYLES ===== */
.chart-container {
  position: relative;
  margin: 2rem auto;
  min-height: 350px;
  height: auto;
  width: 100%;
  background: var(--light-gray);
  border-radius: 8px;
  padding: 1.5rem;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart-container svg {
  width: 100%;
  height: auto;
  min-height: 350px;
  overflow: visible;
  display: block;
}

/* Ensure chart elements are not clipped */
.chart-container * {
  overflow: visible;
}

/* Special handling for specific chart types */
#trustArchitecture {
  min-height: 450px;
}

#cakePerformanceCascade {
  min-height: 450px;
}

#floristCompetencies {
  min-height: 400px;
}

/* Ensure proper spacing for axis labels */
.chart-container {
  padding-bottom: 2rem;
}

/* ===== D3.JS CHART STYLES ===== */
.d3-tooltip {
  position: absolute;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Chart axis styles */
.axis {
  font-size: 12px;
}

.axis path,
.axis line {
  fill: none;
  stroke: #666;
  shape-rendering: crispEdges;
}

.axis text {
  fill: #666;
  font-family: var(--main-font);
}

/* Ensure SVG elements don't get clipped */
svg {
  overflow: visible !important;
}

svg text {
  pointer-events: none;
}

/* Better handling for rotated axis labels */
.axis text[transform] {
  text-anchor: end !important;
}

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
}

/* ===== FOCUS STYLES ===== */
*:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* ===== SELECTION STYLES ===== */
::selection {
  background-color: var(--primary-blue);
  color: white;
}

::-moz-selection {
  background-color: var(--primary-blue);
  color: white;
}

/* ===== SCROLLBAR STYLES ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--medium-gray);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-gray);
}

/* ===== MOBILE MENU ANIMATION ===== */
#mobileMenu {
  transition: max-height 0.3s ease-out;
}

#mobileMenu.show {
  display: block;
  animation: slideDown 0.3s ease-out;
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ===== BADGE STYLES ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== TABLE ENHANCEMENTS ===== */
table tbody tr {
  transition: background-color 0.2s ease;
}

table tbody tr:hover {
  background-color: var(--light-gray);
}

/* ===== LOADING SPINNER ===== */
.spinner {
  border: 3px solid var(--light-gray);
  border-top: 3px solid var(--primary-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* ===== PRINT STYLES ===== */
@media print {
  nav, footer, .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  a {
    text-decoration: underline;
  }
  
  .chart-container {
    page-break-inside: avoid;
  }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .chart-container {
    min-height: 300px;
    padding: 1rem 0.5rem;
    margin: 1.5rem auto;
  }
  
  .chart-container svg {
    min-height: 300px;
  }
  
  /* Specific chart adjustments for mobile */
  #trustArchitecture,
  #cakePerformanceCascade {
    min-height: 400px;
  }
  
  /* Mobile-specific font sizes */
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  /* Reduce chart text sizes on mobile */
  .chart-container text {
    font-size: 9px !important;
  }
  
  .chart-container .axis text {
    font-size: 8px !important;
  }
}

/* ===== 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-width: 0;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1em;
  background-color: var(--primary-dark);
  color: white;
  text-decoration: none;
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 0;
}

/* ===== CUSTOM UTILITY CLASSES ===== */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-soft {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.shadow-hard {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== IMAGE ASPECT RATIOS ===== */
.aspect-ratio-4-3 {
  position: relative;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  height: 0;
  overflow: hidden;
  background-color: var(--light-gray);
}

.aspect-ratio-4-3 img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.aspect-ratio-4-3:hover img {
  transform: scale(1.05);
}

/* Alternative aspect ratio using modern CSS */
@supports (aspect-ratio: 4 / 3) {
  .aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
    padding-bottom: 0;
    height: auto;
  }
  
  .aspect-ratio-4-3 img {
    position: static;
  }
}

/* ===== BUTTON HOVER STATES ===== */
.bg-accent-yellow {
  background-color: var(--accent-yellow);
  transition: all 0.3s ease;
}

.bg-accent-yellow:hover,
.hover\:bg-yellow-300:hover {
  background-color: #FFD666 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 201, 62, 0.3);
}

.hover\:bg-yellow-400:hover {
  background-color: #FFD666 !important;
}

/* All yellow button variations */
a[class*="bg-accent-yellow"]:hover,
button[class*="bg-accent-yellow"]:hover {
  background-color: #FFD666 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 201, 62, 0.3);
}

/* ===== CARD ENHANCEMENTS ===== */
.card-hover {
  transition: all 0.3s ease;
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Enhanced card shadows */
.shadow-sm {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
}

.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

/* Details/Summary styling for FAQ */
details summary::-webkit-details-marker {
  display: none;
}

details[open] summary svg {
  transform: rotate(180deg);
}

/* Newsletter input styling */
input[type="email"]:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-blue);
}

/* Enhanced button hover states */
.hover\:shadow-xl:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

/* Gradient text effect for hero */
.text-gradient-hero {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== FORM STYLES (for future use) ===== */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--medium-gray);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(24, 70, 253, 0.1);
  outline: none;
}

/* ===== QUOTE BLOCK ===== */
.quote-highlight {
  position: relative;
  padding-left: 2rem;
}

.quote-highlight::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -0.5rem;
  font-size: 3rem;
  color: var(--primary-blue);
  opacity: 0.3;
  font-family: var(--accent-font);
}

/* ===== SECTION DIVIDERS ===== */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--medium-gray), transparent);
  margin: 3rem 0;
}

/* ===== BACKDROP BLUR (for modals/overlays) ===== */
.backdrop-blur {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.4);
}

/* ===== RESPONSIVE NAVIGATION INDICATOR ===== */
@media (min-width: 1024px) {
  nav a.active::after,
  nav button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-blue);
  }
}

/* ===== COOKIE CONSENT STYLES ===== */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 2px solid var(--primary-blue);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  display: none;
}

.cookie-consent-banner.show {
  transform: translateY(0);
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cookie-banner-text h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0 0 8px 0;
}

.cookie-banner-text p {
  color: var(--text-gray);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-banner-actions .btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cookie-banner-actions .btn-primary {
  background: var(--primary-blue);
  color: white;
}

.cookie-banner-actions .btn-primary:hover {
  background: var(--primary-dark);
}

.cookie-banner-actions .btn-secondary {
  background: var(--medium-gray);
  color: var(--text-dark);
}

.cookie-banner-actions .btn-secondary:hover {
  background: var(--text-gray);
  color: white;
}

.cookie-banner-actions .btn-outline {
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.cookie-banner-actions .btn-outline:hover {
  background: var(--primary-blue);
  color: white;
}

/* Cookie Modal */
.cookie-consent-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: none;
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.cookie-modal-content {
  position: relative;
  background: white;
  margin: 50px auto;
  max-width: 600px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.cookie-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
}

.cookie-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-gray);
  padding: 0;
  line-height: 1;
}

.cookie-modal-close:hover {
  color: var(--primary-dark);
}

.cookie-modal-body {
  padding: 20px 24px;
}

.cookie-category {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--light-gray);
}

.cookie-category:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cookie-category-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
}

.cookie-category p {
  color: var(--text-gray);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* Cookie Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--medium-gray);
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .toggle-slider {
  background-color: var(--primary-blue);
}

.cookie-toggle input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.cookie-toggle input:disabled + .toggle-slider {
  background-color: var(--accent-yellow);
  cursor: not-allowed;
}

.cookie-modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-policy-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 0.9rem;
}

.cookie-policy-link:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }

  .cookie-banner-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .cookie-banner-actions .btn {
    flex: 1;
    min-width: 120px;
  }

  .cookie-modal-content {
    margin: 20px;
    max-height: calc(100vh - 40px);
  }

  .cookie-modal-footer {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .cookie-modal-footer .btn {
    width: 100%;
  }
}