// 리플레이 패널 스타일
// tracking 패키지 참조: src/tracking/components/ReplayV2.scss
// 기존 패널 스타일 패밀리 적용: src/scss/SideComponent.scss

.replay-panel {
  // 패널 헤더
  .panelHeader {
    display: flex;
    align-items: center;
    padding: 0 2rem;

    .panelTitle {
      padding: 1.7rem 0;
      font-size: var(--fs-ml, 1.4rem);
      font-weight: var(--fw-bold, 700);
      color: var(--white, #fff);
    }
  }

  // 패널 본문
  .panelBody {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0 2rem 2rem 2rem;
    overflow-y: auto;

    // 조회 조건 영역
    .query-section {
      background-color: var(--secondary1, rgba(255, 255, 255, 0.05));
      border-radius: 0.6rem;
      padding: 1.5rem;
      margin-bottom: 2rem;

      .section-title {
        font-size: var(--fs-m, 1.3rem);
        font-weight: var(--fw-bold, 700);
        color: var(--white, #fff);
        margin-bottom: 1.5rem;
      }

      .query-row {
        display: flex;
        align-items: center;
        margin-bottom: 1.2rem;

        .query-label {
          min-width: 5rem;
          font-size: var(--fs-s, 1.2rem);
          color: var(--tertiary4, #ccc);
        }

        .datetime-inputs {
          display: flex;
          gap: 0.8rem;
          flex: 1;

          .input-date,
          .input-time {
            flex: 1;
            height: 3.2rem;
            padding: 0.4rem 0.8rem;
            background-color: var(--tertiary1, rgba(0, 0, 0, 0.3));
            border: 1px solid var(--tertiary2, rgba(255, 255, 255, 0.2));
            border-radius: 0.4rem;
            color: var(--white, #fff);
            font-size: var(--fs-s, 1.2rem);
            font-family: inherit;

            &:focus {
              outline: none;
              border-color: var(--primary1, rgba(255, 255, 255, 0.5));
            }

            &:disabled {
              opacity: 0.5;
              cursor: not-allowed;
            }

            // 달력/시계 아이콘 색상 조정
            &::-webkit-calendar-picker-indicator {
              filter: invert(1);
              cursor: pointer;
            }
          }

          .input-date {
            min-width: 14rem;
          }

          .input-time {
            min-width: 10rem;
          }
        }
      }

      // 버튼 영역
      .btnBox {
        display: flex;
        justify-content: flex-end;
        margin-top: 2rem;
        gap: 1rem;

        .btn {
          min-width: 12rem;
          padding: 1rem 2rem;
          border-radius: 0.4rem;
          font-size: var(--fs-s, 1.2rem);
          font-weight: var(--fw-semibold, 600);
          cursor: pointer;
          transition: all 0.2s;
          border: none;

          &.btn-primary {
            background-color: var(--primary1, #4a9eff);
            color: var(--white, #fff);

            &:hover:not(:disabled) {
              background-color: var(--primary2, #3a8eef);
            }

            &:disabled {
              background-color: var(--secondary3, #555);
              cursor: not-allowed;
              opacity: 0.6;
            }
          }

          &.btn-query {
            min-width: 14rem;
          }
        }
      }
    }

    // 조회 결과 영역
    .result-section {
      flex: 1;
      min-height: 20rem;
      display: flex;
      flex-direction: column;
      background-color: var(--tertiary1, rgba(0, 0, 0, 0.2));
      border-radius: 0.6rem;
      padding: 1.5rem;
      overflow-y: auto;

      // 컨텐츠가 없을 때만 중앙 정렬 (직접 자식만 선택)
      &:empty,
      &:has(> .loading-message),
      &:has(> .empty-message),
      &:has(> .error-message) {
        align-items: center;
        justify-content: center;
      }

      .loading-message,
      .empty-message,
      .error-message,
      .success-message {
        font-size: var(--fs-m, 1.3rem);
        color: var(--tertiary4, #999);
        text-align: center;
        line-height: 1.6;
      }

      .loading-message {
        color: var(--primary1, #4a9eff);

        .progress-info {
          margin-top: 1rem;
          font-size: var(--fs-s, 1.2rem);
          color: var(--tertiary4, #ccc);
        }
      }

      .success-message {
        color: #4ade80; // green
      }

      .error-message {
        color: #f87171; // red
      }

      // 필터 및 목록 컨테이너 (수직 배치)
      .replay-control-v2,
      .vessel-list-manager {
        width: 100%;
      }
    }
  }
}
