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

:root {
    --emerald-primary: #059669;
    --emerald-secondary: #047857;
    --emerald-accent: #10b981;
    --emerald-light: #34d399;
    --emerald-bright: #6ee7b7;
    --emerald-pale: #a7f3d0;
    --emerald-ultra: #d1fae5;
    --emerald-dark: #064e3b;
    --teal-accent: #14b8a6;
    --mint-fresh: #5eead4;
    --forest-deep: #0f172a;
    --slate-dark: #1e293b;
    --slate-light: #64748b;
    --gray-soft: #f1f5f9;
    --white: #ffffff;
    --gradient-emerald: linear-gradient(135deg, var(--emerald-primary) 0%, var(--teal-accent) 100%);
    --gradient-forest: linear-gradient(135deg, var(--emerald-dark) 0%, var(--emerald-secondary) 100%);
    --gradient-light: linear-gradient(135deg, var(--emerald-pale) 0%, var(--mint-fresh) 100%);
    --shadow-emerald: 0 25px 50px -12px rgba(5, 150, 105, 0.25);
    --shadow-deep: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --section-padding: 50px 0;
}

/* --- MAIN BODY SETUP (Sticky Footer & Font) --- */
body {
    font-family: 'Hind Madurai', 'Poppins', sans-serif;
    /* Tamil Font Added */
    line-height: 1.6;
    color: var(--slate-dark);
    overflow-x: hidden;
    background: var(--white);

    /* Sticky Footer Logic */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* NAVBAR */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(5, 150, 105, 0.1);
    padding: 10px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    padding: 0.8rem 0;
    box-shadow: var(--shadow-emerald);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--emerald-primary) !important;
    transition: all 0.3s ease;
}

.navbar-brand img {
    height: 55px;
    width: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-nav .nav-link {
    color: var(--slate-dark) !important;
    font-weight: 600;
    /* Bold text for Tamil */
    font-size: 1.1rem;
    /* Increased size */
    margin: 0 0.8rem;
    position: relative;
    padding: 6px 0 !important;
    padding-bottom: 6px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--emerald-primary) !important;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    background: var(--gradient-emerald);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    width: 100%;
}

/* --- CAROUSEL SECTION (Updated for Layout) --- */
.carousel-section {
    padding: 0;
    background: #f8f9fa;
    /* Pushes content to fill space */
    flex: 1;
    display: flex;
    align-items: center;
}

.banner-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.carousel-item img {
    height: 400px;
    object-fit: cover;
    width: 100%;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgb(10 10 10 / 18%), rgb(0 0 0 / 27%));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.carousel-content {
    text-align: center;
    color: white;
    max-width: 950px;
    padding: 2rem;
}

.carousel-title {
    font-size: 35px;
    font-weight: 700;
    margin-bottom: -40rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.carousel-indicators {
    z-index: 20 !important;
    bottom: 20px;
    gap: 5px;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    /* height: 5px; */
    /* border-radius: 50%;
    margin: 0 5px;
    /* background-color: rgba(255, 255, 255, 0.5); */
    /* border: none; */
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    cursor: pointer;
}

.carousel-indicators .active {
    background-color: white;
}

.carousel-btn {
    background: var(--emerald-primary);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 7px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* --- FOOTER (Updated for Sticky) --- */
.footer {
    background: var(--forest-deep);
    color: white;
    padding: 10px 0;
    position: relative;
    margin-top: auto;
    /* Push to bottom */
    width: 100%;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-emerald);
}

.footer-brand {
    margin-bottom: 2rem;
}

.footer-brand img {
    height: 60px;
    margin-bottom: 1.5rem;
}

.footer-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--mint-fresh);
}

.footer-description {
    font-size: 13PX;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 15px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--mint-fresh);
    transform: translateX(5px);
}

.footer-links a i {
    margin-right: 0.8rem;
    width: 18px;
    color: var(--emerald-light);
}

