* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    border: none;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(315deg, #E31A8C 0%, #2B1C8F 100%);
    min-height: auto;
    font-family: "poppins", sans-serif;
    align-items: center;
    justify-content: center;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 40rem;
}

.first-items {
    display: flex;
}

.toggle input {
    display: none;
}

.track {
    width: 50px;
    height: 26px;
    background: #ddd;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
}

.track::after {
    content: "";
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

input:checked+.track {
    background: #7c3aed;
}

input:checked+.track::after {
    transform: translateX(24px);
}

.text {
    color: #fff;
}


h1 {
    padding: 2rem 0 2rem 0;
    color: #fff;
    margin-left: 3rem;
    font-size: 2rem;
}

.container1 {
    background-color: #dfd8fc;
    height: 38rem;
    width: 90vw;
    margin-left: 3.5rem;
    border-radius: 1rem;
    padding: 2rem;
}

.randText {
    font-size: 1.1rem;
    padding: 0.5rem;
    opacity: 0.75;
    margin-left: 15px;
}

.box1 {
    padding: 1.25rem 0 1.25rem 0;
    border: none;
    background-color: #fff;
    color: black;
    border-radius: 1rem;
    box-shadow: 0 0 2rem rgb(214, 210, 210);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.box1:hover {
    box-shadow:
        0 0 1rem 4px rgba(124, 58, 237, 1.5),
        0 0 1rem rgba(124, 58, 237, 1.5);
    cursor: pointer;
}

.box1 input {
    width: 70%;
    padding: 0.65rem 0 0.65rem 0;
    background-color: #eae8f3;
    border-radius: 0.5rem;
}


.box1 select {
    width: 20%;
    padding: 0.65rem 0 0.65rem 0;
    font-size: 1rem;
    background-color: #fcedfb;
    border-radius: 0.5rem;
}

select option {
    font-size: 1rem;
}

.box1-para {
    font-size: 1.1rem;
    padding: 0.5rem;
    opacity: 0.75;
    margin-left: 15px;
}
/* swap button */
.swap-btn {
    position: absolute;
    /* CENTER horizontally */
    left: 50%;
    transform: translateX(-50%);
    /* adjust vertical position */
    top: 48%;
    border: 5px solid #fff;
   color: white;
   background: linear-gradient(135deg, #7c3aed, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem 1rem 1rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

/* hover */
.swap-btn:hover {
    
    color: black;
    transform: translateX(-50%) rotate(180deg);
}



.box2 {
    padding: 1.25rem 0 1.25rem 0;
    border: 2px solid rgb(182, 128, 254, 0.5);
    background-color: #efeefc;
    color: black;
    border-radius: 1rem;
    box-shadow: 0 0 1rem rgb(214, 210, 210);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.box2:hover {
    border-color: linear-gradient(90deg,
            #6EA8FF,
            #7C7CFF,
            #8B5CF6) 1;
    box-shadow:
        0 0 1rem rgba(110, 168, 255, 1.5),
        0 8px 1rem rgba(139, 92, 246, 1.5);
}

#toCurr {
    font-size: 1.7rem;
    font-weight: 450;
    margin-left: 1rem;
    color: #6a00ff;
}

.box2 select {

    width: 20%;
    padding: 0.65rem 0 0.65rem 0;
    margin-right: 2rem;
    font-size: 1rem;
    background-color: #fff;
    border-radius: 0.5rem;
}

/* .box2-para {
    font-size: 1rem;
    padding: 0.5rem;
    opacity: 0.75;
    margin-left: 15px;
} */

.box3 {
    padding: 1.25rem 0 1.25rem 0;
    border: 2px solid rgb(182, 128, 254, 0.3);
    background-color: #efeefc;
    color: black;
    border-radius: 1rem;
    box-shadow: 0 0.1rem 2rem rgb(214, 210, 210);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.box3-first {
    display: flex;
    font-size: 1.1rem;
    justify-content: flex-start;
    min-width: 60%;
}

.box3 i {
    margin-top: 6px;
    margin-right: 10px;
    margin-left: 1rem;
    color: #4f0ee8;
}

.box3-secound {
    text-align: right;
    margin-right: 2rem;
}

#msg {
    color: #6a00ff;
    font-size: 1.1rem;
    font-weight: 450;
}

#updated-msg {
    font-size: 0.76rem;
}

.refresh-btn {
    margin-top: 2rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    background-color: #fff;
    box-shadow: 0 0 1rem rgb(214, 210, 210);
    border: none;
    border-radius: 14px;
    color: #6a00ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hover */
.refresh-btn:hover {
    background: #f3eaff;
    transform: translateY(-2px);
}

/* Icon animation on hover */
.refresh-btn:hover i {
    transform: rotate(180deg);
    transition: transform 0.4s ease;
}

/* Loading State */
.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.big-container {
    width: 100vw;
    height: 30vh;
    display: flex;
    justify-content: space-evenly;
    margin-top: 1rem;
}

.big-container .container {
    background-color: #e8e1f7;
    height: 25vh;
    min-width: 23%;
    border-radius: 2rem;

}

.big-container .container:hover {
    transform: translateY(-6px);
    transition: 0.3s ease;
}

.containerPara {
    font-size: 0.9rem;
    padding: 1rem;
    font-weight: 500;
    color: #8f8e9e;
}

.currency {
    display: flex;
    gap: 0.8rem;
    padding-left: 1rem;
}

.currency-rate {
    font-weight: 500;
}

.currency-name {
    color: #8f8e9e;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.1rem;
}

.bottomCurr {
    display: flex;
    gap: 0.5rem;
    padding-left: 1rem;
    margin-top: 1rem;
}

.bottomCurrName {
    color: #9436ff;
    margin-top: 4px;
}

.bottomCurrRate {
    color: #9436ff;
    font-size: 1.3rem;
    font-weight: 600;
}

.dark {
    background: #1f1f1f;
    color: white;
}

.color {
    background: rgb(38, 38, 203);
    color: white;
}

.dark input,
.dark select {
    background-color: #2b2b2b;
    color: white;
    box-shadow: none;
}

.dark .box1,
.dark .box2,
.dark .box3,
.dark .refresh-btn {
    background-color: #1f1f1f;
    color: white;
    box-shadow: none;
}

.dark .big-container .container {
    background-color: black;
    color: white;
    box-shadow: none;
}

/* Mobile */
@media (max-width: 600px) {
    .container1 {
        width: 80%;
        height: 100%;
    }

    select option {
        font-size: 0.5rem;
    }

    .box1 select {
        width: auto;
    }

    .box2 select {
        width: auto;
    }

    .box3-first {
        font-size: 1rem;
        padding: 0;
        margin: 0;
    }

    .box3-secound p {
        white-space: nowrap;
    }

    .first-items {
        overflow: hidden;
        width: 100%;
        overflow: visible;
        flex-wrap: wrap;
    }

    .first-items h1 {
        font-size: 1.5rem;
    }

    .first-items .toggle {
        position: absolute;
        right: 20px;
        margin-top: 1.75rem;
        gap: 3rem;
    }

    .big-container .container {
        width: 30%;
        height: 20vh;
        margin-top: 2rem;
    }

    .containerPara {
        margin-top: 2rem;
        padding-left: 2rem;
    }

    .currency-rate,
    .currency {
        padding-left: 1rem;
    }

    .bottomCurrName,
    .bottomCurrRate {
        padding-left: 1rem;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .container {
        width: 90%;
    }
}