.container {
    max-width: 1640px;
}

.first,
.second,
.third,
.fourth,
.fifth,
.sixth {
    margin-right: 15px;
    background-size: contain;
    width: 140px;
    cursor: pointer;
    float: left;
    position: relative;

}

.first-color {
    background-color: #f7dcad;
}

.first {
	background-color: #f7dcad;
	padding-bottom: 12%;
}

.second {
    background-color: #cfe4e7;
    padding-bottom: 20%;
}

.third {
     background-color: #dfeed7;
     padding-bottom: 10%;
}

.fourth {
    background-color: #eeecf7;
    padding-bottom: 15%;
}

.fifth {
    background-color: #fbe0d5;
    padding-bottom: 5%;
}

.story {
    width: 300px;
    padding-top: 250px;
    margin-bottom: 20px;
}

.read_story {
    font-family: "Roboto", sans-serif;
    display: block;
    font-size: 26px;
}


.doctor-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transform: rotate(90deg);
    transform-origin: 40% 63%;
    width: auto; /* Allow dynamic width */
    white-space: nowrap; /* Prevent line break */
}


.doctor-title h4 {
    flex-grow: 0; /* Prevent stretching */
    width: max-content; /* Allow text to take full space */
    white-space: nowrap; /* Force text to stay in one line */
}




.doctor-title h4 {
	font-size: 28px;
}
.doctor-title span {
    font-size: 20px;
}

.doctor-title h4,
.doctor-title span {
    font-family: "Playfair Display", serif;
}



.doctor-title a {
    display: block;
    text-align: left;
    padding-top: 25px;
    background-repeat: no-repeat;
    margin-top: 17px;
    width: 85px;
    background-position: right;
}

.first .doctor-title a {
    background-image: url(../img/first_arrow_right.png);
    margin-left: 118px;
}

.second .doctor-title a {
    background-image: url(../img/second_arrow_right.png);
    margin-left: 200px;
}

.third .doctor-title a {
    background-image: url(../img/third_arrow_right.png);
    margin-left: 95px;
}

.fourth .doctor-title a {
    background-image: url(../img/fourth_arrow_right.png);
    margin-left: 135px;
}

.fifth .doctor-title a {
    background-image: url(../img/fifth_arrow_right.png);
    margin-left: 40px;
}




.first:hover .doctor-title a {
    background-image: url(../img/first_arrow_right_hover.gif);
}

.second:hover .doctor-title a {
    background-image: url(../img/second_arrow_right_hover.gif);
}

.third:hover .doctor-title a {
    background-image: url(../img/third_arrow_right_hover.gif);
}

.fourth:hover .doctor-title a {
    background-image: url(../img/fourth_arrow_right_hover.gif);
}

.fifth:hover .doctor-title a {
    background-image: url(../img/fifth_arrow_right_hover.gif);
}

.container2 {
    max-width: 1140px;
    margin: 0 auto;
    position: relative;
}



.first,
.second,
.third,
.fourth,
.fifth {
    opacity: 0;
    transform: translateY(-50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}


.transition-active {
    opacity: 1;
    transform: translateY(0);
}

.story-div {
    opacity: 0;
    transform: translateX(-100px);
    transition: transform 2s ease-out, opacity 2s ease-out;
}


.story-div-active {
    opacity: 1;
    transform: translateX(0);
}


/* Popup Overlay */
.popup-overlayst {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Semi-transparent background */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    padding: 0;
}

/* Full-Screen Popup Content */
.popup-content {
    width: 100%;
    height: 100%;
    padding: 30px;
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.8s ease-in-out;
    overflow: auto;
    /* Ensures scroll if content overflows */
}

/* Popup Active (Visible) */
.popup-overlayst.active {
    opacity: 1;
    visibility: visible;
}

.popup-overlayst.active .popup-content {
    transform: translateY(0);
    /* Slide in from the bottom */
}

/* Close Button */
.first-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: #333;
    cursor: pointer;
    width: 36px;
    height: 36px;
    background-image: url('../img/first_close.png');
    background-repeat: no-repeat;
    z-index: 99;
}

.pop_title_image {
    display: inline-block;
    vertical-align: middle;
}

.pop_title_image img {
    width: 100px;
    height: 100px;
}


.pop_title .name {
    font-size: 30px;
    color: #E18F00;
    font-family: "Playfair Display", serif;
    display: block;
}

.pop_title .designation {
    font-size: 18px;
    color: #000;
    font-family: "Playfair Display", serif;
}

