/* === PREMIUM TEAM VIEW MODE - LACİVERT & 3D ANIMATIONS © 2025 === */

/* Lacivert Color Palette */
:root {
  --navy-1: #0f1f33;
  --navy-2: #1a3a52;
  --navy-3: #2d5a7a;
  --navy-4: #3d7bc9;
  --navy-5: #5a9fdd;
  --gold: #ffd700;
}

/* Hero Section */
.team-view-hero {
  padding: 60px 40px;
  text-align: center;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.15), rgba(61, 123, 201, 0.08));
  border-bottom: 2px solid rgba(45, 90, 122, 0.3);
  position: relative;
  overflow: hidden;
  animation: slideDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  perspective: 1000px;
}

.team-view-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(61, 123, 201, 0.1) 0%, transparent 70%);
  animation: rotateGlow 20s linear infinite;
  pointer-events: none;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-40px) rotateX(10deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

@keyframes rotateGlow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.team-view-hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #1a3a52 0%, #2d5a7a 25%, #3d7bc9 50%, #5a9fdd 75%, #2d5a7a 100%);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.team-view-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 600px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Grid */
.teams-premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 32px;
  padding: 60px 40px;
  max-width: 1400px;
  margin: 0 auto;
  perspective: 1500px;
}

/* Team Card - 3D Premium */
.team-card-premium {
  background: linear-gradient(145deg, var(--card-bg), var(--card-alt));
  border: 2px solid rgba(45, 90, 122, 0.3);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transform-style: preserve-3d;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px rgba(15, 31, 51, 0.2);
}

.team-card-premium:nth-child(1) { animation-delay: 0.05s; }
.team-card-premium:nth-child(2) { animation-delay: 0.15s; }
.team-card-premium:nth-child(3) { animation-delay: 0.25s; }
.team-card-premium:nth-child(4) { animation-delay: 0.35s; }
.team-card-premium:nth-child(n+5) { animation-delay: 0.45s; }

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.8) rotateX(15deg) rotateY(-10deg); }
  100% { opacity: 1; transform: scale(1) rotateX(0) rotateY(0); }
}

.team-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #1a3a52 20%, #2d5a7a 40%, #3d7bc9 50%, #2d5a7a 60%, #1a3a52 80%, transparent 100%);
  animation: shimmerTop 3s ease-in-out infinite;
}

@keyframes shimmerTop { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.team-card-premium:hover {
  transform: translateY(-15px) rotateX(5deg) scale(1.02);
  box-shadow: 0 40px 100px rgba(45, 90, 122, 0.4), 0 0 60px rgba(61, 123, 201, 0.3), inset 0 0 40px rgba(61, 123, 201, 0.1);
  border-color: rgba(61, 123, 201, 0.6);
}

.team-card-premium::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(61, 123, 201, 0) 0%, rgba(61, 123, 201, 0.1) 50%, rgba(61, 123, 201, 0) 100%);
  opacity: 0;
  border-radius: 20px;
  pointer-events: none;
}

.team-card-premium:hover::after {
  opacity: 1;
  animation: glossShine 0.6s ease-in-out;
}

@keyframes glossShine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.team-card-header {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 140px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.2), rgba(61, 123, 201, 0.1));
  border: 2px solid rgba(61, 123, 201, 0.2);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.team-card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 60%);
  animation: floatGlow 4s ease-in-out infinite;
}

@keyframes floatGlow { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(10px, -10px); } }

.team-logo-large, .team-avatar-large {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  position: relative;
  z-index: 2;
  box-shadow: 0 15px 40px rgba(15, 31, 51, 0.4);
  transition: all 0.4s ease;
}

.team-card-premium:hover .team-logo-large,
.team-card-premium:hover .team-avatar-large {
  transform: scale(1.1) rotateZ(-3deg);
  box-shadow: 0 25px 60px rgba(61, 123, 201, 0.5);
}

.team-avatar-large {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.3), rgba(61, 123, 201, 0.2));
  border: 2px solid rgba(61, 123, 201, 0.3);
  color: #3d7bc9;
  font-weight: 900;
  font-size: 2rem;
}

.team-card-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 18px;
  text-align: center;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #2d5a7a, #3d7bc9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.team-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(61, 123, 201, 0.2);
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.team-stat-item {
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.1), rgba(61, 123, 201, 0.08));
  border-radius: 12px;
  border: 1px solid rgba(61, 123, 201, 0.2);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.team-stat-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.team-stat-item:hover {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.2), rgba(61, 123, 201, 0.15));
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 30px rgba(61, 123, 201, 0.3);
  border-color: rgba(61, 123, 201, 0.5);
}

