/* GLOBAL STYLES */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: linear-gradient(-155deg, #ffffff 50%, rgb(128, 53, 255) 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* SELECTORS */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 16px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
}

.select-trigger:after {
    content: "▼";
    font-size: 12px;
    transition: transform 0.3s;
    display: inline-block;
}

.custom-select-wrapper.is-open .select-trigger::after {
    color: #4f46e5;
    transform: rotate(180deg);
}

.select-trigger:hover {
    border-color: #4f46e5;
    background-color: #f8f9fa;
}

.select-options {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 2px solid #4f46e5;
    border-radius: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.custom-select-wrapper.is-open .select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.option-item {
    padding: 12px 15px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.option-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.option-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.select, .option-item.select:hover {
    background-color: #4f46e5;
    color: #ffffff;
}

.option-item:hover {
    background-color: #dddddd;
}

/* HEADER */
header {
    background-color: transparent;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.left-header {
    display: flex;
    width: 50%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    animation: fadeIn 1s ease forwards;
    animation-delay: 2.2s;
    opacity: 0;
    pointer-events: none;
}

.left-header h2 {
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    max-width: 500px;
    color: #4f46e5;
}

.left-header button {
    font-size: 16px;
    width: 100%;
    max-width: 200px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid #4f46e5;
    background: none;
    cursor: pointer;
    color: #4f46e5;
    font-weight: 700;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.left-header button:hover {
    background-color: #4f46e5;
    color: #edf2ff;
}

.right-header {
    min-height: 100%;
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    animation: moveAndColorRight 3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.title h1 {
    max-width: 800px;
    word-break: keep-all;
    overflow-wrap: break-word;

    color: #2c2c2c;
    font-size: clamp(2.5rem, 6vw, 5rem);

    background: linear-gradient(135deg, #4f46e5 30%, #818cf8 50%, #4f46e5 70%);
    background-size: 200% 100%;
    background-position: 150% 0;
    -webkit-background-clip: text;
    background-clip: text;

    animation: becomeGradient 3.2s ease forwards, textGleam 5s linear infinite;
}

.title p {
    color: #111827;
    opacity: 0.7;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
}

/* CONTAINERS */
.translator {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.main-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15),
    0 0 50px rgba(79, 70, 229, 0.4);
    opacity: 0;
    transform: translateY(50px);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

.main-container.visible {
    opacity: 1;
    transform: translateY(0);
}

#swap-btn {
    color: #6366f1;
    font-size: 30px;
    position: absolute;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
}

#swap-btn:hover {
    color: #818cf8
}

.is-swap {
    transform: rotateY(180deg);
}

/* LEFT CONTAINER */
.left-container, .right-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    height: 100%;
    max-height: 25rem;
    background: #FFFFFF;
    padding: 30px 40px;
    gap: 2rem;
}

.left-container {
    border-radius: 30px 0 0 30px;
}

textarea {
    background: #FFFFFF;
    resize: none;
    font-size: 20px;
    outline: none;
    min-height: 15rem;
    max-width: 100%;
    width: 100%;
    max-height: 15rem;
    border-radius: 10px;
    padding: 10px 40px 10px 10px;
    border: 2px solid #cccccc;
    transition: border-color 0.3s;
}

textarea::placeholder {
    letter-spacing: 1px;
    opacity: 0.5;
    text-transform: uppercase;
    font-weight: 500;
}

textarea:focus {
    border: 2px solid #4f46e5;
}

.textarea-wrapper {
    width: 100%;
    position: relative;
}

.textarea-wrapper i {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 20px;
    color: #a1a1a1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.textarea-wrapper i:hover {
    color: #4f46e5;
}

/* RIGHT CONTAINER */
.right-container {
    border-radius: 0 30px 30px 0;
}

textarea:disabled {
    background: #f9f8ff;
    cursor: text;
}

/* FOOTER */
footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    background: #FFFFFF;
    min-height: 200px;
}

.main-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #8035FF;
    font-weight: 500;
    user-select: text;
}

.main-text i.fa-globe {
    color: rgba(128, 53, 255, 0.8);
    font-size: 40px;
}

.contacts-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contacts-block h3 {
    color: #353535;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contacts {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 12px 40px;
    justify-items: start;
}

.contact {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    gap: 5px;
    color: #8055FF;
    text-decoration: none;
    transition: transform 0.1s ease;
}

.contact:hover {
    transform: scale(1.02);
    text-decoration: underline;
    cursor: pointer;
}

/* KEYFRAMES */
@keyframes becomeGradient {
    0% {
        -webkit-text-fill-color: #2c2c2c;
    }
    10% {
        -webkit-text-fill-color: #2c2c2c;
    }
    100% {
        -webkit-text-fill-color: transparent;
    }
}

@keyframes textGleam {
    0% {
        background-position: 150% 0;
    }
    65% {
        background-position: -50% 0;
    }
    100% {
        background-position: -50% 0;
    }
}

@keyframes moveAndColorRight {
    0% {
        opacity: 0;
        transform: translateX(-50%);
        background-color: rgba(255, 255, 255, 0);
    }
    10% {
        transform: translateX(-50%);
    }
    95% {
        opacity: 1;
        background-color: rgba(255, 255, 255, 0);
    }
    100% {
        transform: translateX(0%);
        background-color: transparent;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        pointer-events: none;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
}

/* MOBILE STYLES */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 100px;
    }

    .select-trigger, .option-item {
        padding: 6px 15px;
    }

    .left-header {
        order: 2;
    }

    .left-header h2 {
        font-size: 1.5rem;
    }

    .left-header button {
        font-size: 11px;
    }

    .right-header {
        order: 1;
    }

    .left-container, .right-container {
        border-radius: 0;
        padding: 30px;
        gap: 1rem;
    }

    textarea {
        min-height: 10rem;
        max-height: 10rem;;
    }

    .right-header p {
        font-size: 12px;
    }

    .main-container {
        flex-direction: column;
        border-radius: 20px;
        overflow: hidden;
    }

    #swap-btn {
        transform: rotate(90deg);
    }

    .is-swap {
        transform: rotate(270deg) !important;
    }

    footer {
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }

    .contacts {
        gap: 5px 24px;
    }

    .main-text {
        text-align: center;
        flex-direction: column;
    }

    .contacts-block {
        width: 100%;
        justify-content: center;
        align-items: center;
        border-top: 2px solid #e8e8e8;
        padding-top: 15px;
        flex-direction: column;
    }
}

@media (max-width: 900px) {
    footer {
        flex-direction: column;
    }

    .contacts-block {
        border-top: 2px solid #e8e8e8;
        padding-top: 15px;
        flex-direction: column;
    }
}