.pop_title {
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
    font-size: 14px;
    color: gray;
    border-bottom: 3px solid #E18F00;
    width: 89%;
    padding-bottom: 10px;
    padding-top: 10px;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

/* Show animation when .header gets "active" class */
.header.active .pop_title {
    transform: translateY(0);
    opacity: 1;
}

.pop_title_image {
    display: inline-block;
    vertical-align: middle;

    /* Transition Effect */
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

/* When .header gets "active", both elements animate */
.header.active .pop_title_image {
    transform: translateY(0);
    opacity: 1;
}

/*slider*/

.slider {
    width: 100%;
    min-height: 400px;
    margin: 20px auto;
    position: relative;
}

.slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    text-align: center;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 400px;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(-70px);
    transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out;
}

.desc {
    opacity: 0;
    font-size: 26px;
    font-weight: 400;
    color: #333;
    width: 75%;
    margin: 20px auto;
    text-align: center;
    font-family: "Playfair Display", serif;
    min-height: 50px;
    transition: opacity 5s ease-in-out;
}

.active .desc .active {
    opacity: 1;
}


/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* When popup is active, trigger animation */
.popup-overlayst.active .slide img {
    opacity: 1;
    transform: translateY(0);
    /* Move to original position */
}

.popup-overlayst.active .desc {
    opacity: 1;
    transform: translateY(0);
}


.next-btn {
	display: none;
	width: 100px;
	height: 30px;
	cursor: pointer;
	position: absolute;
	right: 0;
	top: 60%;
	background-image: url('../img/first_arrow_right_hover.gif');
	background-repeat: no-repeat;
	padding: 15px 0;
	background-position: center;
	transform: translate(-50%, -50%) rotate(180deg);
}
.fade-in {
    opacity: 0;
    animation: fadeIn 5s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


@media (min-width:600px) and (max-width: 1024px) {

    .pop_title {
        width: 83%;
    }

    .first,
    .second,
    .third,
    .fourth,
    .fifth,
    .sixth {
        width: 15%;
    }

    .first img,
    .second img,
    .third img,
    .fourth img,
    .fifth img,
    .sixth img{
        padding-bottom: 20px;
    }

    .story {
        width: 85%;
        padding-top: 200px;
    }

    .doctor-title h4 {
        font-size: 100%;
    }

    .doctor-title span {
        font-size: 80%;
    }

    .doctor-title a {
        display: block;
        text-align: left;
        padding-top: 25px;
        background-repeat: no-repeat;
        margin-top: 0px;
        width: 60px;
        background-position: right;
        background-size: 50%;
        position: absolute;
        top: 50%;
    }

    .first:hover .doctor-title a,
    .second:hover .doctor-title a,
    .third:hover .doctor-title a,
    .fourth:hover .doctor-title a,
    .fifth:hover .doctor-title a {
        background-size: cover;
    }



    .first {
        padding-bottom:30%;
    }

    .second {
        padding-bottom:45%;
    }

    .third {
        padding-bottom:25%;
    }

    .fourth {
        padding-bottom:32%;
    }

    .fifth {
        padding-bottom:20%;
    }

    .first .doctor-title a {
        margin-left: 88px;
    }

    .second .doctor-title a {
        margin-left: 136px;
    }

    .third .doctor-title a {
        margin-left: 65px;
    }


    .fourth .doctor-title a {
        margin-left: 92px;
    }


    .fifth .doctor-title a {
        margin-left: 32px;
    }

   
}


@media (max-width: 480px) {

   .first,
    .second,
    .third,
    .fourth,
    .fifth,
    .sixth {
        width: 15%;
        position: relative;
        padding-bottom: 31% !important;
    }

    .first img, .second img, .third img, .fourth img, .fifth img, .sixth img {
        padding-bottom: 30px;
    }

    .doctor-title a {
        display: block;
        text-align: left;
        padding-top: 25px;
        background-repeat: no-repeat;
        margin-top: 0px;
        width: 60px;
        background-position: right;
        background-size: 26%;
        position: absolute;
        top: 50%;
        margin-left: 85px !important;
    }

    .first:hover .doctor-title a,
    .second:hover .doctor-title a,
    .third:hover .doctor-title a,
    .fourth:hover .doctor-title a,
    .fifth:hover .doctor-title a {
        background-size: 100%;
    }


    .first {
        padding-bottom:30%;
    }

    .second {
        padding-bottom:45%;
    }

    .third {
        padding-bottom:25%;
    }

    .fourth {
        padding-bottom:32%;
    }

    .fifth {
        padding-bottom:20%;
    }


    .doctor-title h4 {
        font-size: 85%;
        margin: 0;
        padding-top: 5px;
    }



    .doctor-title span {
        font-size: 14px;
    }

    .doctor-title {
        transform-origin: 67% 44%;
    }

    .pop_title_image img {
        width: 70px;
        height: 70px;
    }

    .pop_title .name {
        font-size: 20px;
    }

    .pop_title .designation {
        font-size: 14px;
    }

    .pop_title {
        width: 60%;
    }

    .first-close-btn {
        background-size: 70%;
        top: 10px;
        right: 0;
    }

    .slide img {
        width: 100%;
        height: auto;
    }

    .next-btn {
        right: -70px;
        top: 50%;
        background-size: 90%;
    }

    .desc {
        font-size: 14px;
        width: 100%;
        margin: 0 auto;
    }

    .story-div {
        text-align: center;
    }

    .story {
        width: 185px;
        padding-top: 30px;
    }

    .read_story {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .slider {
        width: 90%;
    }
}