:root {
    --primary: #1B4965;
    --secondary: #62B6CB;
    --accent: #BEE9E8;
    --highlight: #CAE9FF;
    --dark: #0D2B42;
    --light: #F7FBFC;
    --white: #FFFFFF;
    --text-dark: #1A1A2E;
    --text-light: #F5F5F5;
    --shadow: 0 4px 20px rgba(27, 73, 101, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.3s ease;
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--primary);
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.section-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    margin: 0 auto;
    border-radius: 2px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 12px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    color: var(--primary);
}

.logo-accent {
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link {
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition);
    position: relative;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.nav-link.active {
    color: #27AE60;
}

.nav-link i {
    font-size: 10px;
    transition: var(--transition);
}

/* Dropdown Menu */
.nav-item-has-submenu {
    position: relative;
}

.nav-item-has-submenu > .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: #27AE60;
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-item-has-submenu:hover > .nav-link::after {
    width: 100%;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    padding: 10px 0;
    z-index: 100;
}

.nav-item-has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    position: relative;
}

.submenu li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.submenu li a:hover {
    background: var(--light);
    color: var(--primary);
    padding-left: 25px;
}

.submenu li a i {
    float: right;
    font-size: 10px;
    margin-top: 5px;
}

/* Nested Dropdown (Level 2) */
.has-submenu {
    position: relative;
}

.submenu-level-2 {
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--white);
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: var(--transition);
    padding: 10px 0;
    margin-left: 5px;
}

.has-submenu:hover > .submenu-level-2 {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Wide dropdown for Industry Watch */
.submenu-wide {
    min-width: 280px;
}

.admin-link {
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    margin-left: 10px;
}

.admin-link:hover {
    background: var(--dark);
    color: var(--white);
}

.admin-link::after {
    display: none;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
}

/* Hero Carousel */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    margin-top: 70px;
    overflow: hidden;
}

.carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
}

.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 73, 101, 0.85), rgba(98, 182, 203, 0.7));
}

.carousel-content {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--white);
    width: 90%;
    max-width: 800px;
}

.carousel-content h3 {
    font-size: 32px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.carousel-content p {
    font-size: 18px;
    opacity: 0.9;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
    z-index: 10;
}

.carousel-arrow:hover {
    background: var(--primary);
}

.prev { left: 20px; }
.next { right: 20px; }

.carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.carousel-dot.active {
    background: var(--white);
    transform: scale(1.2);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    color: var(--white);
    padding: 20px;
}

.hero-content h1 {
    font-size: clamp(28px, 6vw, 52px);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    max-width: 900px;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 700px;
}

/* About Section */
.about-section {
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 17px;
    color: #444;
}

.about-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-card {
    background: var(--light);
    padding: 25px;
    border-radius: var(--radius);
    border-left: 4px solid var(--secondary);
    transition: var(--transition);
}

.about-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 22px;
    margin-bottom: 15px;
}

.about-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.about-card p {
    color: #555;
    font-size: 15px;
}

/* About Stories Slider */
.about-stories-slider {
    margin-top: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    height: 450px;
    background: var(--primary);
}

.stories-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.story-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.story-slide.active {
    opacity: 1;
    z-index: 2;
}

.story-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    transition: transform 6s linear;
}

.story-slide.active img {
    transform: scale(1);
}

.story-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(27, 73, 101, 0.9);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 10;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.5s ease 0.3s;
}

.story-slide.active .story-badge {
    transform: translateY(0);
    opacity: 1;
}

.slider-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.progress-bar {
    height: 100%;
    background: var(--secondary);
    width: 0%;
    transition: width linear;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.slider-arrow:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .about-stories-slider {
        height: 300px;
    }
}

.history-section, .objectives-section, .focus-section {
    margin-top: 50px;
    padding: 30px;
    background: var(--light);
    border-radius: var(--radius);
}

.history-section h3, .objectives-section h3, .focus-section h3 {
    color: var(--primary);
    margin-bottom: 20px;
}

.history-section p {
    margin-bottom: 15px;
    color: #444;
}

.objectives-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.objectives-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #444;
}

.objectives-list li i {
    color: var(--secondary);
    font-size: 18px;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.focus-item {
    background: var(--white);
    padding: 20px;
    text-align: center;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--primary);
    border: 2px solid var(--accent);
    transition: var(--transition);
}

.focus-item:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.focus-item i {
    display: block;
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--secondary);
}

.focus-item:hover i {
    color: var(--white);
}

/* Programs Section */
.programs-section {
    background: linear-gradient(180deg, var(--light) 0%, var(--accent) 100%);
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.program-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.program-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(27, 73, 101, 0.2);
}