.team-stat-item:hover::before { transform: translateX(100%); }

.team-stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: #3d7bc9;
  line-height: 1;
  margin-bottom: 4px;
}

.team-stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Player Roster */
.team-roster-static {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.roster-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(61, 123, 201, 0.2);
}

.roster-name { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.roster-sub { font-size: 0.8rem; color: #3d7bc9; font-weight: 600; }

.roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.roster-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.05), rgba(61, 123, 201, 0.03));
  border-radius: 10px;
  border: 1px solid rgba(61, 123, 201, 0.15);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.5s ease-out backwards;
}

.roster-player:nth-child(1) { animation-delay: 0.6s; }
.roster-player:nth-child(2) { animation-delay: 0.65s; }
.roster-player:nth-child(3) { animation-delay: 0.7s; }
.roster-player:nth-child(n+4) { animation-delay: 0.75s; }

@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

.roster-player::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(180deg, #3d7bc9, transparent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s ease;
}

.roster-player:hover {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.15), rgba(61, 123, 201, 0.1));
  border-color: rgba(61, 123, 201, 0.4);
  transform: translateX(8px);
  box-shadow: 0 8px 20px rgba(61, 123, 201, 0.2);
}

.roster-player:hover::before { transform: scaleY(1); }

.player-ident { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.player-name { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.player-role { font-size: 0.7rem; color: #3d7bc9; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }

.player-insights { display: flex; align-items: center; gap: 8px; }

.player-goals {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffd700;
  background: rgba(61, 123, 201, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.player-info-btn {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.2), rgba(61, 123, 201, 0.1));
  border: 1px solid rgba(61, 123, 201, 0.4);
  color: #3d7bc9;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.player-info-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
}

.player-info-btn:hover {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.35), rgba(61, 123, 201, 0.25));
  border-color: #3d7bc9;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(61, 123, 201, 0.3);
}

.player-info-btn:hover::before { transform: translateX(100%); }

.roster-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px 10px;
  font-size: 0.9rem;
}

/* Modal */
.player-info-layer {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 31, 51, 0.7), rgba(45, 90, 122, 0.5));
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.player-info-layer[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.player-info-dialog {
  background: linear-gradient(145deg, var(--card-bg), var(--card-alt));
  border: 2px solid rgba(61, 123, 201, 0.3);
  border-radius: 20px;
  box-shadow: 0 40px 120px rgba(15, 31, 51, 0.5), 0 0 80px rgba(61, 123, 201, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop { 0% { opacity: 0; transform: scale(0.7) rotateX(20deg); } 100% { opacity: 1; transform: scale(1) rotateX(0); } }

.player-info-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.1), rgba(26, 58, 82, 0.05));
  border: 1px solid rgba(61, 123, 201, 0.2);
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
  z-index: 1;
}

.player-info-close:hover {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.2), rgba(61, 123, 201, 0.1));
  color: #3d7bc9;
  transform: rotate(90deg) scale(1.1);
}

.player-info-header {
  padding: 24px;
  border-bottom: 2px solid rgba(61, 123, 201, 0.2);
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.1), rgba(61, 123, 201, 0.05));
  animation: slideDown 0.5s ease-out;
}

.player-info-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.2), rgba(61, 123, 201, 0.1));
  border: 2px solid rgba(61, 123, 201, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3d7bc9;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(61, 123, 201, 0.2);
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn { from { transform: scale(0.5); } to { transform: scale(1); } }

.player-info-text { flex: 1; animation: fadeInUp 0.5s ease-out 0.1s both; }

.player-info-name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  color: #3d7bc9;
  background: linear-gradient(135deg, #2d5a7a, #3d7bc9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.player-info-meta { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.player-info-team, .player-info-position { font-size: 0.85rem; color: var(--text-muted); }

.player-info-body { padding: 24px; animation: fadeInUp 0.5s ease-out 0.2s both; }

.player-info-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.player-info-stat {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.1), rgba(61, 123, 201, 0.08));
  border-radius: 12px;
  border: 1px solid rgba(61, 123, 201, 0.2);
  transition: all 0.4s ease;
  animation: slideUp 0.5s ease-out backwards;
}

