/**
 * Минимальная мобильная адаптация для РПЛ 2025
 */

/* Мобильные устройства */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  /* Стартовая таблица матчей - компактно в одну строку */
  .match-item {
    grid-template-columns: 1fr 80px 1fr;
    gap: 5px;
    padding: 10px 0;
    font-size: 14px;
  }
  
  .match-date,
  .match-venue {
    display: none;
  }

  /* Панель управления - в колонку */
  .advanced-table-controls {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }
  
  .control-group {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .control-label {
    width: 100%;
    text-align: center;
    font-size: 12px;
  }
  
  .control-btn {
    font-size: 11px;
    padding: 8px 10px;
  }
  
  .mobile-controls {
    display: none;
  }

  /* Таблицы команд - фиксированная левая колонка */
  .table-container-fixed {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .team-analysis-table {
    font-size: 10px;
    min-width: 600px;
  }
  
  .team-analysis-table th,
  .team-analysis-table td {
    padding: 4px 6px;
    font-size: 10px;
  }
  
  .team-analysis-table .param-column {
    position: sticky;
    left: 0;
    z-index: 8;
    background-color: #fafafa;
    border-right: 2px solid #ddd;
    min-width: 140px;
    font-size: 10px;
  }
  
  .team-analysis-table thead th:first-child {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 11;
    background-color: #e8e8e8;
  }

  /* Статистика матчей - в колонку */
  .match-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* ===== СОБЫТИЯ МАТЧА - В СТРОЧКУ КОМПАКТНО ===== */
  .events-list {
    padding: 10px;
    gap: 6px;
  }
  
  .event-item {
    display: grid;
    grid-template-columns: 50px 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    margin-bottom: 6px;
    font-size: 13px;
  }
  
  .event-time {
    font-weight: bold;
    color: #007bff;
    font-size: 14px;
    text-align: center;
  }
  
  .event-team {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
  }
  
  .event-type {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
  }
  
  .event-player {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    text-align: right;
  }

  /* ===== СТАТИСТИКА ПО ПЕРИОДАМ - ОБЫЧНАЯ ТАБЛИЦА ===== */
  .periods-stats-table {
    font-size: 12px;
    min-width: auto;
    width: 100%;
    display: table !important;
    border-collapse: collapse;
  }
  
  .periods-stats-table th,
  .periods-stats-table td {
    padding: 6px 4px;
    font-size: 11px;
    text-align: center;
    border: 1px solid #ddd;
    display: table-cell !important;
  }
  
  .periods-stats-table th:first-child,
  .periods-stats-table td:first-child {
    min-width: 100px;
    font-size: 11px;
    padding-left: 6px;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 8;
    background-color: #fafafa;
    border-right: 2px solid #ddd;
  }
  
  .periods-stats-table thead th:first-child {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 11;
    background-color: #e8e8e8;
  }
  
  .periods-stats-table thead th {
    font-size: 10px;
    padding: 4px 3px;
    background-color: #f5f5f5;
  }

  /* ===== ИНТЕРАКТИВНЫЕ ГРАФИКИ - МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
  .interactive-chart-container {
    padding: 10px;
    margin: 15px 0;
  }
  
  .chart-header h3 {
    font-size: 18px;
  }
  
  .chart-subtitle {
    font-size: 12px;
  }
  
  .chart-controls {
    margin-bottom: 15px;
    padding: 15px;
  }
  
  .checkboxes-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .parameter-checkbox {
    padding: 8px;
  }
  
  .checkbox-label {
    font-size: 13px;
  }
  
  .chart-content {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .chart-legend {
    order: -1;
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .chart-svg-container {
    padding: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
  }
  
  .chart-svg {
    width: 100%;
    height: auto;
    min-width: 400px;
    max-height: 350px;
  }
  
  /* Принудительно задаем размеры SVG на мобилке */
  .interactive-chart-container svg {
    width: 100% !important;
    height: 350px !important;
    max-width: none;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .container {
    padding: 5px;
  }
  
  .match-item {
    grid-template-columns: 1fr 70px 1fr;
    font-size: 12px;
  }
  
  .team-analysis-table {
    font-size: 9px;
    min-width: 550px;
  }
  
  .team-analysis-table th,
  .team-analysis-table td {
    padding: 3px 4px;
    font-size: 9px;
  }
  
  .team-analysis-table .param-column {
    min-width: 120px;
    font-size: 9px;
  }

  /* ===== СОБЫТИЯ МАТЧА ЭКСТРА КОМПАКТНО ===== */
  .events-list {
    padding: 5px;
    gap: 4px;
  }
  
  .event-item {
    grid-template-columns: 45px 1fr auto 1fr;
    gap: 6px;
    padding: 6px 8px;
    margin-bottom: 4px;
    font-size: 12px;
  }
  
  .event-time {
    font-size: 13px;
  }
  
  .event-team,
  .event-type {
    font-size: 12px;
  }
  
  .event-player {
    font-size: 11px;
  }

  /* ===== СТАТИСТИКА ПО ПЕРИОДАМ ЭКСТРА КОМПАКТНО ===== */
  .periods-stats-table th,
  .periods-stats-table td {
    padding: 5px 3px;
    font-size: 10px;
  }
  
  .periods-stats-table th:first-child,
  .periods-stats-table td:first-child {
    min-width: 90px;
    font-size: 10px;
    padding-left: 5px;
  }
  
  .periods-stats-table thead th {
    font-size: 9px;
    padding: 4px 2px;
  }

  /* ===== ГРАФИКИ ЭКСТРА КОМПАКТНО ===== */
  .interactive-chart-container {
    padding: 8px;
    margin: 10px 0;
  }
  
  .chart-header h3 {
    font-size: 16px;
  }
  
  .chart-subtitle {
    font-size: 11px;
  }
  
  .chart-controls {
    padding: 10px;
  }
  
  .parameter-checkbox {
    padding: 6px;
  }
  
  .checkbox-label {
    font-size: 12px;
  }
  
  .chart-legend {
    padding: 12px;
  }
  
  .chart-svg-container {
    padding: 8px;
    padding-bottom: 35px;
  }
  
  .chart-svg {
    max-height: 300px;
  }
  
  .interactive-chart-container svg {
    height: 300px !important;
  }
} 

/* Резерв под нижние фиксированные панели/подразделы на мобильном,
     чтобы список матчей аккуратно заканчивался над ними */
@media (max-width: 768px) {
  :root { --bottom-ui-height: 110px; }
  .matches-view { padding-bottom: var(--bottom-ui-height); }
  .match-list { padding-bottom: var(--bottom-ui-height); }
  .round-section:last-child { margin-bottom: calc(var(--bottom-ui-height) + 10px); }
} 