.footer-bottom {
    /* padding-top: 1rem; */
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
}

/* SCROLL TO TOP */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--gradient-emerald);
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-emerald);
    font-size: 1.2rem;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(5, 150, 105, 0.4);
}

.scroll-top.show {
    display: flex;
}

/* =========================================
   LEGACY STYLES (Kept for other pages)
   ========================================= */

/* ABOUT SECTION & GRIDS */
.about-section {
    padding: var(--section-padding);
    background: var(--gray-soft);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    background: var(--emerald-ultra);
    color: var(--emerald-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.section-title {
    font-weight: 800;
    color: var(--emerald-dark);
    line-height: 1.2;
}

.about-main-card-v4 {
    background: white;
    border-radius: 30px;
    padding: 0;
    box-shadow: var(--shadow-deep);
    overflow: hidden;
}

.about-content-v4 {
    padding: 50px 4rem;
}

.about-title-v4 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--emerald-dark);
}

.about-text-v4 {
    font-size: 13px;
    line-height: 1.8;
    color: var(--slate-dark);
    margin-bottom: 25px;
}

.about-grid-v4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.grid-item-v4 {
    background: var(--emerald-ultra);
    padding: 20px 17px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid var(--emerald-pale);
    transition: all 0.3s ease;
}

.grid-item-v4:hover {
    transform: translateY(-5px);
    border-color: var(--emerald-primary);
}

.grid-icon-v4 {
    width: 30px;
    height: 30px;
    background: var(--gradient-emerald);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.grid-title-v4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--emerald-dark);
    margin-bottom: 0px;
}

.grid-text-v4 {
    color: var(--slate-light);
    font-size: 11px;
    margin-top: 6px;
    text-align: left;
}

.about-image-v4 {
    height: 100%;
    background: url('https://tnfd.devops-in22labs.com/assets/img/login.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

/* RESOURCES / CARDS */
.resource-card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

.resource-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-emerald);
    border-color: var(--emerald-light);
}

.resource-image {
    height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.resource-content {
    padding: 2.5rem;
}

.resource-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--emerald-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.btn-read-more {
    background: var(--gradient-emerald);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* PROCESS SECTION */
.process-flow-p3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4rem 0;
    position: relative;
}

.process-step-p3 {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-circle-p3 {
    width: 90px;
    height: 90px;
    background: var(--gradient-emerald);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 32px;
    box-shadow: var(--shadow-emerald);
    transition: all 0.3s ease;
}

.step-title-p3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--emerald-dark);
    margin-bottom: 0.8rem;
}

