/* General styles */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
  overflow: hidden; /* Prevent scrolling on main body */
  display: flex;
  height: 100vh; /* Full viewport height */
}

#app-root {
  width: 100%;
  height: 100%;
}

.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  position: fixed;
  top: 50%;
  left: 50%;
  margin-left: -25px; /* Half of width */
  margin-top: -25px; /* Half of height */
  z-index: 2000;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Notification Toasts */
.saved, .deleted {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.saved-content, .deleted-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 300px;
  border-radius: 10px;
  position: relative;
  text-align: center;
}

.saved-content button, .deleted-content button {
  background-color: #007bff;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 15px;
}

.saved-content button:hover, .deleted-content button:hover {
  background-color: #0056b3;
}

.check {
  width: 50px;
  height: 50px;
  background-color: #4CAF50;
  border-radius: 50%;
  margin: 0 auto 15px;
}

/* Login Page styles */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  max-width: 1200px;
  margin: auto;
  overflow-y: auto; /* Allow scrolling for content on login page */
}

.login-page .preview .title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #333;
}

.login-page .preview .description {
  font-size: 18px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 40px;
}

.login-page .get-started h1 {
  font-size: 36px;
  margin-bottom: 30px;
  color: #333;
}

.login-page #google-sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #4285f4;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  width: fit-content;
  margin: 0 auto 50px;
}

.login-page #google-sign-in:hover {
  background-color: #357ae8;
}

.login-page #google-sign-in .google_logo {
  width: 20px;
  height: 20px;
  margin-left: 10px;
}

.login-page .whats-dishy {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 80px;
  text-align: left;
}

.login-page .whats-dishy.marginned {
  margin-top: 80px;
}

.login-page .whats-dishy .what-info {
  flex: 1;
}

.login-page .whats-dishy .what-info h1 {
  font-size: 36px;
  color: #333;
  margin-bottom: 15px;
}

.login-page .whats-dishy .what-info p {
  font-size: 16px;
  line-height: 1.7;
  color: #555;
}

.login-page .whats-dishy .omelet, .whats-dishy .database {
  flex: 1;
  height: 300px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.login-page .whats-dishy .omelet { background-image: url("res/omelet.png"); }
.login-page .whats-dishy .database { background-image: url("res/database.png"); }

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Sidebar styles */
.sidebar {
  background-color: #333;
  color: white;
  display: flex;
  flex-direction: column;
  padding: 15px;
  transition: width 0.3s ease-in-out;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar.collapsed {
  width: 80px; /* Only show icons */
}

.sidebar.expanded {
  width: 280px; /* Show text and search */
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center items when collapsed */
  margin-bottom: 20px;
}

.dishy-logo-btn {
  display: flex;
  align-items: center;
  justify-content: center; /* Center logo when collapsed */
  width: 100%;
  padding: 10px 0;
  cursor: pointer;
  margin-bottom: 15px;
}

.sidebar.expanded .dishy-logo-btn {
  justify-content: flex-start; /* Align left when expanded */
  padding-left: 5px; /* Adjust padding */
}

.dishy-logo-btn .logo-icon {
  width: 40px;
  height: 40px;
}

.dishy-logo-btn .logo-text {
  font-size: 24px;
  font-weight: bold;
  margin-left: 10px;
}

.sidebar.collapsed .dishy-logo-btn .logo-text {
  display: none;
}

.sidebar.expanded .dishy-logo-btn .logo-text {
  display: inline;
}


.sidebar.expanded .logo-text {
  display: inline;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.search-container {
  width: 100%;
  margin-bottom: 15px;
}

#sidebar-search-input {
  width: calc(100% - 20px);
  padding: 8px 10px;
  border-radius: 5px;
  border: none;
  background-color: #555;
  color: white;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.nav-tab-btn {
  background: none;
  border: none;
  color: white;
  padding: 10px 15px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 5px;
  border-radius: 5px;
}

.nav-tab-btn:hover, .nav-tab-btn.active {
  background-color: #555;
}

.nav-tab-btn .tab-icon {
  font-size: 20px;
  margin-right: 10px;
}

.sidebar.collapsed .nav-tab-btn .tab-text {
  display: none;
}

.sidebar.expanded .nav-tab-btn .tab-text {
  display: inline;
}

.sidebar-list-container {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 5px; /* For scrollbar */
}

.sidebar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #444;
  color: white;
  padding: 8px 10px;
  border-radius: 5px;
  margin-bottom: 5px;
  cursor: pointer;
}

.sidebar-item:hover {
  background-color: #666;
}

.sidebar-item .item-name {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item .delete-item-btn {
  background: none;
  border: none;
  color: #ff4d4d;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  margin-left: 10px;
}

.sidebar-item .delete-item-btn:hover {
  color: #ff1a1a;
}

.pantry-add-form {
  display: flex;
  margin-bottom: 10px;
}

#pantry-item-input {
  flex-grow: 1;
  padding: 8px;
  border-radius: 5px 0 0 5px;
  border: 1px solid #555;
  background-color: #444;
  color: white;
}

#add-pantry-item-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
}

#add-pantry-item-btn:hover {
  background-color: #45a049;
}

