
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #fff8e7; 
    color: #333;
    scroll-behavior: smooth;
    position: relative;
}
/* Preloader overlay */
#preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* Spinner container */
.circle-spinner {
    position: relative;
    width: 120px;
    height: 120px;
}

/* Half circle arcs */
.arc {
    position: absolute;
    border: 6px solid transparent;
    border-top-color: transparent;
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
    animation: spin 1.5s linear infinite;
}

/* Different arcs with different radius & colours */
.arc1 {
    width: 100px; height: 100px;
    border-left: 6px solid #e74c3c;
    border-right: 6px solid #e74c3c;
    top: 10px; left: 10px;
    animation-duration: 1.2s;
}

.arc2 {
    width: 80px; height: 80px;
    border-left: 6px solid #3498db;
    border-right: 6px solid #3498db;
    top: 20px; left: 20px;
    animation-duration: 1.5s;
}

.arc3 {
    width: 60px; height: 60px;
    border-left: 6px solid #2ecc71;
    border-right: 6px solid #2ecc71;
    top: 30px; left: 30px;
    animation-duration: 1.8s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* IMAGE */
.background_image{
  height:70vh;
  background:url("images/pexels-rudy-kirchner-278171-831079.jpg") center/cover no-repeat !important; 
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

.background_image::before{
  content:"";
  position:absolute;
  inset:1;
  background:rgba(0,0,0,0.45);
}

.background_image-overlay{
  position:relative;
  color:white;
  text-align:center;
}

.background_image-overlay h1{
  font-size:48px;
  font-weight:600;
  color: white;
}

nav {
    position: sticky;
    top: 0;
    background: #f5deb3;
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    flex-wrap: wrap;
}
nav a {
    text-decoration: none;
    font-weight: bold;
    color: #5a3e1b;
}
nav a:hover {
    color: #8b4513;
}
section {
    padding: 50px 20px;
}
h2 {
    text-align: center;
    color: #8b4513;
    margin-bottom: 30px;
}
h1 {
    text-align: center;
    color: #8b4513;
    margin-bottom: 30px;
}
#home p {
    line-height: 1.8;   
    letter-spacing: 0.5px;  
    font-size: 18px;    
}

.card {
    /* background: #fff; */
    background: rgba(255, 255, 255, 0.96);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px auto;
    max-width: 1000px;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* smooth hover */
    cursor: pointer; /* makes cards feel clickable */
    /* position: relative; */
    /* z-index: 2; */
}

/* Hover effect for ALL cards */
.card:hover {
    transform: translateY(-8px);
    box-shadow: 0px 6px 18px rgba(0,0,0,0.2);
}
.card.no-hover:hover {
    transform: none !important;
    box-shadow: none !important;
}
/* Blog specific cards */
#blog .card{
    height: 180px;              /* fixed height */
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Truncate text with dots */
#blog .card p{
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 5;
    -webkit-line-clamp: 5;   /* limit lines */
    -webkit-box-orient: vertical;
}

/* Hover effect */
#blog .card:hover{
    transform: translateY(-8px);
    box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.2);
}

/* Modal (popup) */
.card-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

/* Modal content styled like a bigger card */
.card-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    width: 70%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    position: relative;
}

/* Close button */
.card-modal .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.bengali-text {
font-family: 'Noto Serif Bengali', serif;
font-size: 18px;
line-height: 1.7;
}
/* About Section */
.about-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
}
.about-text {
    flex: 2;
    min-width: 280px;
}
.about-photo {
    flex: 1;
    min-width: 220px;
    text-align: center;
}
.about-photo img {
    width: 100%;
    max-width: 250px;
    border-radius: 50%;
    border: 4px solid #8b4513;
}
/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: auto;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 16 / 10;
}
.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}
.gallery-item:hover img {
    transform: scale(1.1);
}
/* Card-style container for sections like Gallery */
.section-card {
background: rgba(255, 255, 255, 0.95);
border-radius: 18px;
padding: 40px 30px;
max-width: 1100px;
margin: 0 auto;
box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

/* Slight spacing from background */
#gallery {
padding: 80px 20px;
}
/* Fullscreen viewer */
#imgModal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column !important;
}
#imgModal img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 12px;
}
#imgModal span {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

