/* === Container Layout === */
.projects-manager-wrapper {
  display: block;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.projects-manager-wrapper-loaded {
  padding: 2rem;
  min-height: 100vh;
  box-sizing: border-box;
}

.projects-manager-wrapper-loaded .projects-manager-wrapper {
  opacity: 1;
  transform: scale(1);
}

/* === Header Row: Title + Buttons === */
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.projects-header h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

#new-project-btn {
  padding: 0.5rem 1rem;
  background-color: #111827;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#new-project-btn:hover {
  background-color: #1f2937;
}

.btn-filter {
  padding: 0.5rem 1rem;
  background-color: #6366f1;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

/* === Search Bar === */
.projects-search {
  position: relative;
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #374151;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  font-size: 1rem;
}

/* === Project Grid Layout === */
#project-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 1rem;
  min-height: 50vh;
  transition: all 0.3s ease;
}

/* === Flip Card Layout === */
.flip-card {
  background: transparent;
  min-height: 450px;
  perspective: 2000px;
  z-index: 1;
}

.flip-card:hover {
  z-index: 2;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  transition: none;
}

.flip-card-front {
  z-index: 2;
  transform: rotateY(0deg);
}

.flip-card-back {
  transform: rotateY(180deg);
  z-index: 1;
}

/* === Project Card Styling (Shared) === */
.project-card {
  background: #ffffff;
  padding: 1.2rem 1rem;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 450px;
  box-sizing: border-box;
}

.project-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: #1f2937;
}

.project-card p {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

/* === Card Header Layout === */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.75rem;
}

.flip-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #4b5563;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.flip-btn:hover {
  background-color: #f3f4f6;
}

/* === Tag Styling === */
.tags {
  margin-bottom: 1rem;
  flex-grow: 1;
}

.tag {
  display: inline-block;
  background-color: #eef2ff;
  color: #4338ca;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  margin: 0 6px 6px 0;
}

/* === Card Actions Container === */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

/* === Go To Project Button === */
.go-btn {
  background-color: #2563eb;
  color: white;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  width: 100%;
}

.go-btn:hover {
  background-color: #1d4ed8;
}

/* === Edit Button === */
.edit-btn {
  background-color: #6366f1;
  color: white;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.edit-btn:hover {
  background-color: #4f46e5;
}

/* === Empty State Note === */
.empty-note {
  font-style: italic;
  color: #666;
  text-align: center;
  padding: 2rem 0;
}

/* === Filters Section === */
.projects-filters {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  margin-bottom: 0;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  cursor: pointer;
}

.filter-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.9rem;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.range-inputs input {
  flex: 1;
}

.filter-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.autocomplete-results {
  position: absolute;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 0.25rem;
}

/* === Status Badges === */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.status-active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-badge.status-on-hold {
  background-color: #fef3c7;
  color: #92400e;
}

.status-badge.status-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-badge.status-completed {
  background-color: #dbeafe;
  color: #1e40af;
}

/* === Project Status Visual Indicators === */
.project-card.project-cancelled {
  opacity: 0.7;
  border-left: 4px solid #dc2626;
}

.project-card.project-on-hold {
  border-left: 4px solid #f59e0b;
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === New Card Layout Styles === */

/* Client Name */
.client-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

/* Progress Container */
.progress-container {
  margin-bottom: 0.75rem;
}

.progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.progress-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

/* Phase/Step Info */
.phase-step-info {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background-color: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #6366f1;
}

/* User Icons */
.user-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.user-icons-empty {
  font-size: 0.8rem;
  color: #9ca3af;
  font-style: italic;
  margin-bottom: 1rem;
}

.user-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.user-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tags Container */
.tags-container {
  margin-bottom: 1rem;
  flex-grow: 1;
}

.tag-more {
  cursor: pointer;
  background-color: #dbeafe !important;
  color: #1e40af !important;
  transition: background-color 0.2s ease;
}

.tag-more:hover {
  background-color: #bfdbfe !important;
}

/* Card Back Details */
.card-details {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.detail-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.detail-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.detail-item {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.detail-item strong {
  color: #374151;
  font-weight: 600;
  margin-right: 0.5rem;
}

.project-value {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #059669 !important;
}

/* BD Partners Count with Tooltip */
.bd-partners-count {
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  transition: color 0.2s ease;
}

.bd-partners-count:hover {
  color: #1d4ed8;
}

.bd-partners-tooltip {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  z-index: 1000;
  max-width: 250px;
  pointer-events: none;
}

.tooltip-content {
  font-size: 0.85rem;
  color: #374151;
}

.tooltip-content > div {
  padding: 0.25rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.tooltip-content > div:last-child {
  border-bottom: none;
}