:root {
  --primary-color: #2e7d32;
  --secondary-color: #81c784;
  --bg-color: #f1f8e9;
  --text-color: #333333;
  --card-bg: rgba(255, 255, 255, 0.85);
}

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

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

header h1 {
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Grid Layout for Homepage */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding-bottom: 3rem;
}

.plant-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.plant-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.plant-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.plant-info {
  padding: 1.5rem;
}

.plant-name {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.scientific-name {
  font-style: italic;
  color: #666;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Article Page Layout */
.article-container {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 15px 40px rgba(0,0,0,0.08);
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .article-container {
    flex-direction: row;
  }
}

.article-image-wrapper {
  flex: 1;
}

.article-image {
  width: 100%;
  border-radius: 15px;
  object-fit: cover;
  max-height: 500px;
}

.article-content {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-title {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.article-scientific {
  font-size: 1.2rem;
  font-style: italic;
  color: #777;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 1rem;
}

.article-description {
  font-size: 1.1rem;
  line-height: 1.8;
}

.care-section {
  background-color: #f9fbe7;
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 5px solid var(--secondary-color);
  margin-top: 1rem;
}

.care-section h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* QR Code Section */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f5f5f5;
  border-radius: 15px;
  margin-top: 2rem;
  text-align: center;
}

.qr-section p {
  margin-bottom: 1rem;
  font-weight: bold;
  color: #555;
}

#qrcode {
  padding: 1rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.back-btn {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.back-btn:hover {
  color: #1b5e20;
}
/* Edit Button & Modal Styling */
.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn-edit, .btn-download {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

.btn-edit:hover, .btn-download:hover {
  background-color: #1b5e20;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-cancel, .btn-save {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
}

.btn-cancel {
  background-color: #f1f1f1;
  color: #333;
}

.btn-cancel:hover {
  background-color: #ddd;
}

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

.btn-save:hover {
  background-color: #1b5e20;
}

/* Responsive Enhancements for Mobile Devices */
@media (max-width: 768px) {
  header {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .plant-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .article-title {
    font-size: 2rem;
  }
  
  .article-container {
    padding: 1.5rem;
  }
  
  .header-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .btn-edit, .btn-download {
    width: 100%;
    text-align: center;
  }
  
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .btn-cancel, .btn-save {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Delete Button Styling */
.btn-delete {
  background-color: #d32f2f;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
  margin-left: 0.5rem;
}

.btn-delete:hover {
  background-color: #b71c1c;
}

/* Footer Styling */
.app-footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  color: #666;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.app-footer p {
  font-weight: 600;
}

.app-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.3s;
}

.app-footer a:hover {
  color: #1b5e20;
  text-decoration: underline;
}

.privacy-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #888;
}

/* Quill Editor Styling */
.quill-editor {
  height: 200px;
  background: white;
}
.ql-toolbar.ql-snow {
  background: #f9f9f9;
  border-radius: 5px 5px 0 0;
  border-color: #ddd;
}
.ql-container.ql-snow {
  border-radius: 0 0 5px 5px;
  border-color: #ddd;
}

/* Icon Button Styling */
.btn-icon {
  margin-right: 5px;
}

@media (max-width: 768px) {
  .btn-text {
    display: none;
  }
  .btn-icon {
    margin-right: 0;
    font-size: 1.2rem;
  }
  .btn-edit, .btn-delete, .btn-download {
    padding: 0.8rem;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .header-actions div {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-end;
  }
}

/* Add Button Mobile Floating Style */
.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-add:hover {
  background-color: #1b5e20;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .btn-add {
    position: fixed;
    bottom: 6.5rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    padding: 0;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.4);
  }
  
  .btn-logout {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    padding: 0;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.4);
    margin-left: 0 !important;
  }
  
  .btn-add .btn-text, .btn-logout .btn-text {
    display: none;
  }
  
  .btn-add .btn-icon, .btn-logout .btn-icon {
    margin: 0;
    width: 24px;
    height: 24px;
  }
}

/* Search Container */
.search-container {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

#search-input {
  width: 100%;
  max-width: 600px;
  padding: 1rem 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  font-size: 1.1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

#search-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.1);
}

/* Custom Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 1rem 2rem;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  width: max-content;
  max-width: 90vw;
  box-sizing: border-box;
  font-size: 0.95rem;
}

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

.toast-notification.success {
  border-left: 4px solid var(--primary-color);
}

.toast-notification.error {
  border-left: 4px solid #d32f2f;
}

@media (max-width: 768px) {
  #search-input {
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
  }
}
