/* Food Planner Dedicated Styles */

/* Reset page container to full width */
body {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

/* Override any container constraints */
.container {
  max-width: 1400px !important;
  margin: 24px auto !important;
  padding: 0 20px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.layout {
  display: grid !important;
  grid-template-columns: 350px 1fr !important;
  gap: 24px !important;
  margin-top: 20px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Sidebar Styles */
.sidebar {
  background: rgba(30, 41, 59, 0.8);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

.sidebar strong {
  color: white;
  font-size: 18px;
}

/* Main Content Area */
.main {
  background: rgba(30, 41, 59, 0.8);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

/* Recipe Cards */
.recipe-card {
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.1);
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: grab;
  transition: all 0.3s ease;
  position: relative;
}

.recipe-card:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.recipe-card:active {
  cursor: grabbing;
}

.recipe-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.recipe-card strong {
  color: white;
  display: block;
  margin-bottom: 4px;
}

.recipe-card small {
  color: var(--text-muted);
  font-size: 12px;
}

.card-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(139, 92, 246, 0.6);
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
}

.btn:hover {
  background: rgba(139, 92, 246, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-edit {
  background: rgba(6, 182, 212, 0.6);
}

.btn-edit:hover {
  background: rgba(6, 182, 212, 0.8);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn-link {
  background: transparent;
  color: var(--text-light);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  font-size: 14px;
  width: 100%;
  padding: 12px;
}

.btn-link:hover {
  background: rgba(139, 92, 246, 0.2);
  color: white;
  border-color: rgba(139, 92, 246, 0.5);
}

/* Plan Table */
#plan-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

#plan-table th {
  background: rgba(139, 92, 246, 0.3);
  padding: 12px 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  color: white;
  font-size: 14px;
}

#plan-table th:first-child {
  text-align: left;
  padding-left: 16px;
}

#plan-table td {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.3);
  vertical-align: top;
}

#plan-table tbody tr td:first-child {
  background: rgba(139, 92, 246, 0.2);
  font-weight: 600;
  color: white;
  padding-left: 16px;
}

/* Droppable Cells */
.droppable-cell {
  min-height: 80px;
  border: 2px dashed rgba(255, 255, 255, 0.2) !important;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.droppable-cell:hover {
  background: rgba(139, 92, 246, 0.05);
}

.plan-cell {
  background: rgba(139, 92, 246, 0.15) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
}

.plan-cell .recipe-card {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 8px;
  border-radius: 6px;
  margin: 0;
  cursor: default;
  position: relative;
}

.plan-cell .recipe-card::before {
  content: "🍳 ";
}

/* Delete Button in Cells */
.delete-btn {
  background: rgba(244, 63, 94, 0.8);
  border: none;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  float: right;
  font-size: 14px;
  line-height: 1;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  transform: scale(1.1);
}

/* Manual Entry in Cells */
.manual-entry {
  color: white;
  padding: 8px;
  font-size: 14px;
  font-style: italic;
  background: rgba(251, 191, 36, 0.1);
  border-left: 3px solid rgba(251, 191, 36, 0.6);
  border-radius: 4px;
  display: inline-block;
  width: calc(100% - 30px);
}

.manual-entry::before {
  content: "📝 ";
  font-style: normal;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal .box {
  background: rgba(30, 41, 59, 0.98);
  padding: 28px;
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.active .box {
  transform: scale(1);
}

.modal h3 {
  color: white;
  margin-bottom: 20px;
  font-size: 24px;
}

.modal label {
  display: block;
  margin-bottom: 6px;
  margin-top: 12px;
  color: var(--text-light);
  font-weight: 500;
  font-size: 14px;
}

.modal input,
.modal textarea {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  width: 100%;
  font-size: 14px;
  transition: all 0.3s ease;
}

.modal input:focus,
.modal textarea:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modal textarea {
  resize: vertical;
  min-height: 100px;
}

#close-recipe-modal {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  transition: all 0.2s ease;
}

#close-recipe-modal:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

/* Typography */
h1 {
  color: white;
  font-size: 36px;
  margin-bottom: 8px;
  font-weight: 700;
}

h3 {
  color: white;
  margin-bottom: 16px;
}

strong {
  color: white;
}

#week-display {
  color: white;
  font-weight: 600;
  font-size: 16px;
}

/* Auth Banner */
#auth-banner {
  margin-bottom: 16px;
}

/* Loading States */
#recipes-container p,
#recipes-container div {
  color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 300px 1fr;
  }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sidebar {
    max-height: 400px;
    position: static;
  }

  h1 {
    font-size: 28px;
  }

  #plan-table {
    font-size: 12px;
  }

  #plan-table th,
  #plan-table td {
    padding: 6px 4px;
  }

  .modal .box {
    width: 95%;
    padding: 20px;
  }
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}
