/* ==== Base panel styles ==== */
.panel-base {
  background: white;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  z-index: 1000;
}

/* ==== Team Management Panel (Side Panel) ==== */

.team-color-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  max-width: 240px;
}

.color-button {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: transform 0.1s, border 0.1s;
}

.color-button:hover {
  transform: scale(1.1);
}

.color-button.selected {
  border: 2px solid #333;
  transform: scale(1.1);
}

.color-selection-menu {
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 2000;
}


/* ==== Invite Screen (Modal) ==== */
.invite-screen {
  position: fixed;
  top: 50%;
  left: 50%;

  width: 600px;
  max-width: 90%;
  height: 80vh;
  max-height: 90vh;
  background: white;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}

/* ==== Header Styles ==== */
.window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #dbdbdb;
}

/* Invite screen header - blue background */
.invite-screen .window-header {
  padding: 10px 14px;
  background-color: #0d3b69;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.invite-screen .window-header h2 {
  font-size: 18px;
  color: white;
}

/* Team management panel header - gray */
.team-management-panel .window-header {
  padding: 10px 14px;
  background-color: #dbdbdb;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.team-management-panel .window-header h2 {
  font-size: 18px;
}

.window-header h2 {
  margin: 0;
  font-size: 16px;
  color: #495057;
  text-align: left;
}

.window-controls {
  display: flex;
  gap: 4px;
}

/* Close button for panel headers */
.window-header .close-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
}

/* Team management panel close button - dark color */
.team-management-panel .window-header .close-button {
  color: #666;
}

/* Container for invite person button below header */
.invite-person-button-container {
  width: 100%;
  padding: 8px 14px;
  background-color: white;
  border-bottom: 1px solid #e0e0e0;
  box-sizing: border-box;
}

.invite-person-button,
.add-person-button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
}

/* ==== Content Containers ==== */
.window-content,
.people-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

/* ==== Team Section Styles ==== */
/* Invite screen team sections */
.invite-screen .team-section {
  background-color: #f5f9ff !important;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

/* Team management panel team sections - styled like Image 3 */
.team-management-panel .team-section {
  background-color: #f7f9fd !important;
  margin-bottom: 10px;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
}

.team-management-panel .team-section h3 {
  margin: 0;
  padding: 10px 15px;
  font-size: 16px;
  color: #333;
  background-color: #edf1f7;
  font-weight: normal;
}

.team-management-panel .team-people-list,
.team-management-panel .team-members-list {
  padding: 8px 12px;
}

.invite-screen .team-section h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: #333;
}

/* Team header with drag handle */
.team-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  margin-bottom: 5px;
  height: 24px;
  min-height: 24px;
  background-color: rgba(0, 123, 255, 0.08);
  border-radius: 4px;
  cursor: grab;
}

.team-header:active {
  cursor: grabbing;
}

.team-name {
  flex: 1;
  font-weight: bold;
  cursor: text;
  line-height: 24px;
}

/* Team color dot - 20% bigger */
.team-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: pointer;
}

.delete-team {
  background: none;
  border: none;
  color: #ff4d4f;
  cursor: pointer;
  font-size: 16px;
}

.drag-handle {
  cursor: grab;
  color: #aaa;
  margin-right: 8px;
}

/* ==== Team Members List ==== */
.team-members-list,
.team-people-list {
  display: grid;
  gap: 6px;
  padding: 6px;
}

/* One column for team-management-panel */
.team-management-panel .team-members-list,
.team-management-panel .team-people-list {
  grid-template-columns: 1fr;
}

/* Two columns for invite screen */
.invite-screen .team-members-list,
.invite-screen .team-people-list {
  grid-template-columns: repeat(2, 1fr);
}

/* Only show drop highlight for people dropping, not for team dropping */
.team-section .team-members-list.drag-over,
.team-section .team-people-list.drag-over {
  background-color: rgba(0, 123, 255, 0.1);
  border: 2px dashed #007bff;
}

/* Disable drop styling when dragging a team */
.team-section.dragging ~ .team-section .team-members-list,
.team-section.dragging ~ .team-section .team-people-list,
body.dragging-team .team-members-list,
body.dragging-team .team-people-list {
  background-color: transparent !important;
  border: none !important;
}

/* ==== Person Card Styles ==== */
.person-card {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  background-color: #f9f9f9;
  border-radius: 4px;
  cursor: grab;
  position: relative;
  transition: background-color 0.2s;
  margin-bottom: 4px;
  border: 1px solid #eee;
  height: auto;
  min-height: 30px;
}

.person-card:hover {
  background-color: #e6f2ff;
  border-color: #007bff;
}

.person-card.dragging {
  opacity: 0.5;
}

.person-card .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  margin-right: 7px;
  flex-shrink: 0;
  font-size: 8px;
}

.person-details {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 10px;
}

/* Names and surname - 20% bigger */
.person-name, .person-surname {
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-name {
  color: #333;
}

.person-surname {
  color: #666;
}

/* Remove member button - 20% bigger */
.remove-member {
  background: none;
  border: none;
  color: #ff4d4f;
  cursor: pointer;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}

.person-card:hover .remove-member {
  opacity: 1;
}

/* ==== Modal Styles ==== */

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1400; /* Below invite-screen but above everything else */
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Higher than invite-screen */
}

.modal-content {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 20px;
  max-width: 400px;
  width: 100%;
}

.form-group input, 
.form-group select {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
}

.team-dropdown {
  height: 36px;
  font-size: 14px;
  color: #666;
  padding: 8px 12px;
  width: 100%;
  max-width: 360px;
}

select#teamSelection {
  height: 36px;
  font-size: 14px;
  color: #666;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
  color: #333;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #666;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
}


.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.modal-buttons button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.modal-cancel {
  background-color: #f0f0f0;
  color: #666;
}

.modal-submit {
  background-color: #1890ff;
  color: #fff;
}

/* ==== Animation Classes ==== */
.panel-hidden {
  transform: translateX(-100%);
}

/* ==== Responsive Adjustments ==== */
@media (max-width: 768px) {
  .invite-screen {
    width: 95%;
    height: 90vh;
  }
  
  .team-management-panel {
    width: 85%;
  }
  
  .invite-screen .team-members-list,
  .invite-screen .team-people-list {
    grid-template-columns: 1fr;
  }
}

/* ==== Team Dragging Styles ==== */
.team-section.dragging {
  opacity: 0.7;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  background-color: #e0ecff !important;
  border: none;
  width: auto !important;
  max-width: 300px !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
}