@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Almarai', 'Segoe UI', Tahoma, sans-serif;
  background: #f4f7fb;
  color: #2a2a2a;
  direction: rtl;
}

/* ===== Navbar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #ffffff9b;
  border-bottom: 1px solid #e7eaf381;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  backdrop-filter: blur(10px);
}

.my-recipes {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #2a2a2a;
}

.recipes-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ff6200;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(255,98,0,.35);
}

.recipes-text { font-size: 16px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right a {
  color: #33475b;
  font-weight: 700;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background-color: #f8faff;
  transition: all 0.25s ease;
}

.topbar-right a:hover {
  color: #ffffff;
  background: #ff6200;
  border-color: #ff6200;
}

.top-search {
  position: relative;
  width: min(400px, 100%);
}

.top-search input {
  width: 100%;
  border: 1px solid #dde1ed;
  border-radius: 999px;
  padding: 10px 50px 10px 14px;
  font-size: 14px;
  background: #f6f8fd;
  outline: none;
  font-family: inherit;
}

.top-search input:focus {
  border-color: #ff6200;
  box-shadow: 0 0 0 3px rgba(255,98,0,.15);
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-btn, .notif-btn {
  border: 1px solid #dee4f2;
  background: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.avatar-btn:hover, .notif-btn:hover {
  transform: scale(1.15);
}

/* ===== Main ===== */
:root {
  --primary: #ff6200;
  --primary-light: #ff8c42;
  --primary-bg: #fff5f0;
  --text-dark: #1a1a2e;
  --text-gray: #6b7280;
  --white: #ffffff;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
  --card-hover-shadow: 0 12px 40px rgba(255,98,0,0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s ease;
}

.favorites-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.favorites-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: 32px;
  gap: 6px;
}

.favorites-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  align-self: center;
}

.favorites-subtitle {
  color: var(--primary);
  font-size: 0.95rem;
  align-self: center;
  margin-bottom: 8px;
}

.clear-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1.5px solid #e5e7eb;
  color: var(--text-dark);
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  align-self: flex-end;
}

.clear-all-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.filter-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 10px 22px;
  border-radius: 50px;
  border: none;
  background: var(--white);
  color: var(--text-dark);
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

.filter-btn.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255,98,0,0.3);
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.recipe-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.4s ease both;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-hover-shadow);
}

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

.card-image-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.recipe-card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

.heart-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  transition: transform var(--transition);
  z-index: 2;
}

.heart-btn:hover {
  transform: scale(1.15);
  background: #ffe4e4;
}

.rating-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,0.65);
  color: #ffd700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.card-body { padding: 16px; }

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  text-align: center;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.card-time {
  font-size: 0.82rem;
  color: var(--text-gray);
}

.view-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: var(--primary-bg);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

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

.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.4rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-gray);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.3s ease;
}

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

.modal-icon {
  font-size: 2.5rem;
  background: #fff0ec;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.modal h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.5;
}

.modal p {
  font-size: 0.88rem;
  color: var(--text-gray);
  margin-bottom: 28px;
  line-height: 1.7;
}

.confirm-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  transition: var(--transition);
}

.confirm-btn:hover { background: var(--primary-light); }

.cancel-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: #f3f4f6;
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.cancel-btn:hover { background: #e5e7eb; }

.notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-dark);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
}

.notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; }
  .favorites-title { font-size: 1.5rem; }
  .recipes-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
  .favorites-main { padding: 24px 16px 40px; }
}

@media (max-width: 480px) {
  .recipes-grid { grid-template-columns: 1fr; }
  .filter-tabs { gap: 8px; }
  .filter-btn { padding: 8px 16px; font-size: 0.85rem; }
}
/* footer */

footer {
  background: #081a3a;
  color: white;
  padding: 70px 60px 20px;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.footer-col h3 {
  margin-bottom: 20px;
}

.footer-col p {
  line-height: 1.8;
  color: #cbd5e1;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 12px;
  color: #cbd5e1;
}

.social {
  margin-top: 20px;
}

.social span {
  margin-left: 10px;
  font-size: 22px;
}

.apps {
  margin-top: 20px;
}

.app-btn {
  background: #1e2f57;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  width: 150px;
  text-align: center;
}

.copyright {
  margin-top: 40px;
  text-align: center;
  border-top: 1px solid #1e2f57;
  padding-top: 20px;
  color: #cbd5e1;
}

/* ===== التحسينات الجديدة ===== */

/* عداد الوصفات */
.counter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* أنيميشن الإزالة */
.recipe-card.removing {
  animation: removeCard 0.4s ease forwards;
}

@keyframes removeCard {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.05); opacity: 0.5; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* وصف الوصفة */
.card-desc {
  font-size: 0.8rem;
  color: var(--text-gray);
  margin-bottom: 10px;
  line-height: 1.5;
  text-align: center;
}

/* المعلومات الغذائية */
.card-nutrients {
  display: flex;
  justify-content: space-between;
  background: #f8faff;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.card-nutrients span {
  font-size: 0.75rem;
  color: var(--text-gray);
  font-weight: 600;
}

/* badge الصعوبة */
.difficulty-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}

/* ===== Shimmer Loading ===== */
.shimmer-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.shimmer-img {
  height: 220px;
  background: linear-gradient(90deg, #e5e8f1 25%, #f3f5fb 50%, #e5e8f1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.shimmer-line {
  height: 16px;
  border-radius: 8px;
  margin: 12px 16px;
  background: linear-gradient(90deg, #e5e8f1 25%, #f3f5fb 50%, #e5e8f1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.shimmer-line.short { width: 60%; }
.shimmer-line.shorter { width: 40%; }

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

/* ===== نبضة القلب ===== */
@keyframes heartBeat {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.4); }
  50%  { transform: scale(1); }
  75%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.heart-btn.beating {
  animation: heartBeat 0.5s ease;
}

/* ===== فلتر أنيميشن ===== */
.recipes-grid.filter-transition {
  animation: filterFade 0.3s ease;
}

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