/* ==========================================================================
   FRESSI — Modern Web Design System & CSS Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Vibrant Dark Mode Default */
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-glass: rgba(19, 27, 46, 0.7);
  --bg-glass-border: rgba(255, 255, 255, 0.1);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-orange: #ff6b35;
  --accent-amber: #f7b801;
  --accent-pink: #f72585;
  --accent-purple: #7209b7;
  --accent-green: #10b981;
  
  --gradient-hero: linear-gradient(135deg, #ff6b35 0%, #f72585 50%, #7209b7 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(255,107,53,0.15) 0%, rgba(247,37,133,0.15) 100%);
  --gradient-accent: linear-gradient(90deg, #ff6b35, #f7b801);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(255, 107, 53, 0.35);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-border: rgba(0, 0, 0, 0.08);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 30px rgba(255, 107, 53, 0.2);
}

/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Glassmorphism Container */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Layout Elements */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 1240px;
  z-index: 1000;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-smooth);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.brand-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-hero);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
  transform: rotate(-5deg);
  transition: transform var(--transition-bounce);
}

.brand-logo:hover .logo-icon {
  transform: rotate(0deg) scale(1.1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-orange);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-orange);
  border-radius: var(--radius-full);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle, .fav-toggle-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  position: relative;
}

.theme-toggle:hover, .fav-toggle-btn:hover {
  background: var(--bg-glass-border);
  transform: translateY(-2px);
}

.fav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-pink);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* Hero Section */
.hero-section {
  padding-top: 9rem;
  padding-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,107,53,0.2) 0%, rgba(114,9,183,0) 70%);
  top: -100px;
  right: -100px;
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: var(--accent-orange);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}

.hero-title .gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 540px;
}

/* Hero Interactive Box */
.hero-interactive-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.interactive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.interactive-title {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spin-wheel-btn {
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  background: var(--gradient-hero);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-bounce);
}

.spin-wheel-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.5);
}

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

.randomizer-result {
  background: var(--bg-card);
  border: 1px dashed var(--bg-glass-border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.randomizer-result.pop-anim {
  animation: popIn 0.4s var(--transition-bounce);
}

@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Filter & Search Bar */
.filter-section {
  padding: 2rem 0;
  margin-bottom: 3rem;
}

.filter-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 1.8rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1.2rem 0.8rem 2.8rem;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.category-chips {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.chip-btn {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chip-btn:hover, .chip-btn.active {
  background: var(--accent-orange);
  color: white;
  border-color: var(--accent-orange);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Recipe Grid & Cards */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.recipe-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 107, 53, 0.3);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.4);
}

.card-media {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: #1e293b;
}

.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: var(--gradient-card-hover);
  transition: transform var(--transition-smooth);
}

.recipe-card:hover .card-img-placeholder {
  transform: scale(1.08);
}

.card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}

.card-fav-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.card-fav-btn.active {
  color: var(--accent-pink);
  transform: scale(1.15);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.recipe-title {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  transition: color var(--transition-fast);
}

.recipe-card:hover .recipe-title {
  color: var(--accent-orange);
}

.recipe-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-glass-border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-bounce);
}

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

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background var(--transition-fast);
}

.modal-close:hover {
  background: var(--accent-pink);
  color: white;
}

/* Contact / Feedback Section */
.contact-section {
  padding: 4rem 0;
  margin-bottom: 5rem;
}

.contact-card {
  padding: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-orange);
}

.btn-primary {
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  background: var(--gradient-hero);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-bounce);
}

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

/* Footer */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--bg-glass-border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Notifications / Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.toast {
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent-green);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s ease-out;
}

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

/* Responsive Media Queries */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-card {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}
