import styled from '@emotion/styled';

import { staticAssetUrl } from '@/utils/staticAssetUrl';

export const GlassModule = styled.div<{ focused?: boolean }>`
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  width: 100%;

  position: relative;

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.1);
  border-left-color: rgba(255, 255, 255, 0.07);
  border-right-color: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  &:before {
    content: '';
    position: absolute;
    background-image: url(${staticAssetUrl('utilities/noise.svg')});
    background-size: 250px;
    background-repeat: repeat;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.04;
    pointer-events: none;
    z-index: -1;
  }
`;

export const SongImage = styled.img`
  object-fit: cover;
  aspect-ratio: 8/11;
  border-radius: 4px;
  height: 100%;
`;

export const GlassBlock = styled(GlassModule)`
  border-radius: 0;
  height: 100%;
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
`;

export const GlassModuleHeader = styled.div`
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 12px;
  color: #bab4b1;
  font-family: 'Input Sans', monospace;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  * + & {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
`;

export const GlassModuleBody = styled.div`
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  overflow-y: auto;
  flex-grow: 1;
  position: relative;
`;

export const ModuleDivider = styled.div`
  min-width: 10px;
  min-height: 10px;
`;

export const CanvasRendererContainer = styled.div<{ fadeOut?: boolean }>`
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  opacity: ${({ fadeOut }) => (fadeOut ? 0 : 1)};
  transition: opacity 0.4s;
`;

export const TrackHeaders = styled.div`
  height: 100%;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
`;

export const TrackHeader = styled.div`
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
`;

export const StyledTrackHeader = styled(TrackHeader)`
  text-transform: uppercase;
  font-family: 'Input Sans', monospace;
  font-size: 10px;
  justify-content: flex-start;
  padding-left: 10px;
`;