.player-info-stat:nth-child(1) { animation-delay: 0.3s; }
.player-info-stat:nth-child(2) { animation-delay: 0.35s; }
.player-info-stat:nth-child(3) { animation-delay: 0.4s; }

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.player-info-stat:hover {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.15), rgba(61, 123, 201, 0.1));
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 30px rgba(61, 123, 201, 0.3);
}

.player-info-stat .label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.player-info-stat .value {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  color: #3d7bc9;
}

.player-info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease-out 0.3s both;
}

.player-info-tags .tag {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.15), rgba(61, 123, 201, 0.08));
  border: 1px solid rgba(61, 123, 201, 0.3);
  color: #3d7bc9;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.player-info-tags .tag:nth-child(1) { animation-delay: 0.4s; }
.player-info-tags .tag:nth-child(2) { animation-delay: 0.45s; }
.player-info-tags .tag:nth-child(3) { animation-delay: 0.5s; }
.player-info-tags .tag:nth-child(n+4) { animation-delay: 0.55s; }

.player-info-history {
  border-top: 2px solid rgba(61, 123, 201, 0.2);
  padding-top: 16px;
  animation: fadeInUp 0.5s ease-out 0.35s both;
}

.player-info-history h4 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3d7bc9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-info-seasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-info-seasons li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.05), rgba(61, 123, 201, 0.03));
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  animation: slideIn 0.4s ease-out backwards;
}

.player-info-seasons li:nth-child(1) { animation-delay: 0.45s; }
.player-info-seasons li:nth-child(2) { animation-delay: 0.5s; }
.player-info-seasons li:nth-child(3) { animation-delay: 0.55s; }
.player-info-seasons li:nth-child(n+4) { animation-delay: 0.6s; }

.player-info-seasons li .season-label { color: var(--text-muted); flex: 1; }
.player-info-seasons li .season-goals { color: #ffd700; font-weight: 700; }

.player-info-seasons li.current {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.15), rgba(61, 123, 201, 0.08));
  border: 1px solid rgba(61, 123, 201, 0.3);
  box-shadow: inset 0 0 20px rgba(61, 123, 201, 0.1);
}

.player-info-seasons li:hover {
  background: linear-gradient(135deg, rgba(61, 123, 201, 0.1), rgba(61, 123, 201, 0.05));
  border-color: rgba(61, 123, 201, 0.3);
  transform: translateX(5px);
}

/* Footer */
.premium-footer {
  background: linear-gradient(135deg, var(--card-bg), var(--card-alt));
  border-top: 2px solid rgba(61, 123, 201, 0.2);
  padding: 40px;
  animation: fadeInUp 1s ease-out 1s both;
}

.footer-brand { color: #3d7bc9; font-weight: 900; }
.footer-title { color: #3d7bc9; }

/* Responsive Design */
@media (max-width: 1200px) {
  .teams-premium-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .team-view-hero {
    padding: 40px 20px;
  }

  .team-view-hero h1 {
    font-size: 2rem;
  }

  .teams-premium-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 40px 20px;
  }

  .team-card-premium {
    padding: 16px;
  }

  .team-card-name {
    font-size: 1.4rem;
  }

  .team-card-header {
    height: 100px;
  }

  .team-logo-large,
  .team-avatar-large {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 600px) {
  .team-view-hero {
    padding: 30px 16px;
  }

  .team-view-hero h1 {
    font-size: 1.5rem;
  }

  .team-view-hero p {
    font-size: 0.9rem;
  }

  .team-card-premium {
    padding: 12px;
  }

  .team-card-stats {
    gap: 8px;
    margin-bottom: 16px;
  }

  .team-stat-value {
    font-size: 1.2rem;
  }

  .player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-info-dialog {
    width: 95%;
    max-height: 90vh;
  }

  .player-info-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* Core Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Light Theme Overrides */
:root[data-theme='light'] .team-view-hero {
  background: linear-gradient(135deg, rgba(26, 58, 82, 0.08), rgba(61, 123, 201, 0.04)) !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

:root[data-theme='light'] .team-card-premium {
  background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px -2px rgba(15, 31, 51, 0.08) !important;
}

:root[data-theme='light'] .team-card-premium:hover {
  box-shadow: 0 20px 60px rgba(61, 123, 201, 0.15), 0 0 40px rgba(61, 123, 201, 0.1) !important;
}
