/**
 * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
 */
import * as styled from 'styled-components';
import {H1, P} from 'components/typography';
import Theme from 'theme';

export const LoginFormBackground = styled.default.div`
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-image: url(${Theme.backgrounds.loginBackground});
  background-size: cover;
  background-position: center;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    
    z-index: 1;
  }
  
  /* Ensure content is above the overlay */
  > * {
    position: relative;
    z-index: 2;
  }
`;

export const LogoContainer = styled.default.div`
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 3;
  
  img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1); /* Makes the logo white */
  }
`;

export const LoginContainer = styled.default.div`
  background: rgba(25, 25, 25, 0.9);
  border-radius: 12px;
  padding: 2.5rem;
  min-width: 400px;
  max-width: 450px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
`;

export const LoginHeader = styled.default(H1)`
  color: ${Theme.colors.white};
  text-align: center;
  font-size: 2.5rem;
  font-weight: 300;
  margin: 0 0 0.5rem 0;
`;

export const LoginText = styled.default(P)`
  color: ${Theme.colors.white};
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  opacity: 0.9;
`;

export const LoginForm = styled.default.form`
  display: flex;
  flex-direction: column;
  gap: 1rem;
`;

export const InputContainer = styled.default.div`
  position: relative;
  margin-bottom: 1rem;
`;

export const InputField = styled.default.input`
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(35, 35, 35, 0.7);
  color: ${Theme.colors.white};
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;

  &::placeholder {
    color: ${Theme.colors.gray500};
  }

  &:focus {
    border-color: ${Theme.colors.white};
    background: rgba(45, 45, 45, 0.9);
  }
`;

export const InputIcon = styled.default.img`
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  opacity: 0.7;
`;

export const LoginButton = styled.default.button`
  background: linear-gradient(135deg, ${Theme.colors.red}, ${Theme.colors.lightRed});
  color: ${Theme.colors.white};
  border: none;
  border-radius: 8px;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(238, 45, 82, 0.4);
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }
`;

export const LoginLink = styled.default.a`
  color: ${Theme.colors.cyan};
  cursor: pointer;
  text-align: center;
  margin-top: 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;

  &:hover {
    opacity: 1;
  }
`;

export const ErrorText = styled.default.div`
  text-align: center;
  color: ${Theme.colors.red};
  background: rgba(238, 45, 82, 0.1);
  border: 1px solid rgba(238, 45, 82, 0.3);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
`;

export const Footer = styled.default.div`
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  
  a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin: 0 0.3rem;
    
    &:hover {
      color: rgba(255, 255, 255, 0.8);
    }
  }
`;
