/* === BASE RESET & BODY === */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding-top: 0px;
  background-color: #f3ede0;
  font-family: Arial, sans-serif;
  overflow-x: hidden;
}
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === BRANDING === */
.branding-row {
  background-color: #5f6741;
  padding: 12px 14px;
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 0;
  margin-top: 0;
}
.logo-img { height: 60px; width: auto; }
.slogan-wrapper { display: flex; flex-direction: column; justify-content: center; }
.branding-row .slogan-bn,
.branding-row .slogan-text {
  font-family: 'Noto Sans Bengali', sans-serif;
  font-size: 1rem;
  font-weight: bold;
  color: #f3ede0;
  margin: 0;
}
@media (max-width: 768px) {
  .branding-row { flex-direction: column; text-align: center; }
  .slogan-wrapper { align-items: center; }
  .branding-row .slogan-bn { font-size: 0.9rem; }
  .branding-row .slogan-text { font-size: 0.85rem; }
}

/* === NAV BUTTONS === */
.btn-sm { font-size: 0.8rem; padding: 4px 8px; }
.btn-outline-primary { color: #5f6741; border-color: #5f6741; }
.btn-outline-primary:hover { background-color: #5f6741; color: #fff; }
.btn-outline-danger { color: #dc3545; border-color: #dc3545; }
.btn-outline-danger:hover { background-color: #dc3545; color: #fff; }
.btn-outline-success { color: #198754; border-color: #198754; }
.btn-outline-success:hover { background-color: #198754; color: #fff; }
.btn-outline-secondary { color: #6c757d; border-color: #6c757d; }
.btn-outline-secondary:hover { background-color: #6c757d; color: #fff; }

/* === INBOX BADGE === */
.inbox-badge {
  background-color: red;
  color: white;
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: bold;
}

/* === PROJECT GRID & CARD STYLES === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1rem;
}
.project {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  padding: 1.2rem;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.project.visible { opacity: 1; transform: translateY(0); }
.project-content { flex: 1 1 auto; display: flex; flex-direction: column; height: 100%; }
.project-image-wrapper {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 10px;
  background: #e8f0df;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-image { width: 100%; height: 100%; object-fit: cover; display: block; }

/* === PROJECT CARD TITLE FLEX/ELLIPSIS === */
.project-title-row {
  display: flex;
  align-items: center;
  font-size: 1.13rem;
  background-color: #d8eed3;
  color: #5f6741;
  font-weight: bold;
  text-decoration: underline;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  padding: 0.2em 0.7em;
}
.project-title-row:active { background-color: #dde6db; }
.project-title-text {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.project-title-arrow {
  flex: 0 0 auto;
  margin-left: 0.4em;
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-width: 1.4em;
  max-width: 2em;
}

/* === PROJECT DESCRIPTION CLAMP === */
.project-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 6.2em;
  white-space: normal;
  font-size: 1rem;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Pin Open Chat button to card bottom */
.btn-wrapper, .mt-auto {
  margin-top: auto !important;
  align-self: flex-start;
}

/* === RESPONSIVE PROJECT GRID === */
@media (max-width: 600px) {
  html, body {
    width: 100vw;
    /*overflow-x: hidden !important;*/
  }
  .container {
    /*width: 100vw !important;
    max-width: 100vw !important;*/
    padding-left: 3vw !important;
    padding-right: 3vw !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    overflow-x: hidden !important;
  }
  .project-grid, .project {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }
  .project {
    min-height: 350px !important;
    padding: 1rem !important;
  }
  .project-grid { 
    grid-template-columns: 1fr !important; 
    gap: 0.5rem !important;
  }
  .project-image-wrapper {
    height: 140px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .project-image {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  .project-title-row {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0.2em 0.7em !important;
    overflow: hidden !important;
    background-color: #d8eed3;
    color: #5f6741;
    font-weight: bold;
    text-decoration: underline;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  .project-title-text {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    font-size: 1.1rem !important;
  }
  .project-title-arrow {
    flex: 0 0 auto !important;
    margin-left: 0.35em !important;
    display: flex !important;
    align-items: center !important;
    min-width: 1.4em !important;
    max-width: 2em !important;
    white-space: nowrap !important;
  }
}


/* === SCROLL-TO-TOP BUTTON === */
#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #198754;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  font-size: 18px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
#scrollTopBtn:hover { background-color: #145c38; }
@media (max-width: 576px) {
  #scrollTopBtn { right: 12px; bottom: 16px; }
  .branding-row .slogan-bn { font-size: 0.8rem; }
  .branding-row .slogan-text { font-size: 0.78rem; }
}

/* === NAVBAR BUTTONS === */
.navbar-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.85rem;
  margin-top: 10px;
}
.navbar-buttons .btn { padding: 4px 8px; }
.navbar-buttons .welcome-text {
  white-space: nowrap;
  font-size: 0.85rem;
  margin-right: 4px;
  color: #5f6741;
}


/* === PROFILE AVATAR/CIRCLE === */
.profile-link {
  display: flex;
  align-items: center;
  position: relative;
  margin-left: 8px;
}
.profile-ring-wrapper {
  position: absolute;
  left: -4px;
  z-index: 2;
  height: 28px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.profile-spinner-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: conic-gradient(
    #5f6741 0deg 7.5deg, #f3ede0 7.5deg 15deg, #5f6741 15deg 22.5deg, #f3ede0 22.5deg 30deg,
    #5f6741 30deg 37.5deg, #f3ede0 37.5deg 45deg, #5f6741 45deg 52.5deg, #f3ede0 52.5deg 60deg,
    #5f6741 60deg 67.5deg, #f3ede0 67.5deg 75deg, #5f6741 75deg 82.5deg, #f3ede0 82.5deg 90deg,
    #5f6741 90deg 97.5deg, #f3ede0 97.5deg 105deg, #5f6741 105deg 112.5deg, #f3ede0 112.5deg 120deg,
    #5f6741 120deg 127.5deg, #f3ede0 127.5deg 135deg, #5f6741 135deg 142.5deg, #f3ede0 142.5deg 150deg,
    #5f6741 150deg 157.5deg, #f3ede0 157.5deg 165deg, #5f6741 165deg 172.5deg, #f3ede0 172.5deg 180deg,
    #5f6741 180deg 187.5deg, #f3ede0 187.5deg 195deg, #5f6741 195deg 202.5deg, #f3ede0 202.5deg 210deg,
    #5f6741 210deg 217.5deg, #f3ede0 217.5deg 225deg, #5f6741 225deg 232.5deg, #f3ede0 232.5deg 240deg,
    #5f6741 240deg 247.5deg, #f3ede0 247.5deg 255deg, #5f6741 255deg 262.5deg, #f3ede0 262.5deg 270deg,
    #5f6741 270deg 277.5deg, #f3ede0 277.5deg 285deg, #5f6741 285deg 292.5deg, #f3ede0 292.5deg 300deg,
    #5f6741 300deg 307.5deg, #f3ede0 307.5deg 315deg, #5f6741 315deg 322.5deg, #f3ede0 322.5deg 330deg,
    #5f6741 330deg 337.5deg, #f3ede0 337.5deg 345deg, #5f6741 345deg 352.5deg, #f3ede0 352.5deg 360deg
  );
  animation: spin-ring 8s linear infinite;
  z-index: 1;
  transform: scale(1.2);
}
.profile-image-wrapper {
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.profile-img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: none;
  background-color: transparent;
}
.profile-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #5f6741;
  padding: 2px 6px 2px 27px;
  background: #e9f5dc;
  border-radius: 999px;
  border: 1px solid #5f6741;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.8),
    inset -1px -1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
  height: 26px;
  display: flex;
  align-items: center;
}
/* Ring spinning animation */
@keyframes spin-ring {
  from { transform: rotate(0deg) scale(1.2); }
  to   { transform: rotate(360deg) scale(1.2); }
}

/* === DESCRIPTION TEXTAREA FIX === */
textarea[name="description"] {
  max-width: 100%;
  width: 100%;
}
@media (max-width: 768px) {
  textarea[name="description"] {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }
}

/* === INBOX TABS & PANELS === */
.inbox-tab {
  background-color: #f3ede0;
  color: #5f6741;
  border: 1px solid #5f6741;
  border-radius: 5px 5px 0 0;
  padding: 10px;
  text-align: center;
  font-weight: bold;
  transition: background-color 0.2s ease;
}
.inbox-tab.selected-tab { background-color: #5f6741; color: #ffffff; }
.inbox-panel {
  background-color: #ffffff;
  border: 1px solid #5f6741;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 15px;
}
@media (max-width: 768px) {
  .list-group-item.d-flex { flex-direction: column !important; align-items: flex-start !important; }
  .list-group-item .position-relative { margin-top: 8px; padding-top: 8px; position: relative; }
  .list-group-item .badge {
    top: -8px; right: -8px; width: 20px; height: 20px; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; background-color: red; color: white;
  }
  .accordion-button { font-size: 0.9rem; padding: 10px; }
}

/* Second Navbar */
.second-navbar {
  background: #fff;
  border-bottom: 1px solid #e3e3e3;
  position: sticky;
  top: 46px;
  z-index: 1100;
}
.second-navbar .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.2rem 1rem;
  gap: 8px;
  min-height: 30px; /* ensure consistent height */
}
/* Hamburger FAB in Nav (smaller) */
.fab-menu-btn {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #5f6741;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: none;
  outline: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-right: 4px;
  padding: 0;
}
.fab-menu-btn .fab-icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: auto;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='white' stroke-width='2.5' stroke-linecap='round' d='M6 10h20M6 16h20M6 22h20'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.fab-menu-btn.active {
  background: #466234;
}
.second-nav-btns .btn {
  color: #5f6741;
  border-color: #5f6741;
  background-color: #fff;
  transition: background 0.2s, color 0.2s, border 0.2s;
  font-size: 0.8rem;
  border-radius: 6px;
  padding: 4px 10px;
  height: 30px;
  min-width: 70px;
}
.second-nav-btns .btn:hover,
.second-nav-btns .btn:focus {
  background-color: #5f6741;
  color: #fff;
  border-color: #5f6741;
}

/* FAB Menu Overlay */
.fab-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(70,100,70,0.13);
  z-index: 4999;
}
.fab-menu-overlay.active {
  display: block;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* FAB Expanding Menu - COMPACT */
.fab-menu-list {
  position: fixed;
  top: 150px; /* Below branding + main nav (58+46) */
  left: 40px;
  z-index: 5001;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.18s, transform 0.18s;
}
.fab-menu-list.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.fab-menu-link {
  display: block;
  min-width: 98px;
  max-width: 145px;
  background: #fff;
  color: #5f6741;
  border: 2px solid #5f6741;
  border-radius: 10px;
  font-size: 0.88rem;
  text-align: left;
  padding: 0.32em 1em 0.32em 0.8em;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(70, 100, 70, 0.05);
  transition: background 0.13s, color 0.13s, border 0.13s, box-shadow 0.12s;
}
.fab-menu-link:hover, .fab-menu-link:focus {
  background: #5f6741;
  color: #fff;
  border-color: #5f6741;
  box-shadow: 0 4px 12px rgba(70, 100, 70, 0.08);
}
@media (max-width: 991.98px) {
  .second-nav-btns { display: none !important; }
  .fab-menu-btn { display: inline-flex !important; }
}
@media (min-width: 992px) {
  .fab-menu-btn { display: none !important; }
  .fab-menu-list { display: none !important; }
  .fab-menu-overlay { display: none !important; }
}

/* First/main navbar sticky */
.bg-light.sticky-top, .main-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

