/* ---------------- VARIABLES ---------------- */
:root {
  --bg: linear-gradient(135deg, #ffdde1, #ee9ca7);
  --card: #fff;
  --text: #000;
  --muted: #000000;    
  --accent: #d63384;     
  --radius: 14px;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.1);

  --toggle-bg: #000;
  --toggle-color: #fff;
}

html {
  scroll-behavior: smooth;
}

html[data-theme="dark"] {
  --bg: linear-gradient(135deg, #2b2b2b, #1a1a1a);
  --card: #333;
  --text: #f1f1f1;
  --muted: #ccc;
  --accent: #ff69b4;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.4);

  --toggle-bg: #fff;
  --toggle-color: #000;
}

/* ---------------- GLOBAL ---------------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: cursive;
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 1100px;
  margin: 36px auto;
  padding: 28px;
}

/* ---------------- HEADER ---------------- */
header {
  margin-bottom: 30px;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 73px;
  height: 75px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

h1 {
  font-size: 40px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

p.lead {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 23px;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

/* ---------------- GRID ---------------- */
.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

@media (max-width: 880px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    gap: 12px;
  }
}

/* ---------------- PANEL ---------------- */
.panel {
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 510x;
  transition: height 0.3s ease;
  overflow: hidden;
  margin-bottom: 30px;
}

.panel.has-image {
  height: 800px;
}

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

/* ---------------- PREVIEW ---------------- */
.preview {
  width: 100%;
  max-width: 500px;     
  height: auto;           
  max-height: 500px;     
  margin: 10px auto;    
  border-radius: 12px;
  overflow: hidden;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  font-size: 15px;
  border: 1px dashed #ccc;
  transition: background 0.3s ease;
}

/* IMAGE ANIMATION */
.preview img {
  width: 100%;
  height: auto;
  max-height: 0;   
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0 auto;

  opacity: 0;
  transition: max-height 0.8s ease, opacity 0.8s ease;
}

.preview.has-image img {
  max-height: 500px;    
  opacity: 1;
}

/* ---------------- FORM ---------------- */
label {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 10px 0 6px;
  color: var(--text);
}

input[type=text],
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  border: none;
  transition: all 0.2s ease;
  background: #000;
  color: #fff;
}

.btn:hover {
  background: #b42568;
}

/* ---------------- BUTTON ANIMATIONS ---------------- */
.btn {
  transition: all 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: scale(1.05);
  background: #b42568;
}

.btn.save {
  animation: pulse 0.3s ease;
}

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

/* ---------------- TOOLBAR ---------------- */
.toolbar {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.search {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: var(--card);
  color: var(--text);
}

/* ---------------- CARDS ---------------- */
.cards-large {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}

@media (max-width: 880px) {
  .cards-large {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
  align-items: center;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
}

.card h3 {
  margin: 0;
  font-size: 17px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

/* ---------------- CARD ANIMATIONS ---------------- */
.card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.5s forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

.card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

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

/* ---------------- MODAL ---------------- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 40;
  padding: 10px;
  overflow-y: auto;
}

.modal.open {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 800px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.25);
  margin: 40px auto;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  color: var(--text);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.7fr;
  gap: 16px;
  align-items: flex-start;
}

/* ---------------- MODAL ANIMATIONS ---------------- */
.modal-content {
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.25s ease;
}

.modal.open .modal-content {
  transform: scale(1);
  opacity: 1;
}

@media (max-width: 700px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

.left-col,
.right-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preparation-section {
  grid-column: 1 / -1;
  margin-top: 0;
}

.delete-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#deleteBtn {
  min-width: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  text-align: center;
}

/* ---------------- DARK MODE TOGGLE ---------------- */
#toggleMode {
  cursor: pointer;
  font-size: 22px;
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--toggle-bg);
  color: var(--toggle-color);
  border: none;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

#toggleMode:hover {
  transform: scale(1.1);
}

/* ---------------- INPUT FOCUS ---------------- */
input[type=text]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(214, 51, 132, 0.4);
  transition: all 0.3s ease;
}

/* ---------------- IMAGE PREVIEW ---------------- */
.panel {
  transition: height 0.4s ease;
}

/* ---------------- DARK MODE TOGGLE ---------------- */
#toggleMode {
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

#toggleMode.toggle-spin {
  transform: rotate(360deg);
}

/* ---------------- SEARCH / FILTER ---------------- */
.cards-large.fade-out {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

/* ---------------- IMAGE HOVER EFFECT ---------------- */
.card img:hover {
  transform: scale(1.05) rotate(1deg);
  transition: transform 0.3s ease;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row input[type=text] {
  flex: 2;
}
.row select {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-weight: 600;
}

.title-row {
  display: flex;
  justify-content: center;  
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;        
}

.title-row h3 {
  flex: 1;                  
  text-align: center;    
  margin: 0;
}

.title-row .badge {
  position: absolute;
  right: 0;                 
}

.badge {
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  font-weight: 700;
}
.badge.veg {
  background: #d4f8d4;
  color: green;
}
.badge.non-veg {
  background: #f8d4d4;
  color: red;
}

/* Style select dropdown */
select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  appearance: none;   
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  cursor: pointer;
}

/* Custom arrow */
select::after {
  content: "▼";
  font-size: 12px;
  color: var(--text);     
  position: absolute;
  right: 12px;
  pointer-events: none;
}

.row {
  position: relative;
}

/* ---------------- ABOUT SECTION ---------------- */
.about-section {
  background: var(--card);
  padding: 32px;
  margin: 40px auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 1200px;
  width: 100%;
}

.about-section h2 {
  color: var(--accent);
  font-size: 28px;
  margin-bottom: 16px;
}

.about-section h3 {
  color: var(--accent);
  font-size: 22px;
  margin-top: 20px;
  margin-bottom: 8px;
}

.about-section p,
.about-section ul {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}

.about-section ul {
  list-style-type: disc;
  padding-left: 20px;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
}

/* ---------------- FOOTER ---------------- */
footer {
  color: var(--accent);
  font-size: 18px;
  margin-top: 50px;
  text-align: center;
  font-style: italic;
}

footer::after {
  content: " ";
  display: block;
  margin-top: 6px;
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-left: auto;
  margin-right: auto;
  border-radius: 2px;
}