#modalCaption {
    margin-top: 15px;
    color: #f5deb3; 
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    letter-spacing: 0.5px;
}

/*Blog Grid */
.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    max-width: 1000px;
    margin: auto;
}
/* Contact */
.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1000px;
    margin: auto;
}
.contact-info {
    flex: 1;
    justify-content: center;
    align-items: center;
    min-width: 250px;
}
.contact-map {
    flex: 2;
    min-width: 300px;
}
.contact-map iframe {
    width: 100%;
    height: 250px;
    border: none;
    border-radius: 12px;
}

/* form input, form textarea {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    box-sizing: border-box;
}
form textarea {
    resize: vertical;
}
form button {
    margin-top: 15px;
    padding: 10px;
    width: 100%;
    background: #8b4513;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}
form button:hover {
    background: #5a3e1b;
} */

/* Scroll-to-top button */
#topBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: #8b4513;
    color: white;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 50%;
}
#topBtn:hover {
    background-color: lime;
}

/* See More button */
.see-more {
text-align: center;
margin-top: 40px;
}
.see-more .btn {
background: #333;
color: #fff;
padding: 10px 20px;
border-radius: 8px;
text-decoration: none;
transition: background 0.3s ease;
}
.see-more .btn:hover {
background: #555;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #f5deb3;
    color: #5a3e1b;
    font-weight: bold;
    margin-top: 50px;
}
/* Responsive tweaks
@media (max-width: 600px) {
    .about-container {
    flex-direction: column;
    }
    .contact-container {
    flex-direction: column;
    }
} */

/* About me section */

.page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Modern Links & Buttons */
.modern-link {
    display: inline-block;
    color: #195b78;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(25, 91, 120, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.modern-link:hover {
    background: #195b78;
    color: white;
    transform: translateX(5px);
}

.back-btn {
    text-decoration: none;
    color: #555;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #195b78;
}

/* Timeline Core */
.timeline-container {
    position: relative;
    padding-left: 50px;
    margin-bottom: 50px;
}

/* Line controlled Js based */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 10px;       /* Starts at the center of the first dot */
    left: 21px;      /* Mathematically perfectly centered */
    width: 4px;
    
    height: var(--line-height, 100%); 
    
    background: linear-gradient(to bottom, #00b0f0, #195b78);
    border-radius: 4px;
    z-index: 0;
}

/* Timeline Item & Layout */
.timeline-item {
    position: relative;
    margin-bottom: 60px;
}

/* Ensure the old buggy node lines are completely dead */
.timeline-item::before {
    display: none !important;
}


/* Modern Glowing Dot */
.timeline-dot {
    position: absolute;
    left: -39px; 
    top: 5px;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border: 4px solid #ff4757; /* Bright accent color */
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
    z-index: 1;
}

/* Institute Headers */
.timeline-badge {
    background-color: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-institute {
    margin: 10px 0 20px 0;
    color: #222;
    font-size: 1.5em;
    font-weight: 600;
    text-align: left; 
}

/* Flex Row for Cards */
.timeline-content-row {
    display: flex;
    gap: 25px;
}

/* Aesthetic Cards */
.modern-card {
    flex: 1;
    width: 100%; 
    max-width: 850px;
    background: linear-gradient(135deg, #1e6b8c, #13455c);
    color: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box !important;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.modern-card h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-subtitle {
    margin: 0 0 15px 0;
    font-size: 0.85em;
    color: rgba(255,255,255,0.7);
}

/* Pill-Shaped Course Tags */
.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 30px; /* Pill shape */
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    cursor: default; /*will change later*/
}

.tag:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.tag-solid {
    background: #195b78; /* theme blue */
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: default; 
}

.tag-solid:hover {
    background: #13455c;
    transform: translateY(-2px);
}

/* Image Card Tweaks */
.image-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-card img {
    width: 100%;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.placeholder-img {
    width: 100%;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    color: rgba(255,255,255,0.6);
}

/* Animated Gradient Heading */
.gradient-heading {
    font-size: 2.8em;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #00b0f0, #195b78);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
    letter-spacing: 1px;
}

/* The Glowing Underline */
.gradient-heading::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff4757, transparent);
    border-radius: 2px;
    opacity: 0.8;
}


/* Badge Group Layout */
.badge-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allows badges to stack neatly on smaller screens */
    margin-bottom: 12px;
}

