/* 
   Optimized Premium UI Refresh for APMCCPER
   Theme: Vibrant Red & Deep Blue (Professional Academic)
   Author: Antigravity
*/

:root {
    --primary-color: #1a4d8c;
    --primary-dark: #0f3057;
    --accent-color: #e71d36; /* Vibrant Red from screenshot */
    --accent-dark: #c1121f;
    --secondary-color: #ff9f1c;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 15px 35px rgba(0, 0, 0, 0.12);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Smoothening */
body {
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* --- Premium Header --- */
.header {
    background: var(--white);
    padding: 10px 0;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 15px rgb(255, 0, 0); /* Added subtle shadow */
    height: 90px; /* Consistent height */
    display: flex;
    align-items: center;
}

.header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    height: 80px;
    box-shadow: var(--shadow-soft);
}

/* Prevent menu entrapment when scrolled */
.mobile-nav-active .header.scrolled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    height: auto !important;
}

.header .logo {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

/* Offset for branding balance on large screens */
@media (min-width: 1200px) {
    .header .logo {
        margin-left: 280px;
    }
}

.header .sitename {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent-color);
    margin: 0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

@media (max-width: 991px) {
    .header .sitename {
        font-size: 1.5rem;
    }
}

@media (max-width: 575px) {
    .header .sitename {
        font-size: 1.25rem;
        letter-spacing: 0.5px;
    }
    .header .logo {
        gap: 10px;
    }
}

@media (max-width: 400px) {
    .header .sitename {
        font-size: 1.1rem;
    }
}

.service-item h4 {
    padding: 25px 20px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 0;
    background: var(--white);
    transition: var(--transition-smooth);
}

.service-item:hover h4 {
    color: var(--accent-color);
}

/* Event Date Badge */
.date-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent-color);
    color: var(--white);
    padding: 10px 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    z-index: 10;
    line-height: 1.2;
}

.date-badge .day {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
}

