'use client'
import { styled } from 'styled-components'
import { Colors, Gradient } from './variable'
import { device } from './Devices'

const Main = styled.main`
    padding-top: 100px;
    @media ${device.tablet} {
        padding-top: 82px;
    }
    @media ${device.mobile} {
        padding-top: 68px;
    }
`

const LightGradientCard = styled.div`
    border-radius: 40px;
    background: ${Gradient.primary};
    &.dark-gradient {
        background: ${Gradient.DarkPinkGradient};
    }
`

const WhiteCard = styled.div`
    border-radius: 25px;
    background: ${Colors.white};
    padding: 30px;
    &.card-shadow {
        box-shadow: ${Colors.shadow};
    }
    &.card-border {
        border: 1px solid ${Colors.black};
    }
    &.light-border {
        border: 1px solid #c0c0c0;
    }
`

const FlexBox = styled.div`
    display: flex;
    align-items: center;
    justify-content: center;
    &.align-start {
        align-items: start;
    }
    &.align-end {
        align-items: end;
    }
    &.justify-start {
        justify-content: flex-start;
    }
    &.justify-end {
        justify-content: flex-end;
    }
    &.align-stretch {
        align-items: stretch;
    }
    &.inline-flex {
        display: inline-flex;
    }
`

const FlexList = styled.ul`
    display: flex;
    align-items: center;
    justify-content: center;
    &.align-start {
        align-items: start;
    }
    &.align-end {
        align-items: end;
    }
    &.justify-start {
        justify-content: flex-start;
    }
    &.justify-end {
        justify-content: flex-end;
    }
    &.align-stretch {
        align-items: stretch;
    }
    &.inline-flex {
        display: inline-flex;
    }
`

const InputGroup = styled.div`
    margin-bottom: 30px;
    position: relative;
    .error{
        position: absolute;
        bottom: -16px;
        left: 10px;
        display: block;
        width: 100%;
        font-size: 14px;
        line-height: 16px;
        color: ${Colors.red};
        margin: 0;
        text-align: start;
        text-transform: capitalize;
    }
    input,textarea{
        font-size: 20px;
        color: ${Colors.gray_33};
        padding: 16px 24px;
        border-radius: 70px;
        border: 1px solid rgb(51 51 51 / 40%);
        width: 100%;
        &::placeholder {
            opacity: 0.3;
        }
        &:focus {
            border-color: ${Colors.primary};
        }
        @media ${device.tablet} {
            padding: 11px 20px;
        }
        @media ${device.mobile} {
            font-size: 14px;
            padding: 9px 16px;
        }
    }
    textarea{
        border-radius: 34px;
        resize: none;
    }
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    input[type='number'] {
        -moz-appearance: textfield;
    }
    .file {
        position: absolute;
        top: 0;
        left: 0;
        background: url('/candidate/assets/icons/icon-export.svg') no-repeat;
        background-size: 24px 24px;
        background-position: right 30px center;
        width: 100%;
        height: 100%;
        cursor: pointer;
        border-radius: 70px;
        @media ${device.mobileS} {
            background-position: right 16px center;
        }
    }
    input[type='file'] {
        display: none;
    }
    &.upload-file {
        input {
            padding-right: 56px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            @media ${device.mobileS} {
                padding-right: 44px;
            }
        }
    }
    @media ${device.mobile} {
        margin-bottom: 20px;
    }
`

const TitleWrapper = styled.div`
    margin-bottom: 60px;
    h5 {
        display: inline-block;
        border-radius: 33px;
        color: ${Colors.body};
        background: ${Gradient.primary};
        padding: 10px 32px;
        margin-bottom: 30px;
    }
    h2 {
        margin: 0;
        color: ${Colors.body};
    }
    p {
        margin: 30px 0 0;
    }
    @media ${device.laptopS} {
        margin-bottom: 40px;
        h5 {
            margin-bottom: 20px;
            padding: 8px 20px;
        }
        p {
            margin: 20px 0 0;
        }
    }
    @media ${device.tablet} {
        h5 {
            font-size: 20px;
            margin-bottom: 16px;
            padding: 8px 16px;
        }
        p {
            margin: 16px 0 0;
        }
    }
    @media ${device.mobileS} {
        margin-bottom: 30px;
        h5 {
            font-size: 16px;
        }
    }
`

const SiteBannerSection = styled.section`
    background: ${Gradient.primary};
    border-radius: 0px 0px 50px 50px;
    height: 472px;
    position: relative;
    &::before {
        content: '';
        position: absolute;
        bottom: 0;
        width: auto;
        height: 100%;
        left: 0;
        right: 0;
        margin: 0 auto;
        background-image: url('/candidate/assets/images/maskInnerBannercurve.webp');
        background-size: contain;
        background-repeat: no-repeat;
        opacity: 0.5;
        background-position: center bottom;
    }
    .bg-title-body {
        position: absolute;
        top: 0;
        left: 0;
        overflow: hidden;
        width: 100%;
        height: 100%;
        z-index: 1;
    }
    h1 {
        margin-bottom: 26px;
    }
    h1,
    h5,
    h2 {
        position: relative;
        z-index: 2;
    }
    h5 {
        margin: 0;
    }
    .title-group {
        text-align: center;
        flex-direction: column;
        height: 100%;
    }
    .bg-title {
        position: absolute;
        top: -100px;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 22vw;
        line-height: 30vw;
        font-weight: 800;
        background: radial-gradient(
            70% 200%,
            #ffffff2e 0%,
            rgb(255 255 255) 0%,
            #fff 0%
        );
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin: 0 -1%;
        animation: Blinking 1s linear infinite;
        z-index: -1;
        white-space: nowrap;
        &.privacy-title{
            font-size: 18vw;
            @media (min-width: 1921px) {
                top: -130px;
                font-size: 394px;
                line-height: 600px;
                text-align: center;
                width: 100%;
                margin: 0;
            }
        }
        @media (min-width: 1921px) {
            top: -130px;
            font-size: 460px;
            line-height: 600px;
            text-align: center;
            width: 100%;
            margin: 0;
        }
    }
    @keyframes Blinking {
        0%{
            opacity: 0.2;
        }
        50%{
            opacity: 1;
        }
        100%{
            opacity: 0.2;
        }
    }
    @media ${device.laptop} {
        height: 350px;
        .bg-title {
            top: -84px;
        }
    }
    @media ${device.laptopS} {
        .bg-title {
            top: -66px;
        }
    }
    @media ${device.tablet} {
        height: 300px;
        .bg-title {
            top: -46px;
        }
        h1 {
            margin-bottom: 16px;
        }
    }
    @media ${device.mobile} {
        padding: 0 15px;
        .bg-title {
            top: -22px;
        }
    }
    @media ${device.mobileS} {
        height: auto;
        padding-top: 40px;
        padding-bottom: 40px;
        border-radius: 0px 0px 30px 30px;
        h5 {
            font-size: 16px;
        }
        .bg-title {
            top: -18px;
        }
    }
`

export {
    Main,
    LightGradientCard,
    WhiteCard,
    FlexBox,
    FlexList,
    InputGroup,
    TitleWrapper,
    SiteBannerSection
}
