@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* CSS Variables - zgodne z aplikacją mobilną i stroną Netlify */
:root {
  /* Talenzio app colors - matching mobile app and Netlify website */
  --background: #13161B;
  --foreground: #ffffff;
  
  --card: #13161B;
  --card-foreground: #ffffff;
  
  --popover: #13161B;
  --popover-foreground: #ffffff;
  
  /* Primary blue - matching app color #003FB2 */
  --primary: #003FB2;
  --primary-foreground: #ffffff;
  --primary-hover: #0056D6;
  
  /* Secondary surfaces */
  --secondary: #13161B;
  --secondary-foreground: #ffffff;
  
  --muted: #333333;
  --muted-foreground: #aab2bd;
  
  /* Accent - lighter blue for hover states */
  --accent: #0056D6;
  --accent-foreground: #ffffff;
  
  --destructive: #f44336;
  --destructive-foreground: #ffffff;
  
  --border: #333333;
  --input: #333333;
  --ring: #003FB2;
  
  --radius: 5px;
  
  /* Custom Talenzio colors - matching app */
  --talenzio-blue: #003FB2;
  --talenzio-blue-light: #0056D6;
  --talenzio-blue-glow: #003FB2;
  --talenzio-dark: #13161B;
  --talenzio-surface: #13161B;
  --talenzio-surface-light: #13161B;
  
  /* Position colors - keeping original for consistency */
  --position-gk: hsl(45, 100%, 50%);
  --position-def: hsl(120, 60%, 45%);
  --position-mid: hsl(217, 100%, 50%);
  --position-att: hsl(0, 75%, 55%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  font-smooth: antialiased;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
}

/* Glass Card Effect */
.glass-card {
  background: #13161B;
  border: 1px solid #333333;
  border-radius: 5px;
  transition: all 0.3s ease;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #13161B;
  border-bottom: 1px solid #333333;
  padding: 1rem 0;
}

.navbar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 600;
}

.nav-brand .logo {
  height: 40px;
  width: auto;
}

.nav-links {
  display: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #003FB2;
}

.nav-link.active {
  color: #003FB2;
}

/* Main Content */
.main-content {
  padding-top: 80px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Header */
.page-header {
  padding: 100px 0 60px;
  background: #13161B;
  border-bottom: 1px solid #333333;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffffff;
}

@media (min-width: 768px) {
  .page-header h1 {
    font-size: 3.5rem;
  }
}

.page-header .highlight {
  color: #ffffff;
}

.page-header p {
  color: #aab2bd;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .hero-section {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--secondary);
  border-radius: 5px;
  border: 1px solid #333333;
  transition: all 0.3s;
  width: 100%;
}

@media (min-width: 768px) {
  .search-bar {
    width: 20rem;
  }
}

.search-bar:focus-within {
  border-color: #003FB2;
}

.search-bar svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-size: 0.875rem;
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.search-clear {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.search-clear:hover {
  color: var(--foreground);
}

.search-clear svg {
  width: 1rem;
  height: 1rem;
}

/* Filters Section */
.filters-section {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.filters-sidebar {
  display: none;
  width: 18rem;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .filters-sidebar {
    display: block;
    position: sticky;
    top: 6rem;
  }
}

.filter-section {
  padding: 1.5rem;
}

.filter-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.filter-section h3 svg {
  width: 1rem;
  height: 1rem;
  color: var(--primary);
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.filter-select {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--secondary);
  border: 1px solid #333333;
  border-radius: 5px;
  color: var(--foreground);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.3s;
  cursor: pointer;
}

.filter-select:focus {
  border-color: #003FB2;
}

.position-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.position-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid;
}

.position-badge-gk {
  background: hsla(45, 100%, 50%, 0.2);
  color: hsl(45, 100%, 50%);
  border-color: hsla(45, 100%, 50%, 0.3);
}

.position-badge-def {
  background: hsla(120, 60%, 45%, 0.2);
  color: hsl(120, 60%, 45%);
  border-color: hsla(120, 60%, 45%, 0.3);
}

.position-badge-mid {
  background: hsla(217, 100%, 50%, 0.2);
  color: hsl(217, 100%, 50%);
  border-color: hsla(217, 100%, 50%, 0.3);
}

.position-badge-att {
  background: hsla(0, 75%, 55%, 0.2);
  color: hsl(0, 75%, 55%);
  border-color: hsla(0, 75%, 55%, 0.3);
}

.position-badge:hover {
  opacity: 1;
}

.position-badge.selected {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px currentColor;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem 0;
}

.checkbox-group input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.375rem;
  border: 2px solid rgba(220, 10%, 60%, 0.5);
  background: transparent;
  cursor: pointer;
  accent-color: var(--primary);
}

.checkbox-group span {
  font-size: 0.875rem;
  color: var(--foreground);
}

.filter-reset {
  width: 100%;
  margin-top: 1rem;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.filter-reset:hover {
  border-color: var(--primary);
  background: var(--secondary);
}

/* Results Header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.results-count {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.results-count strong {
  color: var(--foreground);
  font-weight: 600;
}

.filters-badge {
  padding: 0.125rem 0.5rem;
  background: hsla(217, 100%, 40%, 0.1);
  color: var(--primary);
  font-size: 0.75rem;
  border-radius: 9999px;
  margin-left: 1rem;
}

.results-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-toggle {
  display: flex;
  align-items: center;
  background: var(--secondary);
  border-radius: 5px;
  padding: 0.25rem;
  gap: 0.25rem;
}

.view-toggle button {
  padding: 0.5rem;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle button:hover {
  color: var(--foreground);
}

.view-toggle button.active {
  background: #003FB2;
  color: #ffffff;
}

.view-toggle button svg {
  width: 1rem;
  height: 1rem;
}

/* Mobile Filters */
.mobile-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .mobile-filters {
    display: none;
  }
}

/* Image Loading - prevent flickering */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  background: var(--secondary);
}