.date-badge .month {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.header .logo-container {
    background: var(--white);
    width: 68px; /* Perfectly sized to header 90px height */
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid var(--secondary-color); /* Premium gold/orange ring */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: var(--transition-smooth);
    overflow: hidden;
    padding: 0;
    z-index: 100;
}

@media (max-width: 575px) {
    .header .logo-container {
        width: 50px;
        height: 50px;
        border-width: 2px;
    }
    .header {
        height: 75px;
    }
    .header .branding {
        padding: 0;
        width: 100%;
    }
}

@media (max-width: 400px) {
    .header .logo-container {
        width: 40px;
        height: 40px;
    }
    .header {
        height: 65px;
    }
}

.header .logo-container img {
    max-height: 94%; /* Maximum visibility inside the ring */
    width: auto;
    margin-left: 0; /* Resetting margin for better centering */
    object-fit: contain;
}

.header .logo-container:hover {
    transform: rotate(5deg) scale(1.1);
    border-color: var(--accent-color); /* Red shift on hover */
}

/* --- Premium Home Page Borders --- */
.service-item, 
.gallery-item, 
.contact-card,
.about-visual img {
    border: 1.5px solid var(--accent-color) !important;
    border-radius: 16px !important;
    transition: var(--transition-smooth);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.service-item:hover, 
.gallery-item:hover {
    box-shadow: 0 10px 30px rgba(231, 29, 54, 0.15); /* Subtle red glow */
    transform: translateY(-5px);
}

/* Navigation Animation */
.navmenu ul li a {
    color: var(--primary-dark) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.8px;
    padding: 0 18px !important;
    transition: var(--transition-smooth);
}

.navmenu ul li a:hover,
.navmenu ul li a.active {
    color: var(--accent-color) !important;
}

/* --- Premium Dropdowns --- */
.navmenu .dropdown ul {
    background: var(--white);
    padding: 15px 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-top: 4px solid var(--accent-color); /* Premium Red Accent */
    display: block;
    visibility: hidden;
    opacity: 0;
    top: 100%;
    transform: translateY(15px);
    transition: all 0.3s ease;
}

.navmenu .dropdown:hover > ul {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.navmenu .dropdown ul li a {
    padding: 12px 25px !important;
    color: var(--primary-dark) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-transform: none;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navmenu .dropdown ul li a:hover {
    background: rgba(231, 29, 54, 0.05); /* Subtle Red tint */
    color: var(--accent-color) !important;
    padding-left: 30px !important; /* Premium slide effect */
}

/* Second level dropdowns */
.navmenu .dropdown ul ul {
    top: 0;
    left: 100%;
    transform: translateX(15px);
    border-top: 0;
    border-left: 4px solid var(--accent-color);
}

.navmenu .dropdown ul li:hover > ul {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
}

/* --- Hero Section Refined --- */
.hero#hero-home {
    height: 95vh !important;
}

/* Clean up legacy template lines */
.section-title h2::before,
.section-title h2::after {
    display: none !important;
}

/* --- Section Titles & Dividers Refined --- */
.section-title {
    position: relative;
    padding-bottom: 25px;
}

.section-title h6 {
    letter-spacing: 2px;
    font-weight: 700 !important;
}

.section-title h2 {
    font-weight: 800 !important;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.divider {
    display: block !important;
    width: 70px;
    height: 5px;
    background: var(--accent-color);
    border-radius: 10px;
    margin: 0 auto;
    transition: var(--transition-smooth);
}

/* Hover effect */
.section-title:hover .divider {
    width: 100px;
    background: var(--primary-color); /* Premium color shift on hover */
}

/* Specific styling for the Affiliation Heading 'line set' */
.affiliation-banner .section-heading {
    position: relative;
    padding-bottom: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 30px !important;
}

.affiliation-banner .section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 5px;
    background: var(--accent-color);
    border-radius: 5px;
}
section.hero:not(#hero-home) {
    height: 380px !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center 30%; /* Shift up to show building tops */
    background-attachment: fixed;
    text-align: center;
    color: var(--white);
    overflow: hidden;
}

.grayscale-map {
    filter: grayscale(100%) contrast(0.8) opacity(0.8);
    transition: var(--transition-smooth);
}

.grayscale-map:hover {
    filter: grayscale(0%) contrast(1) opacity(1);
}

section.hero:not(#hero-home)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 77, 140, 0.85), rgba(231, 29, 54, 0.7));
    z-index: 1;
}

section.hero:not(#hero-home) .container {
    position: relative;
    z-index: 2;
}

#hero-home .swiper-slide {
    height: 95vh !important;
}

/* --- Section Global Aesthetic --- */
section:not(.hero) {
    background-color: #fdfdfd;
    background-image: radial-gradient(#ececec 1px, transparent 1px);
    background-size: 25px 25px;
    padding: 100px 0;
}

.section-title h2,
.affiliation-title h3 {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.section-title h2::after,
.affiliation-title h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 70px;
    height: 5px;
    background: var(--accent-color);
    border-radius: 2px;
}

.text-center .section-title h2::after,
.text-center .affiliation-title h3::after {
    left: 50%;
    transform: translateX(-50%);
}

.affiliation-banner {
    background: var(--white);
    padding: 45px;
    border-radius: 24px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition-smooth);
}

.affiliation-banner:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.hero-content h2 {
    font-size: 4rem !important;
    font-weight: 900 !important;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin-bottom: 20px !important;
}

.hero-content p {
    font-size: 1.3rem !important;
    max-width: 800px;
    margin: 0 auto 40px !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Buttons Transformation */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark)) !important;
    border: none !important;
    box-shadow: 0 8px 15px rgba(231, 29, 54, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(231, 29, 54, 0.4);
}

.btn-outline-light {
    border-width: 2px !important;
    font-weight: 700 !important;
}

/* --- Section Decoration --- */
.section-heading {
    position: relative;
    padding-bottom: 15px;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 5px;
    background: var(--accent-color);
    border-radius: 2px;
}

.text-center .section-heading::after {
    left: 50%;
    transform: translateX(-50%);
}

/* About Section Improvements */
.about-visual img {
    border: 10px solid var(--white);
    transform: perspective(1000px) rotateY(-5deg);
}

.about-visual:hover img {
    transform: perspective(1000px) rotateY(0deg);
}

/* --- Mobile Navigation Refresh --- */
@media (max-width: 1199px) {
    .mobile-nav-active {
        overflow: hidden !important; /* Prevent background scroll */
    }

    .mobile-nav-active .navmenu {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(12, 28, 54, 0.94) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 9999 !important;
        overflow-y: auto !important; /* Enable scrolling for long menus */
        display: block !important;
    }

    .mobile-nav-active .navmenu > ul {
        display: block !important;
        background: var(--white) !important;
        margin: 20px;
        padding: 40px 25px !important;
        border-radius: 24px !important;
        box-shadow: 0 25px 50px rgba(0,0,0,0.3) !important;
        border: 4px solid var(--primary-color) !important; /* Deep Blue frame */
        position: relative;
    }

    .mobile-nav-active .navmenu ul li a {
        padding: 15px 0 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        font-size: 1.1rem !important;
        color: var(--primary-dark) !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-nav-active .navmenu ul li a:hover,
    .mobile-nav-active .navmenu ul li a.active {
        color: var(--accent-color) !important;
        padding-left: 10px !important;
    }

    /* Submenu animation and visibility */
    .mobile-nav-active .navmenu ul ul {
        display: none;
        background: rgba(0, 0, 0, 0.03) !important;
        margin: 10px 0 !important;
        padding: 5px 15px !important;
        border-radius: 12px;
        border-left: 3px solid var(--accent-color);
        list-style: none;
    }

    .mobile-nav-active .navmenu ul .dropdown-active {
        display: block !important;
    }

    /* Rotate chevron when active */
    .mobile-nav-active .navmenu .active i {
        transform: rotate(180deg);
    }

    /* Fixed Toggle when menu is open */
    .mobile-nav-active .mobile-nav-toggle {
        color: var(--primary-dark) !important;
        background: var(--white) !important;
        position: fixed !important;
        top: 20px;
        right: 20px;
        z-index: 10001;
    }

    /* Mobile Toggle Button */
    .mobile-nav-toggle {
        color: var(--primary-dark) !important;
        background: var(--white);
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        font-size: 28px !important;
    }
}
