/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f5f5;
  direction: rtl;
  padding: 0;
  margin: 0;
}

/* Header Styles */
.header {
  background: #fff;
  border-bottom: 3px solid #0066cc;
  padding: 20px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

h1 {
  color: #0066cc;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 8px;
}

.subtitle {
  color: #666;
  font-size: 16px;
  margin-bottom: 8px;
}

.header-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #0066cc;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
}

.header-link:hover {
  background: #0052a3;
  transform: translateY(-2px);
}

.header-link-icon {
  font-size: 18px;
}

/* Main Layout */
.main-container {
  max-width: 1600px;
  margin: 20px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 20px;
}

/* Sidebar Styles */
.sidebar {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: sticky;
  top: 160px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #0066cc;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #0066cc;
}

.list-container {
  max-height: 600px;
  overflow-y: auto;
}

/* List Items */
.list-item {
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item:hover {
  background: #e3f2fd;
  transform: translateX(-2px);
}

.list-item.active {
  background: #0066cc;
  color: white;
  font-weight: bold;
}

.item-count {
  font-size: 11px;
  color: #666;
  background: white;
  padding: 2px 6px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

.list-item.active .item-count {
  color: #0066cc;
}

.player-club-info {
  font-size: 11px;
  color: #999;
  margin-right: 4px;
}

.list-item.active .player-club-info {
  color: #e3f2fd;
}

/* Date Filter */
.date-filter-item {
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-filter-item:hover {
  background: #e3f2fd;
  transform: translateX(-2px);
}

.date-filter-item.active {
  background: #0066cc;
  color: white;
  font-weight: bold;
}

.date-filter-item.active .item-count {
  color: #0066cc;
}

/* Video Date Badge */
.video-date-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.video-date-badge-today {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.video-date-badge-yesterday {
  background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
  color: white;
}

.video-date-badge-week {
  background: linear-gradient(135deg, #ffc107 0%, #ffdb4d 100%);
  color: #333;
}

.video-date-badge-month {
  background: linear-gradient(135deg, #6c757d 0%, #95a5a6 100%);
  color: white;
}

.video-date-badge-date {
  background: linear-gradient(135deg, #95a5a6 0%, #b0bec5 100%);
  color: white;
}

.video-date-text {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  color: #666;
  font-weight: 600;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 8px;
  border-radius: 3px;
}

/* Filter Group Collapsible */
.filter-group {
  margin-bottom: 4px;
}

.filter-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  background: #f8f9fa;
  border-radius: 4px;
  transition: background 0.2s;
  margin-bottom: 6px;
}

.filter-group-header:hover {
  background: #e9ecef;
}

.filter-collapse-icon {
  font-size: 10px;
  color: #666;
  transition: transform 0.3s ease;
  display: inline-block;
}

.filter-group.collapsed .filter-collapse-icon {
  transform: rotate(-90deg);
}

.filter-group-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.filter-group.collapsed .filter-group-content {
  max-height: 0;
  opacity: 0;
}

/* Content Area */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Filter Section */
.filter-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #0066cc;
  color: white;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag:hover {
  background: #0052a3;
}

.filter-tag .remove-icon {
  font-weight: bold;
  font-size: 16px;
}

.clear-filters-btn {
  padding: 8px 16px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
}

.clear-filters-btn:hover {
  background: #c82333;
}

/* Videos Section */
.videos-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.section-title {
  font-size: 22px;
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #0066cc;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: #0066cc;
  font-size: 18px;
}

.error {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Event Groups */
.event-group {
  margin-bottom: 32px;
}

.event-header {
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.event-header:hover {
  background: #e9ecef;
}

.event-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.event-collapse-icon {
  font-size: 14px;
  color: #666;
  transition: transform 0.3s ease;
  display: inline-block;
}

.event-group.collapsed .event-collapse-icon {
  transform: rotate(-90deg);
}

.event-name {
  font-size: 18px;
  font-weight: bold;
  color: #0066cc;
}

.event-count {
  font-size: 14px;
  color: #666;
  background: white;
  padding: 4px 12px;
  border-radius: 12px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 10000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.event-group.collapsed .video-list {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.event-group.collapsed .event-header {
  margin-bottom: 0;
}

/* Video Card */
.video-card {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  background: #fafafa;
  transition: all 0.2s;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  position: relative;
}

.video-thumbnail {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  background: #e0e0e0;
  transition: opacity 0.2s;
}

.video-thumbnail:hover {
  opacity: 0.8;
}

.video-thumbnail-container {
  position: relative;
  display: inline-block;
}

.video-watched-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245, 245, 245, 0.6);
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 4px;
  pointer-events: none;
}

.video-watched-icon {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.video-card a {
  display: block;
}

.video-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-id {
  font-size: 16px;
  font-weight: bold;
  color: #0066cc;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.match-id:hover {
  color: #0052a3;
  text-decoration: underline;
}

.match-date {
  font-size: 12px;
  color: #999;
}

.match-details {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.player-info {
  text-align: center;
}

.player-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  cursor: pointer;
  transition: color 0.2s;
}

.player-name:hover {
  color: #0066cc;
}

.filter-highlight {
  background: #ffeb3b;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.club-name {
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: color 0.2s;
}

.club-name:hover {
  color: #0066cc;
}

.vs-divider {
  font-size: 14px;
  font-weight: bold;
  color: #999;
  text-align: center;
}

.score-display {
  font-size: 18px;
  font-weight: bold;
  color: #0066cc;
}

.score-container {
  position: relative;
  display: inline-block;
}

.score-blurred {
  filter: blur(6px);
  user-select: none;
  transition: filter 0.2s ease;
  cursor: pointer;
  position: relative;
}

.score-blurred:hover {
  filter: none;
}

.score-blurred::after {
  content: '👁️ הראה תוצאה';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  background: rgba(0, 102, 204, 0.9);
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.score-blurred:hover::after {
  opacity: 1;
}

.score-revealed {
  filter: none;
  cursor: pointer;
}

.video-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}

.event-tag {
  font-size: 12px;
  color: #0066cc;
  background: #e3f2fd;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.event-tag:hover {
  background: #0066cc;
  color: white;
}

.video-link {
  display: inline-block;
  background: #0066cc;
  color: white;
  padding: 8px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
}

.video-link:hover {
  background: #0052a3;
}

/* Statistics Section */
.statistics-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: bold;
  color: #0066cc;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #666;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 72px;
  margin-bottom: 24px;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: #666;
}

/* About Section */
.about-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-top: 20px;
  text-align: center;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 40px;
}

.about-title {
  font-size: 20px;
  font-weight: bold;
  color: #0066cc;
  margin-bottom: 16px;
}

.about-content {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .main-container {
    display: flex;
    flex-direction: column;
  }

  /* Show videos first on mobile */
  .content-area {
    order: 1;
  }

  .sidebar:first-child {
    order: 2;
  }

  .sidebar:last-child {
    order: 3;
  }

  .sidebar {
    position: static;
    max-width: 100%;
  }

  .list-container {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 22px;
  }

  .subtitle {
    font-size: 14px;
  }

  .header-links {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .header-link {
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
  }

  .header-link-icon {
    font-size: 16px;
  }

  .match-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .vs-divider {
    margin: 8px 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-card {
    grid-template-columns: 1fr;
  }

  .video-thumbnail {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 18px;
  }

  .subtitle {
    font-size: 12px;
  }

  .header {
    padding: 12px 0;
  }

  .header-content {
    padding: 0 12px;
  }

  .header-link {
    font-size: 12px;
    padding: 8px 10px;
  }

  .header-link span:last-child {
    font-size: 11px;
  }
}
