/* ================================
   Teams Feature Styles
   ================================ */

/* Teams Page */
.teams-section {
  margin-bottom: 32px;
}

.teams-section .section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-icon {
  font-size: 24px;
}

.section-header h3 {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.section-header .badge {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Invitations Grid */
.invitations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.invitation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.invitation-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.team-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.team-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 16px;
}

/* Team icons without background */
.team-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

.team-icon-large {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  flex-shrink: 0;
}

.invitation-info {
  flex: 1;
  min-width: 0;
}

.invitation-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invitation-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.invitation-actions {
  display: flex;
  gap: 8px;
}

.invitation-actions .btn {
  flex: 1;
  padding: 10px 16px;
}

/* Pending Invitation Accept Button - Green */
.invitation-actions .btn-success {
  background: #22c55e;
  color: white;
  border: none;
}

.invitation-actions .btn-success:hover {
  background: #16a34a;
}

/* Pending Invitation Decline Button - Red Outline */
.invitation-actions .btn-decline {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
}

.invitation-actions .btn-decline:hover {
  background: #ef4444;
  color: white;
}

/* Teams Grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.team-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.team-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.role-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.role-owner {
  background: var(--warning);
  color: white;
}

.role-badge.role-admin {
  background: var(--primary);
  color: white;
}

.role-badge.role-member {
  background: var(--secondary);
  color: white;
}

.team-card h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.team-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-meta {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* Team Creation Modal Steps */
.modal-step {
  padding: 8px 0;
}

.modal-step h3 {
  margin: 0 0 8px 0;
  font-size: 22px;
}

.modal-subtitle {
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  font-size: 14px;
}

/* Icon Picker */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
}

.icon-option {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-elevated);
}

.icon-option:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.icon-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Color Picker */
.color-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 12px;
}

.color-option {
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  border: 3px solid transparent;
  position: relative;
}

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

.color-option.selected {
  border-color: white;
  box-shadow: 0 0 0 2px var(--bg-card);
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
  font-weight: bold;
}

/* Email Input */
.email-input-container {
  display: flex;
  gap: 8px;
}

.email-input-container .form-input {
  flex: 1;
}

.invite-emails-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  min-height: 40px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 12px;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 13px;
}

.email-chip button {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.email-chip button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Team Preview */
.team-preview {
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
}

.team-preview h4 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.team-preview p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
}

.team-settings-summary {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.setting-item {
  padding: 8px 0;
  font-size: 14px;
}

.setting-item strong {
  color: var(--text-primary);
  margin-right: 8px;
}

.setting-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

/* Toggle Switches for Team Settings */
.toggles-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 8px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 10px;
}

.toggle-label {
  flex: 1;
  margin-right: 16px;
}

.toggle-label h4 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.toggle-label p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Toggle Switch Styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Inline Editing Styles */
.team-name-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-name-text {
  transition: opacity 0.2s;
}

.team-name-text:hover {
  opacity: 0.8;
}

.edit-hint {
  cursor: pointer;
  font-size: 16px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.edit-hint:hover {
  opacity: 1;
}

.team-description {
  position: relative;
}

.description-text {
  transition: opacity 0.2s;
}

.description-text:hover {
  opacity: 0.8;
}

.add-description-hint {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  margin-left: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.add-description-hint:hover {
  opacity: 1;
}

.inline-edit-input {
  font-size: 24px;
  font-weight: 600;
  padding: 4px 8px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  width: 100%;
  max-width: 400px;
}

.inline-edit-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.inline-edit-textarea {
  font-size: 14px;
  padding: 8px 12px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  width: 100%;
  max-width: 400px;
  resize: vertical;
  font-family: inherit;
}

.inline-edit-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.inline-edit-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.modal-actions .btn {
  min-width: 100px;
}
/* Team Detail Page */
.team-detail-header {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 24px;
}

.team-detail-header .team-icon-large {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  flex-shrink: 0;
}

.team-info {
  flex: 1;
}

.team-info h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.team-info p {
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

.team-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.team-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.team-section h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px 0;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}

.member-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
}

.member-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.member-email {
  font-size: 13px;
  color: var(--text-muted);
}

.member-card.pending-invitation {
  opacity: 0.7;
  border-style: dashed;
}

.member-card.pending-invitation .member-avatar {
  background: var(--text-muted);
}

.status-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .invitations-grid {
    grid-template-columns: 1fr;
  }

  .invitation-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .invitation-card {
    padding: 12px;
  }

  .invitation-card h3 {
    font-size: 16px;
  }
}

