/* ============================
   GLOBAL & LAYOUT
============================ */
body {
  background: #f8f9fa;
  font-family: 'Segoe UI', Roboto, sans-serif;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* ============================
   NAVBAR
============================ */
.navbar {
  background: linear-gradient(90deg, #2f855a, #3ca373);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.navbar .navbar-brand {
  font-weight: 700;
  color: #fff;
}

.navbar .navbar-brand:hover {
  color: #f88300;
}

.navbar .nav-link {
  color: #fff !important;
  font-weight: 500;
  transition: color 0.2s ease-in-out;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #f88300 !important;
}

/* ============================
   FOOTER
============================ */
footer {
  background: linear-gradient(90deg, #2f855a 0%, #3ca373 100%);
  color: #ffffff;
  text-align: center;
  padding: 15px;
  width: 100%;
  font-size: 0.95rem;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
}

footer i {
  color: #f88300;
}

/* ============================
   CARDS / PLANT GRID
============================ */
.card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.card-img-top {
  object-fit: cover;
  height: 180px;
}

.placeholder-image {
  height: 180px;
  border-radius: 12px 12px 0 0;
  font-size: 3rem;
}

.plant-icon {
  font-size: 1.5rem;
}

.label-sm {
  font-size: 0.8rem;
  color: #6c757d;
}

/* ============================
   PROGRESS BARS
============================ */
.progress {
  height: 6px;
  border-radius: 3px;
  background-color: #e9ecef;
}

.progress-bar {
  transition: width 0.4s ease-in-out;
}

/* ============================
   BUTTONS & ACTIONS
============================ */
.btn-sm i {
  margin-right: 2px;
}

.btn-outline-danger i {
  color: #dc3545;
}

.action-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* ============================
   COMMENTS & LOGS
============================ */
.comment-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px;
  border: 1px solid #e5e5e5;
}

.comment {
  background: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 4px;
  border: 1px solid #eee;
  transition: background 0.2s ease;
}

.comment:hover {
  background: #f1f1f1;
}

.delete-comment {
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
}

.comment:hover .delete-comment {
  opacity: 1;
}

.toggle-comments {
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.toggle-comments:hover {
  background: #2f855a;
  color: #fff;
}

.comment-list .comment-item {
  border-color: #e7e7e7;
}
.comment-list .comment-item:last-child {
  border-bottom: none;
}
.comment-list {
  max-height: 200px;
  overflow-y: auto;
}

.input-group textarea {
  resize: none;
}

/* ============================
   LOGS & COMMENTS MODAL
============================ */
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 1rem);
}

.modal-content {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  background: #f8f9fa;
}

.modal-content.bg-dark img {
  max-height: 85vh;
  object-fit: contain;
}
.modal-content.bg-dark {
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.modal-header.bg-success {
  background: linear-gradient(90deg, #2f855a, #3ca373);
  border-bottom: none;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: none;
  justify-content: center;
  padding-bottom: 1.2rem;
}

.list-group-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid #e9ecef;
}

.comment-section p,
.log-list p {
  margin-bottom: 0;
}

.modal-backdrop.show {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .modal-dialog.modal-lg {
    max-width: 95%;
    margin: auto;
  }
}


/* ============================
   PHOTO HISTORY
============================ */
.photo-history img {
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-history img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ============================
   NOTIFICATIONS
============================ */
.alert-success,
.alert-warning {
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.card.border-warning {
  border: 2px solid #ffc107 !important;
}

/* ============================
   MODALS
============================ */
.modal-content {
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  border: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
}
.modal-close {
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}
.modal-fullscreen .btn-close-white {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  padding: 0.6rem;
  width: 2rem;
  height: 2rem;
  opacity: 0.9;
  transition: opacity 0.2s ease-in-out;
}


.modal-footer {
  border-top: 1px solid #e5e5e5;
}

.modal-title {
  font-weight: 600;
}

/* ============================
   BADGES & TAGS
============================ */
.badge {
  font-weight: 500;
  border-radius: 5px;
  letter-spacing: 0.3px;
}

/* ============================
   HEADINGS & TEXT
============================ */
h2, h5 {
  font-weight: 700;
}

.text-success {
  color: #2f855a !important;
}

/* ============================
   ANIMATIONS
============================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeInUp 0.4s ease both;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 768px) {
  .action-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-img-top, .placeholder-image {
    height: 160px;
  }
  footer {
    font-size: 0.85rem;
  }
}

/* ============================
   UTILITY ENHANCEMENTS
============================ */
.text-muted small {
  color: #8c9398 !important;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0,0,0,0.06)!important;
}

/* Scrollbar improvements */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background: #b0b0b0;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* ============================
   FORM ENHANCEMENTS
============================ */
.form-control:focus {
  border-color: #2f855a;
  box-shadow: 0 0 0 0.15rem rgba(47,133,90,0.25);
}

.form-select:focus {
  border-color: #3ca373;
  box-shadow: 0 0 0 0.15rem rgba(60,163,115,0.25);
}

/* ============================
   BUTTON COLORS (Consistent)
============================ */
.btn-success {
  background-color: #2f855a;
  border-color: #2f855a;
}

.btn-success:hover {
  background-color: #3ca373;
  border-color: #3ca373;
}

.btn-outline-success {
  color: #2f855a;
  border-color: #2f855a;
}

.btn-outline-success:hover {
  background-color: #2f855a;
  color: #fff;
}

/* ============================
   CONTAINERS & CARDS ANIMATION
============================ */
.container .card {
  transition: all 0.25s ease-in-out;
}

/* ============================
   PAGINATION STYLE
============================ */
.pagination .page-link {
  color: #2f855a;
  border-radius: 6px;
  font-weight: 500;
}

.pagination .page-item.active .page-link {
  background-color: #2f855a;
  border-color: #2f855a;
  color: #fff !important; /* ✅ keeps the number visible */
  font-weight: 600;
}

.pagination .page-item.disabled .page-link {
  color: #ccc;
  background-color: #f8f9fa;
}

.pagination .page-link:hover {
  background-color: #3ca373;
  color: #fff;
}

/* ============================
   FULLSCREEN PHOTO VIEWER (Blurred BG, Close on Photo)
============================ */

/* Soft blur behind modal */
.modal-backdrop.show {
  background-color: rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
}

/* Transparent, centered modal content */
.photo-modal-content {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Relative container so the X can anchor to the photo corner */
.photo-viewer-frame {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: inline-block;   /* shrink-wrap to image */
}

/* The image scales to fit viewport, no scroll */
.photo-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: #000;                       /* subtle frame for transparent images */
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  user-select: none;
}

/* Close button sits on the photo's top-right corner */
.photo-viewer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background-color: rgba(0,0,0,0.65);
  border-radius: 50%;
  opacity: 0.95;
  filter: invert(1);                      /* white “X” */
}

.photo-viewer-close:hover {
  background-color: rgba(0,0,0,0.8);
  opacity: 1;
}

/* Prevent page scroll while open */
body.modal-open {
  overflow: hidden !important;
}