/* Major Badge (Blue) */
.badge-major {
    background-color: rgba(0, 176, 240, 0.15); 
    color: #0077a3;
}

/* Minor Badge / Link (Red) */
.badge-minor {
    background-color: rgba(255, 71, 87, 0.15); 
    color: #c0392b;
    text-decoration: none; /* Removes the default link underline */
    transition: all 0.2s ease;
    display: inline-block; /* Helps with the hover transform */
}


/* Setup the badge to allow a background layer */
a.timeline-badge {
    position: relative;
    z-index: 1; /* Creates a stacking context */
    text-decoration: none !important;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

/* Create the hidden animated gradient border */
a.timeline-badge::before {
    content: '';
    position: absolute;
    /* Pulls it slightly outside the badge to act as a 2px border */
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    /* The neon gradient colors */
    background: linear-gradient(90deg, #ff007f, #7928ca, #00b0f0, #4facfe, #00f2fe, #4facfe, #00b0f0, #7928ca, #ff007f);
    background-size: 400% 100%;
    border-radius: 22px; /* Slightly larger than the badge's 20px radius */
    z-index: -1; /* Puts the gradient BEHIND the badge */
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: neonGlow 3s linear infinite;
}

/* When hovered, show the border and turn the badge dark */
a.timeline-badge:hover {
    background-color: #13455c !important; /* Turns dark so the neon border pops */
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Fade in the glowing border */
a.timeline-badge:hover::before {
    opacity: 1;
}

/*The animation making the colors slide continuously */
@keyframes neonGlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 0%; }
}


/* Clickable Institute Headings */
.institute-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.institute-link .timeline-institute {
    transition: color 0.2s ease;
}

.institute-link:hover .timeline-institute {
    color: #00b0f0; /* Changes to  bright blue on hover */
}




.mini-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* strictly forces exactly 4 equal columns */
    gap: 15px;
    margin-top: 25px; 
    max-width: 850px; 

}

.mini-image {
    width: 100%; /* perfectly fill its 1/4th column slot */
    height: 150px; 
    object-fit: cover; /* Prevents the image from looking squished */
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(255,255,255,0.5); 
}

.mini-image:hover {
    transform: translateY(-5px) scale(1.05); /* Lifts and slightly zooms on hover */
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
    z-index: 2;
}

#imgModal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    cursor: pointer; /* Lets users know clicking the background closes it */
}

#imgModal img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}

#imgModal span {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    user-select: none; /* Stops the text cursor from appearing on the X */
}

.mini-load-more {
    background: #0c9ad6; 
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-family: inherit;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.mini-load-more:hover {
    background: #043779;
    transform: translateY(-2px);
}

.mini-btn-container {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    margin-top: 15px; /* Spacing above the button */
}

@media (max-width: 600px) {
    .about-container {
        flex-direction: column;
    }
    .contact-container {
        flex-direction: column;
    }
    
    /* Force the mini-gallery into a neat 2-column grid */
    .mini-gallery {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* Keep images uniform and perfectly cropped in the grid */
    .mini-image {
        width: 100% !important;
        height: 100px !important; 
        object-fit: cover !important;
    }

    /* Shrink the badges slightly to prevent text from breaking awkwardly */
    .timeline-badge {
        font-size: 0.7em !important;
        padding: 4px 8px !important;
    }

    /* Reduce padding inside the blue card so it doesn't feel cramped */
    .modern-card {
        padding: 15px !important;
    }
}

/*Tablet Responsiveness (768px and below) */
@media (max-width: 768px) {
    .timeline-content-row {
        flex-direction: column;
    }
    .timeline-container::before {
        left: 15px;
    }
    .timeline-dot {
        left: -38px;
        width: 14px;
        height: 14px;
    }
    .timeline-container {
        padding-left: 40px;
    }
}