/* ===========================================
   Tips 13 Resultatet - Styles
   URL: /resultater/tips-13-resultatet/
   =========================================== */

/* --- CSS Variables --- */
:root {
  --t13-primary: #1a5c2e;
  --t13-primary-dark: #0e3d1c;
  --t13-primary-light: #2a8b47;
  --t13-accent: #f0c040;
  --t13-accent-dark: #d4a520;
  --t13-bg: #f5f7fa;
  --t13-card-bg: #ffffff;
  --t13-text: #1a1a2e;
  --t13-text-light: #6b7280;
  --t13-border: #e5e7eb;
  --t13-home: #22c55e;
  --t13-draw: #eab308;
  --t13-away: #ef4444;
  --t13-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --t13-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --t13-radius: 12px;
  --t13-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
.tips13-resultatet-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--t13-text);
  line-height: 1.6;
  background: var(--t13-bg);
}

.tips13-resultatet-page *,
.tips13-resultatet-page *::before,
.tips13-resultatet-page *::after {
  box-sizing: border-box;
}

.tips13-resultatet-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Hero Section --- */
.hero-section {
  background: linear-gradient(135deg, var(--t13-primary-dark) 0%, var(--t13-primary) 50%, var(--t13-primary-light) 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, -20px); }
}

.hero-section h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0 0 16px;
  position: relative;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 650px;
  margin: 0 auto;
  position: relative;
  line-height: 1.7;
}

/* --- Controls Section --- */
.controls-section {
  padding: 30px 0 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--t13-bg);
  border-bottom: 1px solid var(--t13-border);
}

.controls-wrapper {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid var(--t13-border);
  border-radius: var(--t13-radius);
  font-size: 0.95rem;
  transition: var(--t13-transition);
  background: var(--t13-card-bg);
}

.search-box input:focus {
  outline: none;
  border-color: var(--t13-primary);
  box-shadow: 0 0 0 3px rgba(26,92,46,0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.5;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--t13-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: 12px 36px 12px 14px;
  border: 2px solid var(--t13-border);
  border-radius: var(--t13-radius);
  font-size: 0.95rem;
  background: var(--t13-card-bg);
  cursor: pointer;
  transition: var(--t13-transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--t13-primary);
  box-shadow: 0 0 0 3px rgba(26,92,46,0.15);
}

.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  min-height: 32px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--t13-primary);
  color: #fff;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

.filter-tag button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.filter-tag button:hover {
  opacity: 1;
}

/* --- Stats Dashboard --- */
.stats-dashboard {
  padding: 30px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--t13-card-bg);
  border-radius: var(--t13-radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--t13-shadow);
  transition: var(--t13-transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--t13-primary);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--t13-shadow-lg);
}

.stat-card:hover::after {
  transform: scaleX(1);
}

.stat-card[data-stat="home"]::after { background: var(--t13-home); }
.stat-card[data-stat="draw"]::after { background: var(--t13-draw); }
.stat-card[data-stat="away"]::after { background: var(--t13-away); }

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--t13-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card[data-stat="home"] .stat-number { color: var(--t13-home); }
.stat-card[data-stat="draw"] .stat-number { color: var(--t13-draw); }
.stat-card[data-stat="away"] .stat-number { color: var(--t13-away); }

.stat-label {
  font-size: 0.85rem;
  color: var(--t13-text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-bar {
  margin-top: 12px;
  height: 6px;
  background: var(--t13-bg);
  border-radius: 3px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
  width: 0;
}

.home-fill { background: var(--t13-home); }
.draw-fill { background: var(--t13-draw); }
.away-fill { background: var(--t13-away); }

/* --- Results Section --- */
.results-section {
  padding: 10px 0 40px;
}

.results-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--t13-card-bg);
  border-radius: var(--t13-radius);
  padding: 4px;
  box-shadow: var(--t13-shadow);
  width: fit-content;
}

.tab-btn {
  padding: 10px 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  transition: var(--t13-transition);
  color: var(--t13-text-light);
}

.tab-btn.active {
  background: var(--t13-primary);
  color: #fff;
}

.tab-btn:hover:not(.active) {
  background: var(--t13-bg);
}

/* Results List */
.results-container {
  min-height: 200px;
}

.day-group {
  margin-bottom: 24px;
  animation: slideUp 0.4s ease;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--t13-primary);
  color: #fff;
  border-radius: var(--t13-radius) var(--t13-radius) 0 0;
  cursor: pointer;
  user-select: none;
  transition: var(--t13-transition);
}

.day-header:hover {
  background: var(--t13-primary-dark);
}

.day-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.day-header .match-count {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
}

.day-header .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}

.day-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.day-matches {
  background: var(--t13-card-bg);
  border-radius: 0 0 var(--t13-radius) var(--t13-radius);
  box-shadow: var(--t13-shadow);
  overflow: hidden;
}

.day-matches.collapsed {
  display: none;
}

