@use '../../raaghu-react-themes/tokens/breakpoints' as bp;

.rds-comp-video-player {
  position: relative;
  display: block;
  width: 100%;
  max-width: var(--rds-player-max-width, 480px);
  
  &__wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--rds-border-radius-sm);
    background-color: var(--rds-color-surface);
  }
  
  &__player {
    width: 100% !important;
    height: 100% !important;
    max-width: var(--rds-player-max-width, 480px);
    min-height: var(--rds-player-min-height, 180px);
    aspect-ratio: 16 / 9;
    
    & > div {
      width: 100% !important;
      height: 100% !important;
    }
    
    video {
      width: 100% !important;
      height: 100% !important;
      object-fit: cover;
    }
  }

  /* When native controls are hidden we still reserve space at the bottom
     so the player size remains consistent and toggling controls doesn't
     change the overall layout. */
  &__controls-spacer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--rds-player-controls-height, 48px);
    pointer-events: none; /* should not intercept clicks */
    /* visually match typical native control area: subtle gradient to blend */
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
    border-bottom-left-radius: var(--rds-border-radius-sm);
    border-bottom-right-radius: var(--rds-border-radius-sm);
  }
  
  &__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--rds-color-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--rds-z-index-raised);
  }
  
  &__disabled-message {
    color: var(--rds-color-on-surface-variant);
    font-size: var(--rds-font-size-body, 14px);
    text-align: center;
    padding: var(--rds-spacing-md, 16px);
    background-color: var(--rds-color-surface);
    border-radius: var(--rds-border-radius-sm);
  }
  
  &--disabled {
    pointer-events: none;
    opacity: 0.6;
    
    .rds-comp-video-player__wrapper {
      filter: grayscale(100%);
    }
  }
  
  @include bp.down(md) {
    &__player {
      min-height: var(--rds-player-min-height-sm, 150px);
    }
  }
  
  @include bp.down(sm) {
    &__player {
      min-height: var(--rds-player-min-height-xs, 120px);
    }
    
    &__disabled-message {
      font-size: var(--rds-font-size-small, 12px);
      padding: var(--rds-spacing-sm, 12px);
    }
  }
}