.step-description-p3 {
    color: var(--slate-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* =========================================
   MEDIA QUERIES (Responsive Logic)
   ========================================= */

@media (min-width: 1201px) and (max-width: 1300px) {
    .section-title {
        font-size: 35px !important;
    }

    .about-title-v4 {
        font-size: 22px !important;
    }
}

@media (min-width: 1301px) and (max-width: 1400px) {
    .section-title {
        font-size: 37px !important;
    }

    .about-title-v4 {
        font-size: 23px !important;
    }
}

@media (min-width: 1401px) and (max-width: 1500px) {
    .section-title {
        font-size: 38px !important;
    }

    .about-title-v4 {
        font-size: 24px !important;
    }
}

@media (min-width: 1501px) and (max-width: 1600px) {
    .section-title {
        font-size: 40px !important;
    }

    .about-title-v4 {
        font-size: 25px !important;
    }

    .about-text-v4 {
        font-size: 15px !important;
    }

    .carousel-item img {
        height: 420px !important;
    }
}

@media (min-width: 1601px) {
    .section-title {
        font-size: 42px !important;
    }

    .about-title-v4 {
        font-size: 25px !important;
    }

    .about-text-v4 {
        font-size: 16px !important;
    }

    .carousel-item img {
        height: 420px !important;
    }
}

@media (max-width: 768px) {

    /* Navbar Adjustments */
    .navbar-nav .nav-link {
        margin: 0.5rem 0;
    }

    /* Carousel Adjustments */
    .carousel-item img {
        height: 350px;
        /* Full height for mobile immersive feel */
    }

    .carousel-title {
        font-size: 26px;
    }

    .carousel-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Legacy Section Adjustments */
    .about-title-v4 {
        font-size: 20px !important;
    }

    .about-grid-v4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .step-circle-p3 {
        width: 60px !important;
        height: 60px !important;
        font-size: 25px !important;
    }

    .about-content-v4 {
        padding: 50px 2rem !important;
    }

    .process-flow-p3 {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 425px) {
    .about-grid-v4 {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .padding-sm-0 {
        padding: 0px !important;
    }
}

/* Section Background */
.resources-section-r3 {
    background: var(--gray-soft);
    padding-bottom: 80px;
}

/* Grid Layout - Responsive Configuration */
.resource-masonry-r3 {
    display: grid;
    /* Default: 3 columns for standard laptops */
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 2rem;
}

/* Resource Card Styling */
.resource-brick-r3 {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    transition: all 0.4s ease;
    padding: 20px !important;
    position: relative;
    border: 1px solid transparent;
}

.resource-brick-r3:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-emerald);
    border-color: var(--emerald-pale);
}

.resource-image-r3 {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    position: relative;
    border-radius: 15px 15px 0 0;
    border-bottom: 1px solid #e2e8f0;
}

/* Category Badge (Top left of image) */
.category-badge {
    display: none !important;
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--emerald-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(5, 150, 105, 0.3);
}

/* Content Area */
.resource-content-r3 {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource-title-r3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--emerald-dark);
    line-height: 1.4;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em;
}

/* Read More Button */
.read-more-btn-r3 {
    margin-top: auto;
    align-self: flex-start;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
}

.read-more-btn-r3 {
    background: transparent;
    color: var(--emerald-primary);
    border: 2px solid var(--emerald-primary);
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more-btn-r3:hover {
    background: var(--emerald-primary);
    color: white;
    transform: translateX(3px);
}

/* Large Display: Show 4 items per row */
@media (min-width: 1200px) {
    .resource-masonry-r3 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium Screens (Tablets/Small Laptops): Show 2 items */
@media (max-width: 992px) {
    .resource-masonry-r3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Screens: Show 1 item */
@media (max-width: 576px) {
    .resource-masonry-r3 {
        grid-template-columns: 1fr;
    }
}

/* --- META INFO STYLES FOR BOOKS --- */
.resource-meta {
    font-size: 0.85rem;
    color: var(--slate-light);
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-item i {
    color: var(--emerald-primary);
    width: 15px;
    text-align: center;
}

.resource-brick-r3 {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* --- MOBILE MENU IMPROVEMENTS --- */
@media (max-width: 991px) {

    .navbar-collapse {
        background: #ffffff;
        padding: 15px;
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        margin-top: 15px;
        border: 1px solid #f1f5f9;
    }

    .navbar-nav .nav-item {
        margin: 5px 0;
    }

    .navbar-nav .nav-link {
        padding: 12px 20px !important;
        border-radius: 10px;
        transition: all 0.3s ease;
        margin: 0 !important;
    }

    .navbar-nav .nav-link::before {
        display: none !important;
    }

    .navbar-nav .nav-link.active,
    .navbar-nav .nav-link:hover {
        background-color: var(--emerald-ultra);
        color: var(--emerald-primary) !important;
        transform: translateX(5px);
        font-weight: 700;
    }
}

.navbar-nav .nav-link {
    font-weight: 600;
    font-size: 1.1rem;
}

.navbar-toggler i {
    font-size: 1.5rem;
    color: var(--emerald-primary, #059669);
}

.navbar-toggler:focus {
    box-shadow: none;
}