img[loading="lazy"].loaded {
  opacity: 1;
}

img[loading="lazy"]:not(.loaded) {
  background: var(--secondary);
  background-image: linear-gradient(90deg, var(--secondary) 0%, var(--muted) 50%, var(--secondary) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Players Grid */
.players-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .players-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .players-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Clubs Grid */
.clubs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .clubs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .clubs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.clubs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Video Card (Grid View) */
.video-card {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: var(--card);
  border: 1px solid #333333;
  transition: all 0.3s ease;
  cursor: pointer;
}

.video-card:hover {
  border-color: #003FB2;
  box-shadow: 0 0 40px rgba(0, 63, 178, 0.3);
  transform: translateY(-4px);
}

.video-thumbnail {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  width: 100%;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.1);
}

.video-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--background), transparent 30%);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

.play-button {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(0, 63, 178, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(0, 63, 178, 0.3);
}

.play-button svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--primary-foreground);
  margin-left: 0.25rem;
}

.video-dots {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.video-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.video-dot.active {
  width: 1rem;
  background: var(--primary);
}

.video-info-overlay {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
}

.video-count-badge {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(19, 22, 27, 0.8);
  backdrop-filter: blur(4px);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: var(--foreground);
}

.video-count-badge svg {
  width: 0.75rem;
  height: 0.75rem;
}

.player-photo-overlay {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-photo-overlay img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

.verified-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verified-badge svg {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--primary-foreground);
}

.video-card-content {
  padding: 1rem;
}

.video-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.video-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}

.video-card-header p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #003FB2;
}

.rating svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.rating span {
  font-weight: 600;
}

.club-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #333333;
}

.club-info img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

.club-info span {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.video-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.video-card-footer div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.video-card-footer svg {
  width: 0.75rem;
  height: 0.75rem;
}

/* List View Card */
.list-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
  transition: all 0.3s;
  cursor: pointer;
}

.list-card:hover {
  border-color: #003FB2;
}

.list-card-photo {
  position: relative;
  width: 5rem;
  height: 5rem;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.list-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-card-info {
  flex: 1;
  min-width: 0;
}

.list-card-info h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

.list-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.list-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.list-card-meta svg {
  width: 0.75rem;
  height: 0.75rem;
}

.list-card-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.list-card-stats div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.list-card-arrow {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted-foreground);
  transition: all 0.3s;
}

.list-card:hover .list-card-arrow {
  color: #003FB2;
  transform: translateX(0.25rem);
}

/* Club Card */
.club-card {
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.club-card:hover {
  border-color: #003FB2;
}

.club-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.club-logo {
  width: 4rem;
  height: 4rem;
  border-radius: 5px;
  overflow: hidden;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.club-logo img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}

.club-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.club-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  transition: color 0.3s;
}

.club-card:hover h3 {
  color: #003FB2;
}

.club-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.club-description {
  font-size: 0.875rem;
  color: rgba(220, 10%, 60%, 0.8);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.club-positions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #333333;
}

.club-positions span {
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
}

.club-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.club-stats div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.club-stats svg {
  width: 0.75rem;
  height: 0.75rem;
}

.club-button {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.club-card:hover .club-button {
  background: #003FB2;
  color: #ffffff;
  border-color: #003FB2;
}

.club-button svg {
  width: 1rem;
  height: 1rem;
}

/* Loading, Error, No Results */
.loading,
.error,
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted-foreground);
  grid-column: 1 / -1;
}

.no-results svg {
  width: 4rem;
  height: 4rem;
  color: rgba(220, 10%, 60%, 0.3);
  margin: 0 auto 1rem;
}

.no-results h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.no-results p {
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.clear-filters-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
}

.clear-filters-btn:hover {
  border-color: #003FB2;
  background: var(--secondary);
}

/* Load More */
.load-more {
  text-align: center;
  margin-top: 3rem;
}

.load-more-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.load-more-btn:hover {
  border-color: #003FB2;
  background: var(--secondary);
}

.load-more-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 10%, 60%, 0.5);
}

/* Footer */
.footer {
  background-color: #13161B;
  color: white;
  padding: 40px 0 20px;
  border-top: 1px solid #333333;
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer p {
  text-align: center;
  color: #aab2bd;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1023px) {
  .filters-section {
    flex-direction: column;
  }
  
  .hero-section {
    padding-top: 5rem !important;
  }
  
  .hero-section > .container > div {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  .hero-section .search-bar {
    max-width: 100% !important;
  }
}

@media (min-width: 768px) {
  .hero-section > .container > div {
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
  }
}
