@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+Sinhala:wght@400;700&family=Varela+Round&display=swap");

html,
body {
    height: 100%;
    overflow: hidden !important;
}

body {
    padding: 20px;
    color: white;
    font-family: "Varela Round", Noto Serif Sinhala;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

:where(body) {
    font-family: "Noto Serif Sinhala";
    letter-spacing: 0.5px;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: fadeBackground 10s ease infinite;
    z-index: -1;
}

@keyframes fadeBackground {
    0% {
        background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    }
    50% {
        background: linear-gradient(-45deg, #23a6d5, #23d5ab, #ee7752, #e73c7e);
    }
    100% {
        background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    }
}

#Imahansa_WS {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#Imahansa_WS img {
    max-width: 700px;
    max-height: 700px;
}

.fade-out {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.container {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px 20px 20px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

#results {
    padding: 20px 30px 10px 30px;
    color: black;
}

#monthSheetResults {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    max-height: 100vh;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 50px;
    border-radius: 10px;
    text-align: center;
    right: 100px;
    margin-top: -1px;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    justify-content: center;
    margin-top: 20px;
    margin-right: 30px;
}

#calculatorForm .form-group label {
    font-size: 15px;
    margin-right: 50px;
}

.form-group label {
    width: 200px;
    text-align: right;
    margin-right: 25px;
}

.form-control {
    width: 250px;
    text-align: center;
    font-weight: bold;
    flex-grow: 1;
    max-width: 400px;
}

.rate-container,
.tax-container {
    position: relative;
}

.rate-container::after,
.tax-container::after {
    content: "%";
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    pointer-events: none;
    font-size: 1 em;
    padding-left: 5px;
    color: black;
}

.btn-primary,
.btn-secondary {
    width: 150px;
    display: block;
    margin: 10px auto;
    margin-top: 30px;
    text-align: center;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
}

.btn-primary {
    background-color: #008000;
    color: white;
    animation: shake 0.5s ease-in-out infinite;
}

.btn-primary:hover {
    background-color: #4cbb17;
}

.btn-secondary {
    background-color: #d22b2b;
    color: white;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #ff4433;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.button-align {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 10px 10px 10px;
}

.custom-btn {
    background-color: #008000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.custom-btn:hover {
    background-color: #4cbb17;
}

.button-container {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.button-align .btn {
    margin: 0 5px;
}

@keyframes typing {
    0% {
        width: 0;
        opacity: 0;
    }

    100% {
        width: 100%;
        opacity: 1;
    }
}

.typing-line {
    font-family: monospace;
    overflow: hidden;
    white-space: nowrap;
    margin: 5px 0;
    animation: typing 3s steps(40, end) forwards;
    border-right: 2px solid white;
    color: #fff;
    padding: 2px 0;
    text-align: center;
    display: block;
    width: 0;
    opacity: 0;
}



h2 {
    color: white;
    text-align: center;
    margin-bottom: 15px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.fade-in {
    opacity: 1;
}

#results p {
    display: flex;
    justify-content: space-between;
}

#imahansa-bg-5000 {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    z-index: -1;
}

#img_5000 {
    width: 300px;
    height: auto;
    margin-left: 200px;
    animation: bounceWave 3s infinite ease-in-out;
}

@keyframes bounceWave {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(2deg);
    }

    50% {
        transform: translateY(0) rotate(-2deg);
    }

    75% {
        transform: translateY(10px) rotate(2deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    color: white;
    text-align: center;
    font-size: 12px;
    z-index: 1000;
    letter-spacing: 2px;
}

#phoneLink,
a {
    text-decoration: none;
    color: inherit;
}

@media (min-width: 360px) and (max-width: 767px) {
    body {
        padding: 50px 10px 5px 10px;
    }

    #Imahansa_WS img {
        max-width: 500px;
        max-height: 500px;
    }

    .container {
        background-color: rgba(255, 255, 255, 0.2);
        padding: 1px;
        max-width: 100%;
        max-height: 100%;
        margin-top: -80px;
    }

    h2 {
        font-size: 20px;
        margin-top: 20px;
    }

    #monthSheetResults {
        width: 100%;
        left: 0;
        padding: 30px;
        transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.7);
        padding-left: 20px;
        padding-right: 20px;
    }

    .typing-line {
        margin: -10px;
        font-size: 13px;
    }

    .form-group {
        flex-direction: row;
        align-items: center;
        margin-right: 0;
        justify-content: flex-end;
    }

    #calculatorForm .form-group label {
        color: black;
        margin-right: 20px;
        font-size: 12px;
    }

    .form-group label {
        width: auto;
        text-align: left;
        margin-bottom: 0;
        margin-right: 20px;
        padding: 1px;
    }

    .form-control {
        max-width: 50%;
        flex-grow: 0;
        text-align: center;
        margin-right: 30px;
        padding: 1px;
    }

    .btn-primary,
    .btn-secondary {
        width: 90%;
    }

    #results {
        font-size: 12px;
        padding: 10px 20px 20px 20px;
        margin-top: -20px;
    }

    #results p {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        margin: 10px;
        color: #000;
    }

    #img_5000 {
        width: 268px;
        margin-left: 23%;
        transform: translateX(-50%);
        opacity: 0.5;

    }

    .btn-primary,
    .btn-secondary {
        width: 150px;
        margin-top: 20px;
        margin-bottom: 20px;
        text-align: center;
        line-height: 15px;
    }

    #results p span:first-child {
        padding-right: 5px;
    }

    .custom-btn {
        font-size: 10px;
        padding: 10px;
        margin-top: -20px;
        line-height: 10px;
    }

    .button-align {
        display: flex;
        justify-content: center;
        gap: 20px;
        padding: 20px 10px 0 10px;
    }

    #footer {
        font-size: 10px;
        margin-bottom: -5px;
    }
}