.empty-list-info {
  color: #bbb;
  text-align: center;
  padding: 15px;
}

.search-section-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: #ddd;
  padding-left: 5px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #444;
}

.logout-btn {
  background: none;
  border: none;
  color: white;
  padding: 10px 15px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: 5px;
}

.logout-btn:hover {
  background-color: #555;
}

.sidebar.collapsed .logout-btn .tab-text {
  display: none;
}

.sidebar.expanded .logout-btn .tab-text {
  display: inline;
}

/* Main Content (Recipe Viewer) */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: #f9f9f9;
  position: relative; /* For chat bar */
  overflow-y: auto; /* Allow content to scroll */
  padding-bottom: 100px; /* Space for chat bar */
}

.recipe-viewer {
  flex-grow: 1;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.viewer-welcome {
  text-align: center;
  padding: 50px 20px;
}

.viewer-welcome h1 {
  font-size: 3em;
  color: #333;
  margin-bottom: 20px;
}

.viewer-welcome p {
  font-size: 1.1em;
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.welcome-suggested-pantry {
  background-color: #eef;
  border-left: 5px solid #007bff;
  padding: 15px;
  margin-top: 30px;
  text-align: left;
}

.welcome-suggested-pantry h3 {
  color: #007bff;
  margin-top: 0;
}

.welcome-suggested-pantry p {
  margin-bottom: 0;
  color: #333;
}

/* Focused Recipe Display */
.recipe-focused {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  position: relative;
}

.recipe-focused-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.recipe-action-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
}

.recipe-action-btn:hover {
  background-color: #5a6268;
}

.recipe-action-btn.primary {
  background-color: #28a745;
}

.recipe-action-btn.primary:hover {
  background-color: #218838;
}

.recipe-header {
  text-align: center;
  margin-bottom: 30px;
}

.recipe-title {
  font-size: 2.5em;
  color: #333;
  margin-bottom: 10px;
}

.recipe-subtitle {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.subtitle-tag {
  background-color: #e9ecef;
  color: #495057;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.9em;
}

.recipe-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .recipe-details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.recipe-ingredients-section, .recipe-instructions-section {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e6ea;
}

.recipe-ingredients-section h3, .recipe-instructions-section h3 {
  color: #007bff;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5em;
}

.recipe-ingredients-section ul, .recipe-instructions-section ol {
  list-style-position: inside;
  padding-left: 0;
  margin-bottom: 0;
}

.recipe-ingredients-section li, .recipe-instructions-section li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: #333;
}

/* Chat Bar */
.chat-bar-container {
  position: sticky;
  bottom: 0;
  width: 100%;
  background-color: #fff;
  padding: 15px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  z-index: 100;
}

.chat-bar-inputs {
  display: flex;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  gap: 10px;
}

.filter-buttons {
  display: flex;
  gap: 5px;
  position: relative;
}

.filter-dropdown-container {
  position: relative;
}

.filter-btn {
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2em;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-btn:hover {
  background-color: #dee2e6;
}

.filter-btn.has-value {
  border-color: #007bff;
  background-color: #e7f2ff;
}

.filter-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.8em;
  color: #007bff;
  line-height: 1;
}

.filter-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px); /* Position above the button */
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 101; /* Above chat bar */
}

.filter-popover.open {
  display: block;
}

.filter-popover h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #333;
}

.filter-popover input[type="text"], .filter-popover select {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.filter-popover .popover-close-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
}

.filter-popover .popover-close-btn:hover {
  background-color: #0056b3;
}

#chat-bar-input {
  flex-grow: 1;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 20px;
  font-size: 1em;
}

.chat-send-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1em;
}

.chat-send-btn:hover {
  background-color: #0056b3;
}

/* Cooking Overlay */
.cooking-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.cooking-card {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.cooking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cooking-header h3 {
  margin: 0;
  font-size: 1.8em;
  color: #333;
}

.cooking-close-x {
  background: none;
  border: none;
  font-size: 2em;
  color: #888;
  cursor: pointer;
}

.cooking-close-x:hover {
  color: #333;
}

.cooking-body {
  flex-grow: 1;
  text-align: center;
  margin-bottom: 30px;
}

.cooking-progress-indicator {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 15px;
}

.cooking-step-text-container {
  min-height: 150px; /* Ensure space for content */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#cooking-step-text {
  font-size: 1.6em;
  font-weight: bold;
  color: #333;
  line-height: 1.4;
}

.cooking-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.cooking-nav-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1em;
  flex-grow: 1;
}

.cooking-nav-btn:hover {
  background-color: #5a6268;
}

.cooking-nav-btn.primary {
  background-color: #007bff;
}

.cooking-nav-btn.primary:hover {
  background-color: #0056b3;
}
