html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: Arial, Helvetica, sans-serif !important;
    padding-right: 0 !important;
    margin: 0;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-image: linear-gradient(royalblue, red, green, royalblue);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background-image: linear-gradient(red, green, royalblue, red);
}

a {
    text-decoration: none !important;
}

.row>* {
    padding-right: 0px !important;
}

header {
    padding: 12px 20px;
    box-shadow: 2px 2px 20px rgb(150, 150, 150);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    /* Adjust background for better visibility */
    backdrop-filter: blur(15px);
    /* Adds the blur effect */
    -webkit-backdrop-filter: blur(15px);
    transform: none !important;

    /* Safari support */
    h3 {
        color: royalblue;
        font-weight: bolder;
    }

    .links {
        margin-top: 7px;
    }

    .links a {
        color: black;
        margin: auto 15px;
        font-weight: bold;
    }

    a:hover {
        color: royalblue;
    }

    .links .active {
        color: royalblue !important;
    }
}

.top-section {
    margin-top: 65px !important;
}

.top-section .col-lg-8 {
    animation: heroIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.ssongs {
    font-weight: bolder;
    margin: 50px auto 20px 40px;
    animation: sheading 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ssongs-container {
    padding-right: 50px;
}

.ssongs-container .col-6 {
    animation: scardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ssongs-container .col-6:nth-child(1) { animation-delay: 0.18s; }
.ssongs-container .col-6:nth-child(2) { animation-delay: 0.28s; }
.ssongs-container .col-6:nth-child(3) { animation-delay: 0.38s; }
.ssongs-container .col-6:nth-child(4) { animation-delay: 0.48s; }

.box1 {
    background-image: url(../images/books/hanuman\ chalisa\ banner.png);
    background-size: cover;
    margin: 50px 50px 20px 80px;
    aspect-ratio: 1.9;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.box1:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.box-1-desc {
    margin-left: 80px;
    color: black;

    h1 {
        font-weight: bold;
    }
}

.box2 {
    margin: 15px 5px;
    width: 80%;
    aspect-ratio: 0.8;
    border-radius: 10px;
    background-size: cover;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    transition: all 0.25s ease;
}

.box2:hover {
    transform: translateY(-10px);
    scale: 1.05;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.ssongs-container .col-6:nth-child(1) .box2 {
    background-image: url(../images/songs/khaiba_agaru.webp);
}

.ssongs-container .col-6:nth-child(2) .box2 {
    background-image: url(../images/songs/nada\ achara.webp);
}

.ssongs-container .col-6:nth-child(3) .box2 {
    background-image: url(../images/songs/urea\ nada.webp);
}

.ssongs-container .col-6:nth-child(4) .box2 {
    background-image: url(../images/songs/gaiku\ kamadhenu\ kariba\ asa.webp);
}

.blog-heading {
    font-weight: bold;
    margin: 60px auto auto 80px;
    animation: sheading 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.blog-container {
    padding: 50px 80px 20px;

    h5 {
        font-weight: bold !important;
    }
}

.blog-container > div {
    animation: scardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.blog-container > div:nth-child(1) { animation-delay: 0.18s; }
.blog-container > div:nth-child(2) { animation-delay: 0.28s; }
.blog-container > div:nth-child(3) { animation-delay: 0.38s; }
.blog-container > div:nth-child(4) { animation-delay: 0.48s; }
.blog-container > div:nth-child(5) { animation-delay: 0.58s; }
.blog-container > div:nth-child(6) { animation-delay: 0.68s; }
.blog-container > div:nth-child(7) { animation-delay: 0.78s; }
.blog-container > div:nth-child(8) { animation-delay: 0.88s; }
.blog-container > div:nth-child(9) { animation-delay: 0.98s; }
.blog-container > div:nth-child(10) { animation-delay: 1.08s; }
.blog-container > div:nth-child(11) { animation-delay: 1.18s; }
.blog-container > div:nth-child(12) { animation-delay: 1.28s; }

.stack-view-container {
    animation: stackPopIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

iframe {
    border-radius: 10px;
    width: 100%;
    aspect-ratio: 1.77;
    margin-bottom: 10px;
}

.custom-btn {
    width: 130px;
    height: 40px;
    color: #fff;
    padding: 10px 25px;
    margin-bottom: 50px;
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    outline: none;
}

/* 5 */
.btn-5 {
    width: 130px;
    height: 40px;
    line-height: 42px;
    padding: 0;
    border: none;
    background: rgb(255, 27, 0);
}

.btn-5:hover {
    color: #f0094a;
    background: transparent;
    box-shadow: none;
}

.btn-5:before,
.btn-5:after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 2px;
    width: 0;
    background: #f0094a;
    box-shadow:
        -1px -1px 5px 0px #fff,
        7px 7px 20px 0px #0003,
        4px 4px 5px 0px #0002;
    transition: 400ms ease all;
}

.btn-5:after {
    right: inherit;
    top: inherit;
    left: 0;
    bottom: 0;
}

.btn-5:hover:before,
.btn-5:hover:after {
    width: 100%;
    transition: 800ms ease all;
}

.copyright {
    margin: auto 10px 15px;
    text-align: right;
    color: gray;
}

.infomark {

    margin: auto 10px 15px 20px;
    text-align: right;
    color: gray;
}

/* songs */
.awareness-song {
    padding: 0px 200px;
}

.awareness-song img {
    width: 90%;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transition: all 0.25s ease;
}

.awareness-song h3 {
    text-align: center;
    font-weight: bold;
    margin-bottom: 30px;
    animation: sheading 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.awareness-song .row > div {
    animation: scardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.awareness-song .row > div:nth-child(1) { animation-delay: 0.18s; }
.awareness-song .row > div:nth-child(2) { animation-delay: 0.28s; }
.awareness-song .row > div:nth-child(3) { animation-delay: 0.38s; }
.awareness-song .row > div:nth-child(4) { animation-delay: 0.48s; }
.awareness-song .row > div:nth-child(5) { animation-delay: 0.58s; }
.awareness-song .row > div:nth-child(6) { animation-delay: 0.68s; }
.awareness-song .row > div:nth-child(7) { animation-delay: 0.78s; }
.awareness-song .row > div:nth-child(8) { animation-delay: 0.88s; }
.awareness-song .row > div:nth-child(9) { animation-delay: 0.98s; }
.awareness-song .row > div:nth-child(10) { animation-delay: 1.08s; }
.awareness-song .row > div:nth-child(11) { animation-delay: 1.18s; }
.awareness-song .row > div:nth-child(12) { animation-delay: 1.28s; }

.awareness-song .box3 {
    margin-bottom: 28px;
    text-align: center;
    transition: all 0.2s;
}

.awareness-song .box3:hover {
    transform: translateY(-10px);
    scale: 1.05;
}

.awareness-song .box3 img {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transition: all 0.25s ease;
}

.awareness-song .box3:hover img {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

#passwordModalLabel {
    font-weight: bolder;
}

#password-input {
    background: rgb(200, 200, 200);
    margin: auto 10%;
    width: 80%;
    font-size: 24px;
    text-align: center;
}

.popup {
    display: flex;
    justify-content: center;

    button {
        margin: 30px 10px 5px;
    }
}

.version h2 {
    text-align: center;
    font-weight: bolder;
    margin-top: 40px;
    animation: sheading 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.timeline-container .timeline-block {
    animation: scardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.timeline-container .timeline-block:nth-child(1) { animation-delay: 0.18s; }
.timeline-container .timeline-block:nth-child(2) { animation-delay: 0.28s; }
.timeline-container .timeline-block:nth-child(3) { animation-delay: 0.38s; }
.timeline-container .timeline-block:nth-child(4) { animation-delay: 0.48s; }
.timeline-container .timeline-block:nth-child(5) { animation-delay: 0.58s; }
.timeline-container .timeline-block:nth-child(6) { animation-delay: 0.68s; }
.timeline-container .timeline-block:nth-child(7) { animation-delay: 0.78s; }
.timeline-container .timeline-block:nth-child(8) { animation-delay: 0.88s; }

.instructions img,
.instructions2 img {
    animation: scardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.instructions img:nth-child(1) { animation-delay: 0.12s; }
.instructions img:nth-child(2) { animation-delay: 0.22s; }
.instructions img:nth-child(3) { animation-delay: 0.32s; }
.instructions2 img { animation-delay: 0.26s; }

@keyframes sheading {
    0% {
        opacity: 0;
        transform: translateY(-16px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scardIn {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroIn {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes stackPopIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* profile */
.info {
    position: fixed;
    top: 80px;
    right: 20px;
    color: rgb(124, 124, 124);
    font-size: 30px;
    transition: all 0.2s;
}

.info:hover {
    transform: scale(1.15);
}

.profile {
    text-align: center;
    margin-top: 150px;

    img {
        width: 200px;
        border-radius: 50%;
        animation: ppic 0.7s 1;
    }

    h2 {
        font-weight: bold;
        color: royalblue;
        margin: 30px auto 5px;
        animation: phdng 1s 1;
    }

    p {
        animation: phdng 1.3s 1;
    }

    .links {
        justify-content: center;
    }

    .links a {
        animation: scardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;

        &:nth-child(1) { animation-delay: 0.18s; }
        &:nth-child(2) { animation-delay: 0.28s; }
        &:nth-child(3) { animation-delay: 0.38s; }
    }

    .link1 {
        border-radius: 20px;
        width: 150px;
        margin: 10px;
        display: flex;
        justify-content: space-evenly;
    }

    h5 {
        margin: 30px auto 10px;
        animation: sheading 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
    }

    .fa-solid,
    .fa-brands,
    .fas {
        margin-top: 4px;
    }
}

@keyframes ppic {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }

    60% {
        transform: scale(0.95);
    }

    80% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes phdng {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }

    50% {
        opacity: 0;
        transform: translateY(-50px);
    }

    100% {}
}

@keyframes plinks {
    0% {
        opacity: 0;
    }

    70% {
        opacity: 0;
    }

    100% {}
}

/* personal */

.personal-security {
    text-align: center;

    video {
        width: 200px;
        margin: 150px auto 20px;
    }

    button {
        width: 100px;
        margin-top: 30px;
    }

    #password-input {
        width: 400px;
    }
}

.collections {
    margin: 100px 20px 20px !important;

    /* display: none !important; */
    h2 {
        margin-top: 20px;
        font-weight: bolder;
    }

    p {
        color: rgb(164, 164, 164);
        font-size: smaller;
    }

    .book {
        padding: 0px 60px !important;
        animation: scardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;

        &:nth-child(1) { animation-delay: 0.18s; }
        &:nth-child(2) { animation-delay: 0.28s; }
        &:nth-child(3) { animation-delay: 0.38s; }
        &:nth-child(4) { animation-delay: 0.48s; }
        &:nth-child(5) { animation-delay: 0.58s; }
        &:nth-child(6) { animation-delay: 0.68s; }
        &:nth-child(7) { animation-delay: 0.78s; }
        &:nth-child(8) { animation-delay: 0.88s; }
        &:nth-child(9) { animation-delay: 0.98s; }
        &:nth-child(10) { animation-delay: 1.08s; }
        &:nth-child(11) { animation-delay: 1.18s; }
        &:nth-child(12) { animation-delay: 1.28s; }

        a {
            width: 120px;
            color: white;
        }

        a i {
            transition: all 0.3s;
        }

        a:hover i {
            scale: 1.2;
        }

        .desc {
            padding-right: 20px;
        }
    }

    .book-image img {
        width: 100%;
        height: 192px;
        aspect-ratio: 2 / 3;
        object-fit: cover;
    }
}

/* Stack View for Collections */
.stack-view-container {
    padding: 20px 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-stack {
    position: relative;
    width: 210px;
    height: 330px;
    margin: 35px auto 10px;
    cursor: pointer;
    perspective: 1200px;
}

.stack-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
    transition: all 0.35s cubic-bezier(0.34, 1.25, 0.64, 1);
    user-select: none;
    -webkit-user-select: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.stack-card img {
    width: 100%;
    height: calc(100% - 50px);
    object-fit: cover;
    display: block;
}

.card-label {
    padding: 6px 10px;
    background: #ffffff;
    text-align: center;
    height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.card-label h5 {
    font-size: 13px;
    font-weight: bold !important;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #212529;
}

.card-label span {
    font-size: 11px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Layered positions: one above one */
.stack-card.pos-0 {
    z-index: 5;
    transform: translateY(0px) scale(1) rotate(0deg);
    opacity: 1;
}

.stack-card.pos-1 {
    z-index: 4;
    transform: translateY(-14px) scale(0.95) rotate(-3.5deg);
    opacity: 0.95;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.stack-card.pos-2 {
    z-index: 3;
    transform: translateY(-28px) scale(0.90) rotate(3deg);
    opacity: 0.9;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.stack-card.pos-3 {
    z-index: 2;
    transform: translateY(-42px) scale(0.85) rotate(-5.5deg);
    opacity: 0.85;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stack-card.pos-4 {
    z-index: 1;
    transform: translateY(-56px) scale(0.80) rotate(4deg);
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Hover: fan out deck smoothly */
.card-stack:hover .stack-card.pos-0 {
    transform: translateY(12px) scale(1.02);
}

.card-stack:hover .stack-card.pos-1 {
    transform: translateX(-45px) translateY(-8px) scale(0.96) rotate(-8deg);
}

.card-stack:hover .stack-card.pos-2 {
    transform: translateX(45px) translateY(-8px) scale(0.96) rotate(8deg);
}

.card-stack:hover .stack-card.pos-3 {
    transform: translateX(-85px) translateY(-18px) scale(0.91) rotate(-14deg);
}

.card-stack:hover .stack-card.pos-4 {
    transform: translateX(85px) translateY(-18px) scale(0.91) rotate(14deg);
}

/* Slide out animation when clicked */
.stack-card.sliding-out {
    transform: translateX(140px) translateY(-30px) rotate(18deg) scale(0.88) !important;
    opacity: 0.2 !important;
    transition: all 0.24s ease-out !important;
    z-index: 6 !important;
}

.stack-hint {
    color: #6c757d;
    font-size: 13px;
    margin-top: 15px;
    margin-bottom: 25px;
    font-weight: 500;
}

@media (max-width: 768px) {
    header {
        padding: 12px 10px;

        h3 {
            color: royalblue;
            font-weight: bolder;
            text-align: center;
            font-size: 30px;
        }

        .links {
            margin-top: 7px;
            display: flex;
            justify-content: space-evenly;
        }

        .links a {
            color: black;
            text-decoration: none;
            margin: auto 10px;
            font-size: 15px;
            font-weight: bold;
        }
    }

    .top-section {
        margin-top: 100px !important;
    }

    .box1 {
        margin: 40px 20px 20px;
    }

    .box-1-desc {
        margin-left: 20px;
    }

    .ssongs {
        margin: 50px auto 20px 20px;
    }

    .ssongs-container {
        padding-right: 0px;
        margin-right: 0px !important;
    }

    .box2 {
        margin: 10px 5px;
        width: 85%;
    }

    .blog-heading {
        margin: 80px auto auto 20px;
    }

    .blog-container {
        padding: 50px 20px 10px;
    }

    iframe {
        margin-bottom: 5px;
    }

    .awareness-song {
        padding: 0px 20px;

        h3 {
            text-align: center;
            font-weight: bold;
            margin-bottom: 30px;
            margin-top: 30px;
        }
    }

    .profile .links {
        flex-direction: column;
        align-items: center;
        /* Centers items vertically */
        justify-content: center;
    }

    .profile {
        margin-top: 140px;
    }

    .info {
        top: 110px;
        font-size: 25px;
    }

    .version h2 {
        margin-top: 60px;
    }

    .personal-security {
        text-align: center;

        video {
            width: 200px;
            margin: 200px auto 20px;
        }

        button {
            width: 100px;
            margin-top: 30px;
        }

        #password-input {
            width: 80%;
        }
    }

    .collections {
        margin: 120px 20px 20px !important;

        h1 {
            margin-top: 20px;
        }

        .book {
            padding: 0px 0px !important;
        }
    }

    .stack-view-container {
        padding: 35px 15px 10px;
    }

    .card-stack {
        width: 190px;
        height: 300px;
        margin: 25px auto 10px;
    }

    .card-stack:hover .stack-card.pos-1 {
        transform: translateX(-30px) translateY(-6px) scale(0.96) rotate(-6deg);
    }

    .card-stack:hover .stack-card.pos-2 {
        transform: translateX(30px) translateY(-6px) scale(0.96) rotate(6deg);
    }

    .card-stack:hover .stack-card.pos-3 {
        transform: translateX(-55px) translateY(-14px) scale(0.91) rotate(-10deg);
    }

    .card-stack:hover .stack-card.pos-4 {
        transform: translateX(55px) translateY(-14px) scale(0.91) rotate(10deg);
    }
}