.program-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 30px;
    margin: 0 auto 20px;
}

.program-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.program-card p {
    color: #555;
    font-size: 15px;
}

/* Publications Section */
.publications-section {
    background: var(--white);
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.publication-card {
    background: var(--light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.publication-card:hover {
    transform: translateY(-5px);
}

.publication-icon {
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 50px;
}

.publication-info {
    padding: 25px;
}

.publication-info h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 10px;
}

.publication-info p {
    color: #555;
    font-size: 14px;
    margin-bottom: 15px;
}

.publication-date {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-download:hover {
    background: var(--primary);
}

/* Gallery Section */
.gallery-section {
    background: var(--light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.gallery-item {
    height: 250px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--primary);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(27, 73, 101, 0.9));
    padding: 20px;
    color: var(--white);
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

/* Partners Section */
.partners-section {
    background: var(--white);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.partner-item {
    background: var(--light);
    padding: 25px;
    text-align: center;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--primary);
    border: 2px solid transparent;
    transition: var(--transition);
}

.partner-item:hover {
    border-color: var(--secondary);
    background: var(--white);
    box-shadow: var(--shadow);
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    color: var(--white);
}

.contact-section .section-header h2 {
    color: var(--white);
}

.contact-section .section-line {
    background: linear-gradient(90deg, var(--accent), var(--secondary));
}

.contact-content {
    display: flex;
    justify-content: center;
}

.contact-info {
    max-width: 600px;
    text-align: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.contact-item i {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
}

.contact-item h4 {
    color: var(--accent);
    margin-bottom: 5px;
}

.contact-item p {
    opacity: 0.9;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary);
    transform: translateY(-5px);
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    display: inline-block;
    margin-bottom: 20px;
}

.footer-brand p {
    color: rgba(255,255,255,0.7);
    max-width: 400px;
}

.footer-links h4 {
    color: var(--accent);
    margin-bottom: 20px;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}

/* Responsive */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .objectives-list {
        grid-template-columns: 1fr;
    }
    
    .focus-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .publications-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 36px; }
    h2 { font-size: 28px; }
    
    .mobile-toggle {
        display: block;
    }
    
    .navbar {
        padding: 15px 0;
    }

    .nav-menu {
        position: fixed;
        top: 80px; /* Aligns with taller navbar height (50px logo + 30px padding) */
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 15px 25px 25px;
        gap: 0;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: var(--transition);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .nav-menu.active {
        transform: translateY(0);
    }
    
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    
    .nav-link {
        padding: 15px 0;
        justify-content: space-between;
        width: 100%;
    }
    
    .nav-link.active {
        color: #27AE60;
    }
    
    .nav-item-has-submenu > .nav-link::after {
        display: none;
    }
    
    .submenu,
    .submenu-level-2 {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 20px;
        display: none;
        background: var(--light);
        border-radius: 0;
        min-width: unset;
        width: 100%;
    }
    
    .nav-item-has-submenu:hover > .submenu,
    .has-submenu:hover > .submenu-level-2 {
        display: block;
    }
    
    .submenu li a {
        padding: 12px 15px;
    }
    
    .submenu li a:hover {
        padding-left: 25px;
    }
    
    .admin-link {
        margin: 15px 0 5px;
        background: var(--primary);
        color: var(--white) !important;
        border-radius: var(--radius-sm);
        justify-content: center !important;
        padding: 12px !important;
        text-align: center;
    }
    
    .admin-link:hover {
        background: var(--secondary) !important;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .hero {
        margin-top: 80px;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand p {
        max-width: 100%;
    }

    /* Disable horizontal-shifting hover transforms on mobile to prevent overflow & shaking */
    .about-card:hover {
        transform: none;
    }

    .partner-item:hover {
        transform: none;
    }

    /* Focus grid: 2 columns at tablet, already 1 at 480px */
    .focus-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .focus-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .partners-grid {
        grid-template-columns: 1fr;
    }
}

/* AI Chat Button */
.ai-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(27, 73, 101, 0.4);
    z-index: 9999;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ai-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(27, 73, 101, 0.5);
}

.ai-chat-modal {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 60px);
    height: 500px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
}

.ai-chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

.ai-chat-header button:hover {
    opacity: 1;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 85%;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message.bot {
    align-self: flex-start;
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.ai-message.typing {
    color: #888;
    font-style: italic;
}

.ai-chat-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #eee;
}

.ai-chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.ai-chat-input input:focus {
    border-color: var(--primary);
}

.ai-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.ai-chat-input button:hover {
    background: var(--secondary);
}

@media (max-width: 500px) {
    .ai-chat-modal {
        right: 15px;
        bottom: 90px;
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
    }
}

/* Premium News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    gap: 40px;
    margin-top: 30px;
}

.news-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(27, 73, 101, 0.05);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(27, 73, 101, 0.12);
}

.news-image {
    height: 240px;
    overflow: hidden;
    position: relative;
    background: var(--primary);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.08);
}

.news-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--secondary);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.news-card.featured .news-badge {
    background: var(--primary);
}

.news-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-meta i {
    color: var(--secondary);
}

.news-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 15px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.news-card:hover h3 {
    color: var(--secondary);
}

.news-card p {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
    flex: 1;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-read-more i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.news-card:hover .news-read-more {
    color: var(--secondary);
}

.news-card:hover .news-read-more i {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* Premium Global Loader Overlay */
#globalLoaderOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    overflow: hidden;
}

#globalLoaderOverlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* The loader logic adapted from React Template */
.loader-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
}

.loader-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    margin-top: -100px;
    margin-left: -100px;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.loader-dots-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 200px;
    transform-style: preserve-3d;
    animation: dots-layer-rotate 10000ms linear infinite;
}

.loader-dots-layer:nth-child(1) { animation-name: dots-layer-1; }
.loader-dots-layer:nth-child(2) { animation-name: dots-layer-2; }
.loader-dots-layer:nth-child(3) { animation-name: dots-layer-3; }
.loader-dots-layer:nth-child(4) { animation-name: dots-layer-4; }
.loader-dots-layer:nth-child(5) { animation-name: dots-layer-5; }
.loader-dots-layer:nth-child(6) { animation-name: dots-layer-6; }

@keyframes dots-layer-1 {
    0% { transform: rotateX(30deg) rotateZ(0deg) translateZ(-50px); }
    50% { transform: rotateX(60deg) rotateZ(5760deg) translateZ(-100px); }
    100% { transform: rotateX(30deg) rotateZ(11520deg) translateZ(-50px); }
}

@keyframes dots-layer-2 {
    0% { transform: rotateX(30deg) rotateZ(0deg) translateZ(-36px); }
    50% { transform: rotateX(60deg) rotateZ(2880deg) translateZ(-72px); }
    100% { transform: rotateX(30deg) rotateZ(5760deg) translateZ(-36px); }
}

@keyframes dots-layer-3 {
    0% { transform: rotateX(30deg) rotateZ(0deg) translateZ(-24px); }
    50% { transform: rotateX(60deg) rotateZ(1440deg) translateZ(-48px); }
    100% { transform: rotateX(30deg) rotateZ(2880deg) translateZ(-24px); }
}

@keyframes dots-layer-4 {
    0% { transform: rotateX(30deg) rotateZ(0deg) translateZ(-14px); }
    50% { transform: rotateX(60deg) rotateZ(720deg) translateZ(-28px); }
    100% { transform: rotateX(30deg) rotateZ(1440deg) translateZ(-14px); }
}

@keyframes dots-layer-5 {
    0% { transform: rotateX(30deg) rotateZ(0deg) translateZ(-6px); }
    50% { transform: rotateX(60deg) rotateZ(360deg) translateZ(-12px); }
    100% { transform: rotateX(30deg) rotateZ(720deg) translateZ(-6px); }
}

@keyframes dots-layer-6 {
    0% { transform: rotateX(30deg) rotateZ(0deg) translateZ(0px); }
    50% { transform: rotateX(60deg) rotateZ(180deg) translateZ(-3px); }
    100% { transform: rotateX(30deg) rotateZ(360deg) translateZ(0px); }
}

.loader-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    margin-top: -3px;
    border-radius: 50%;
    background-color: var(--primary);
    transform-style: preserve-3d;
    transform: rotateZ(0) translateY(0);
}

/* Layer specific dot colors for visual depth */
.loader-dots-layer:nth-child(1) .loader-dot { background-color: var(--primary); }
.loader-dots-layer:nth-child(2) .loader-dot { background-color: var(--secondary); }
.loader-dots-layer:nth-child(3) .loader-dot { background-color: var(--primary); opacity: 0.8; }
.loader-dots-layer:nth-child(4) .loader-dot { background-color: var(--secondary); opacity: 0.8; }
.loader-dots-layer:nth-child(5) .loader-dot { background-color: var(--primary); opacity: 0.6; }
.loader-dots-layer:nth-child(6) .loader-dot { background-color: #1e3f57; }

/* Dynamic dot positioning is handled in JS for cleaner CSS */