/*
 * FreshFoodz Product Portal - Stylesheet
 * Combined Tailwind utilities + Custom animations
 *
 * Note: Use Tailwind CDN in HTML for utility classes
 * This file contains custom FreshFoodz styles and animations
 */

/* ============================================
   CSS VARIABLES & THEME
   ============================================ */

:root {
  /* FreshFoodz Corporate Colors */
  --color-green: #94C456;
  --color-blue: #004F7B;
  --color-black: #000000;
  --color-white: #FFFFFF;

  /* Theme variables */
  --background: #ffffff;
  --foreground: #000000;

  /* Hover states */
  --color-green-hover: #7fb043;
  --color-blue-hover: #003d5f;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
  background: var(--background);
  color: var(--foreground);
  font-family: 'Poppins', Arial, sans-serif;
}

/* Typography utility classes */
.font-heading {
  font-family: 'Antonio', sans-serif;
  text-transform: uppercase;
  font-weight: 700;
}

.font-body {
  font-family: 'Poppins', sans-serif;
}

.font-body-medium {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}

/* ============================================
   CUSTOM COLOR UTILITIES
   ============================================ */

.bg-ff-blue {
  background-color: var(--color-blue);
}

.bg-ff-green {
  background-color: var(--color-green);
}

.text-ff-blue {
  color: var(--color-blue);
}

.text-ff-green {
  color: var(--color-green);
}

.border-ff-blue {
  border-color: var(--color-blue);
}

.border-ff-green {
  border-color: var(--color-green);
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.btn-primary {
  background-color: var(--color-green);
  color: var(--color-white);
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background-color: var(--color-green-hover);
}

.btn-secondary {
  background-color: var(--color-blue);
  color: var(--color-white);
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

.btn-secondary:hover {
  background-color: var(--color-blue-hover);
}

/* ============================================
   PAGE TRANSITIONS & ANIMATIONS
   ============================================ */

/* Page transition base */
.page-transition {
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-hidden {
  opacity: 0;
  transform: translateY(12px);
}

.page-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade up animation */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale in animation */
.scale-in {
  opacity: 0;
  transform: scale(0.95);
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes scaleIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide in animations */
.slide-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered animations for lists */
.stagger-item {
  opacity: 0;
  transform: translateY(16px);
  animation: staggerFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes staggerFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header animations */
.header-animate {
  animation: headerSlideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Logo pulse animation on hover */
.logo-hover {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.3s ease;
}

.logo-hover:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Card entrance animation */
.card-animate {
  animation: cardSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

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

/* Profile card special animation */
.profile-card-animate {
  animation: profileCardReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

@keyframes profileCardReveal {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Profile header gradient sweep */
.profile-header-animate {
  position: relative;
  overflow: hidden;
}

.profile-header-animate::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmerSweep 1.5s ease-in-out 0.3s forwards;
}

@keyframes shimmerSweep {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Button ripple effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  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.4s ease, height 0.4s ease;
}

.btn-ripple:active::after {
  width: 200px;
  height: 200px;
}

/* Navigation button animation */
.nav-btn-animate {
  animation: navBtnPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
  opacity: 0;
  transform: scale(0.5);
}

@keyframes navBtnPop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Search bar focus animation */
.search-animate:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 79, 123, 0.15);
  transform: scale(1.01);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Product card hover lift */
.card-lift {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 79, 123, 0.15);
}

/* Checkbox animation */
.checkbox-animate {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkbox-animate:checked {
  animation: checkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Footer slide up */
.footer-animate {
  animation: footerSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes footerSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Title reveal animation */
.title-reveal {
  animation: titleReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

@keyframes titleReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
    clip-path: inset(0 0 100% 0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0 0);
  }
}

/* Subtitle fade in */
.subtitle-fade {
  animation: subtitleFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
  opacity: 0;
}

@keyframes subtitleFade {
  to { opacity: 1; }
}

/* Badge pop animation */
.badge-pop {
  animation: badgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0.8);
}

@keyframes badgePop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Green accent glow for interactive elements */
.glow-green {
  transition: box-shadow 0.3s ease;
}

.glow-green:hover {
  box-shadow: 0 0 20px rgba(148, 196, 86, 0.4);
}

/* Blue accent glow */
.glow-blue {
  transition: box-shadow 0.3s ease;
}

.glow-blue:hover {
  box-shadow: 0 0 20px rgba(0, 79, 123, 0.3);
}

/* Smooth icon rotation */
.icon-rotate {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-rotate:hover {
  transform: rotate(15deg);
}

/* Download button pulse */
.download-pulse:hover {
  animation: downloadPulse 0.6s ease-in-out;
}

@keyframes downloadPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Profile info row slide in */
.info-row-animate {
  animation: infoRowSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateX(-20px);
}

@keyframes infoRowSlide {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Status badge pulse for "Aktiv" */
.status-active {
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

/* Action button hover scale */
.action-btn {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.2s ease,
              border-color 0.2s ease;
}

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

.action-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */

.smooth-scroll {
  scroll-behavior: smooth;
}

.smooth-scroll::-webkit-scrollbar {
  width: 8px;
}

.smooth-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.smooth-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.smooth-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 32rem;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 4rem);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal.active .modal-content {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ============================================
   DROPDOWN STYLES
   ============================================ */

.dropdown-container {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  min-width: 12rem;
  z-index: 50;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dropdown-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  width: 100%;
  text-align: left;
  transition: background-color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
}

.dropdown-item:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
}

/* ============================================
   RTL SUPPORT
   ============================================ */

[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

[dir="rtl"] .text-left {
  text-align: right;
}

[dir="rtl"] .text-right {
  text-align: left;
}

[dir="rtl"] .mr-2 {
  margin-right: 0;
  margin-left: 0.5rem;
}

[dir="rtl"] .ml-2 {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-input {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.form-input:disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
}

/* Custom checkbox styling */
input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  cursor: pointer;
  accent-color: var(--color-green);
}

input[type="checkbox"]:checked {
  background-color: var(--color-green);
  border-color: var(--color-green);
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  animation: spin 1s linear infinite;
}

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

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

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

/* ============================================
   UTILITY OVERRIDES
   ============================================ */

/* Note: Removed .hidden override - Tailwind handles responsive visibility via CDN */
/* The previous .hidden { display: none !important; } was breaking sm:flex responsive classes */

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