.league-group {
  border-bottom: 1px solid var(--t13-border);
}

.league-group:last-child {
  border-bottom: none;
}

.league-header {
  padding: 10px 20px;
  background: var(--t13-bg);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--t13-text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.league-flag {
  font-size: 1.1rem;
}

.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--t13-border);
  transition: var(--t13-transition);
  gap: 12px;
}

.match-row:last-child {
  border-bottom: none;
}

.match-row:hover {
  background: rgba(26,92,46,0.03);
}

.match-row.highlight {
  animation: highlightPulse 0.6s ease;
}

.team-home {
  text-align: right;
  font-weight: 500;
  font-size: 0.95rem;
}

.score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 70px;
  justify-content: center;
}

.score-divider {
  color: var(--t13-text-light);
}

.team-away {
  font-weight: 500;
  font-size: 0.95rem;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.result-badge.result-1 { background: var(--t13-home); }
.result-badge.result-X { background: var(--t13-draw); }
.result-badge.result-2 { background: var(--t13-away); }

/* Table View */
.results-table-view table {
  width: 100%;
  border-collapse: collapse;
  background: var(--t13-card-bg);
  border-radius: var(--t13-radius);
  overflow: hidden;
  box-shadow: var(--t13-shadow);
}

.results-table-view th {
  background: var(--t13-primary);
  color: #fff;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.results-table-view th:hover {
  background: var(--t13-primary-dark);
}

.results-table-view th .sort-icon {
  margin-left: 6px;
  opacity: 0.5;
}

.results-table-view th.sort-active .sort-icon {
  opacity: 1;
}

.results-table-view td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--t13-border);
  font-size: 0.9rem;
}

.results-table-view tr:hover td {
  background: rgba(26,92,46,0.03);
}

.results-table-view tr:last-child td {
  border-bottom: none;
}

/* --- Info Section --- */
.info-section {
  padding: 50px 0 40px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 50px;
}

.info-card {
  background: var(--t13-card-bg);
  border-radius: var(--t13-radius);
  padding: 30px;
  box-shadow: var(--t13-shadow);
  transition: var(--t13-transition);
  border-top: 4px solid var(--t13-primary);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--t13-shadow-lg);
}

.info-card h2 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  color: var(--t13-primary);
}

.info-card p {
  margin: 0;
  color: #000 !important;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- FAQ Section --- */
.faq-section {
  max-width: 800px;
  margin: 0 auto;
}

.faq-section > h2 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 30px;
  color: var(--t13-text);
}

.faq-item {
  background: var(--t13-card-bg);
  border-radius: var(--t13-radius);
  margin-bottom: 12px;
  box-shadow: var(--t13-shadow);
  overflow: hidden;
}

.faq-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--t13-text);
  text-align: left;
  transition: var(--t13-transition);
}

.faq-toggle:hover {
  color: var(--t13-primary);
}

.faq-icon {
  font-size: 1.4rem;
  font-weight: 300;
  transition: transform 0.3s ease;
  color: var(--t13-primary);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 24px;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 24px 20px;
}

.faq-answer p {
  margin: 0;
  color: var(--t13-text-light);
  line-height: 1.7;
}

/* --- Breadcrumb --- */
.breadcrumb-nav {
  padding: 20px 0 30px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.breadcrumb li::after {
  content: '>';
  margin-left: 8px;
  color: var(--t13-text-light);
}

.breadcrumb li:last-child::after {
  display: none;
}

.breadcrumb a {
  color: var(--t13-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--t13-primary-dark);
  text-decoration: underline;
}

.breadcrumb li:last-child {
  color: var(--t13-text-light);
}

/* --- Loading Spinner --- */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
  color: var(--t13-text-light);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--t13-border);
  border-top-color: var(--t13-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Load More Button --- */
.load-more-wrapper {
  text-align: center;
  padding: 20px 0;
}

.btn-load-more {
  padding: 14px 40px;
  background: var(--t13-primary);
  color: #fff;
  border: none;
  border-radius: var(--t13-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t13-transition);
}

.btn-load-more:hover {
  background: var(--t13-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--t13-shadow-lg);
}

/* --- No Results --- */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--t13-text-light);
  font-size: 1.1rem;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes highlightPulse {
  0% { background: rgba(26,92,46,0.1); }
  100% { background: transparent; }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 40px 0 35px;
  }
  .hero-section h1 {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .controls-wrapper {
    flex-direction: column;
  }
  .search-box {
    min-width: 100%;
  }
  .filter-group {
    width: 100%;
  }
  .filter-group select {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .stat-number {
    font-size: 1.8rem;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .match-row {
    grid-template-columns: 1fr auto 1fr auto;
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  .score {
    font-size: 0.95rem;
    min-width: 55px;
  }
  .results-tabs {
    width: 100%;
  }
  .tab-btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .hero-section h1 {
    font-size: 1.6rem;
  }
  .controls-section {
    position: relative;
  }
}
