/* Teams Page Styles */
.teams-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.teams-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

/* Teams Grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .teams-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .teams-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .teams-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Team Card */
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  height: 15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.team-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: var(--primary-color);
  background-size: 40px 40px !important;
}

.team-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.team-card:hover .team-card-content {
  transform: scale(1.1);
}

.team-avatar {
  width: 6rem;
  height: 6rem;
  background-color: white;
  border-radius: 50%;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.team-avatar-img {
  height: 5rem;
  width: 5rem;
  object-fit: contain;
}

.team-card-name {
  font-weight: 700;
  font-size: 1.125rem;
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
}

.team-card:hover .team-card-name {
  background-color: #ffffff;
  color: #111827;
  border-color: #9ca3af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Team Abbreviation Styling */
.team-abbreviation {
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #4b5563;
  padding: 0.25rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
  background-color: #f9fafb;
  transition: all 0.3s ease;
}

.team-card:hover .team-abbreviation {
  background-color: #ffffff;
  border-color: #9ca3af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.team-hover-arrow {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background-color: white;
  border-radius: 50%;
  padding: 0.3rem;
  display: none;
}

.team-card:hover .team-hover-arrow {
  display: block;
}

/* Create Team Card */
.create-team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  height: 15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.create-team-card:hover {
  border-color: #10b981;
  background-color: #ecfdf5;
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Not Logged In Create Team Card */
.create-team-card.not-logged-in {
  cursor: not-allowed;
  position: relative;
  opacity: 0.9;
}

.create-team-card.not-logged-in:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
  background-color: #f9fafb;
}

.create-team-card.not-logged-in .create-icon {
  opacity: 0.7;
}

.create-team-card.not-logged-in:hover .create-icon {
  color: #9ca3af;
  transform: none;
}

.create-team-card.not-logged-in:hover .create-text {
  color: #6b7280;
}

.login-hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #ca8a04;
  font-style: italic;
}

.create-team-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.create-icon {
  font-size: 4rem;
  color: #9ca3af;
  transition: color 0.3s ease;
}

.create-team-card:hover .create-icon {
  color: #10b981;
  transform: scale(1.1);
}

.create-text {
  font-weight: 500;
  font-size: 1.125rem;
  color: #6b7280;
  transition: color 0.3s ease;
}

.create-team-card:hover .create-text {
  color: #059669;
}

/* Team Invites */
.team-invites {
  margin-bottom: 2rem;
}

.invites-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.no-invites {
  padding: 1.5rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  text-align: center;
  color: #6b7280;
}

.invites-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.invite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background-color: white;
}

.invite-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.team-logo-container {
  background-color: white;
  border-radius: 50%;
  padding: 0.25rem;
}

.team-logo {
  height: 3rem;
  width: 3rem;
  object-fit: contain;
}

.team-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.invite-info {
  font-size: 0.875rem;
  color: #6b7280;
}

.invite-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-decline {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  border: 1px solid #e5e7eb;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-decline:hover {
  background-color: #f3f4f6;
}

.btn-accept {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  border: none;
  background-color: var(--primary-color, #3b82f6);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-accept:hover {
  opacity: 0.9;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  overflow-y: auto;
}

/* When modal is active, show it with proper centering */
.modal.active {
  display: flex !important;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px; /* Adjusted padding to match admin modal positioning */
}

.modal-content {
  position: relative;
  background-color: white;
  border-radius: 0.5rem;
  max-width: 32rem;
  width: 100%;
  max-height: 80vh; /* Set a reasonable max height */
  overflow-y: auto; /* Enable scrolling for content that exceeds max height */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: modal-open 0.3s ease;
  margin: auto; /* Center in flex container */
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Modal animation */
@keyframes modal-open {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #ef4444;
}

.team-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.875rem;
  color: #4b5563;
}

.form-group input[type="text"],
.form-group input[type="file"] {
  padding: 0.625rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="file"]:focus {
  outline: none;
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.logo-preview {
  display: none;
  margin-top: 0.75rem;
  text-align: center;
  background-color: #f9fafb;
  padding: 1rem;
  border-radius: 0.375rem;
  border: 1px dashed #d1d5db;
}

.logo-preview img {
  height: 6rem;
  width: 6rem;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background-color: white;
  padding: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.colors-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.color-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-input-group input[type="color"] {
  width: 3.5rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: border-color 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.color-input-group input[type="color"]:focus {
  outline: none;
  border-color: var(--primary-color, #3b82f6);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.btn-cancel {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.btn-submit {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: none;
  background-color: var(--primary-color, #3b82f6);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-submit:hover {
  opacity: 0.9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* User's Team Badge */
.your-team-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background-color: rgba(234, 179, 8, 0.85);
  color: #000;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 20;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* User's team - special highlight */
.team-card.user-team {
  border-color: #eab308;
  box-shadow: 0 4px 6px -1px rgba(234, 179, 8, 0.1), 0 2px 4px -1px rgba(234, 179, 8, 0.06);
}

.team-card.user-team:hover {
  border-color: #ca8a04;
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(234, 179, 8, 0.2), 0 4px 6px -2px rgba(234, 179, 8, 0.1);
}

/* Pending team */
.team-card.pending-team {
  cursor: default;
  border-color: #a1a1aa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  opacity: 0.8;
  background-color: #f9fafb;
  pointer-events: none; /* Disable all interactions */
}

.team-card.pending-team:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-color: #a1a1aa;
  background-color: #f9fafb;
}

.team-card.pending-team .team-hover-arrow {
  display: none;
}

.team-card.pending-team .your-team-badge {
  background-color: #a1a1aa;
  color: white;
}

/* Rejected team */
.team-card.rejected-team {
  cursor: default;
  border-color: #ef4444;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.1);
  opacity: 0.8;
  background-color: #fef2f2;
  pointer-events: none; /* Disable all interactions */
}

.team-card.rejected-team:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  background-color: #fef2f2;
}

.team-card.rejected-team .team-hover-arrow {
  display: none;
}

.team-card.rejected-team .your-team-badge {
  background-color: #ef4444;
  color: white;
}

.reject-reason {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #ef4444;
  text-align: center;
  padding: 0.25rem 0.5rem;
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 0.25rem;
  max-width: 100%;
} 