/* Base Styles and Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --dark-color: #0a0a0a;
    --light-color: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --body-color: #ffffff;
    --section-light: #ffffff;
    --section-dark: #f8f9fa;
    --text-primary: #2b3940;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --hero-text-primary: rgba(255, 255, 255, 0.95);
    --hero-text-secondary: rgba(255, 255, 255, 0.7);
    --hero-text-tertiary: rgba(255, 255, 255, 0.5);
    --body-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --heading-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition: all 0.3s ease;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--body-color);
}

a {
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

section {
    padding: 5rem 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    font-size: 2.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.highlight {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5bd9 100%);
    box-shadow: 0 4px 15px rgba(74, 108, 247, 0.2);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a5bd9 0%, var(--primary-color) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 108, 247, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(74, 108, 247, 0.2);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    backdrop-filter: blur(10px);
    box-shadow: none;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar.scrolled .nav-links a,
.navbar.scrolled .logo {
    color: var(--text-primary);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--hero-text-primary);
    transition: var(--transition);
    z-index: 1001;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--hero-text-primary);
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--hero-text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled .hamburger span {
    background-color: var(--text-primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #111111 100%);
    position: relative;
    overflow: hidden;
}

.shapes-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    background: linear-gradient(45deg, var(--primary-color), #00d4ff);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite;
    backdrop-filter: blur(5px);
    transition: transform 0.2s ease-out;
    box-shadow: 0 8px 32px rgba(74, 108, 247, 0.15);
}

.shape:nth-child(even) {
    background: linear-gradient(45deg, #00d4ff, var(--primary-color));
}

.shape:nth-child(3n) {
    background: linear-gradient(45deg, #4a6cf7, #ff6b6b);
}

.shape:nth-child(4n):hover {
    transform: scale(1.05) translateX(-10px);
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation: float 20s infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -100px;
    animation: floatReverse 25s infinite;
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: 20%;
    animation: float 30s infinite;
}

.shape-4 {
    width: 250px;
    height: 250px;
    top: 20%;
    left: 30%;
    animation: floatReverse 22s infinite;
}

.shape-5 {
    width: 180px;
    height: 180px;
    bottom: 20%;
    right: 20%;
    animation: float 28s infinite;
}

.shape-6 {
    width: 220px;
    height: 220px;
    top: 30%;
    right: 35%;
    animation: floatReverse 24s infinite;
}

.shape-7 {
    width: 160px;
    height: 160px;
    top: 40%;
    left: 15%;
    animation: float 26s infinite;
}

.shape-8 {
    width: 280px;
    height: 280px;
    bottom: 30%;
    left: 35%;
    animation: floatReverse 29s infinite;
}

.shape-9 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation: float 23s infinite;
}

.shape-10 {
    width: 190px;
    height: 190px;
    top: 10%;
    right: 25%;
    animation: floatReverse 27s infinite;
}

.shape-11 {
    width: 140px;
    height: 140px;
    bottom: 15%;
    left: 10%;
    animation: float 21s infinite;
}

.shape-12 {
    width: 230px;
    height: 230px;
    top: 45%;
    right: 5%;
    animation: floatReverse 31s infinite;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    20% {
        transform: translate(50px, 20px) rotate(90deg) scale(1.1);
    }
    40% {
        transform: translate(20px, -30px) rotate(180deg) scale(0.9);
    }
    60% {
        transform: translate(-30px, 40px) rotate(270deg) scale(1.2);
    }
    80% {
        transform: translate(-40px, -20px) rotate(360deg) scale(0.8);
    }
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

@keyframes floatReverse {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    20% {
        transform: translate(-40px, -30px) rotate(-90deg) scale(0.9);
    }
    40% {
        transform: translate(-20px, 40px) rotate(-180deg) scale(1.1);
    }
    60% {
        transform: translate(40px, -20px) rotate(-270deg) scale(0.8);
    }
    80% {
        transform: translate(30px, 30px) rotate(-360deg) scale(1.2);
    }
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: var(--hero-text-primary);
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease;
    text-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--hero-text-secondary);
    animation: fadeInDown 1s ease 0.2s;
    animation-fill-mode: both;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--hero-text-tertiary);
    animation: fadeInDown 1s ease 0.4s;
    animation-fill-mode: both;
}

.hero-buttons {
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.6s;
    animation-fill-mode: both;
}

.hero-buttons .btn {
    margin: 0 0.5rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    animation: fadeInUp 1s ease 0.8s;
    animation-fill-mode: both;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--hero-text-primary);
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.1);
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 108, 247, 0.3);
}

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

.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.image-placeholder {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background-color: var(--section-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.about-text {
    flex: 2;
}

.about-details {
    margin-top: 2rem;
}

.detail {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.detail i {
    margin-right: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Skills Section */
.skills {
    background-color: var(--section-dark);
}

.skills-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.skill-category h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-item {
    width: 100%;
}

.skill-name {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.skill-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 1.5s ease;
}

/* Projects Section */
.projects {
    background-color: var(--section-light);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--section-dark);
}

.project-image .image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 0;
    font-size: 3rem;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.clickable-card:hover .project-img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.project-tags span {
    background-color: var(--section-dark);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links .btn {
    background-color: var(--dark-color);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.project-links .btn:hover {
    background-color: var(--text-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.clickable-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.clickable-card:hover {
    text-decoration: none;
    color: inherit;
}

.learn-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 1rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.clickable-card:hover .learn-more {
    opacity: 1;
    transform: translateX(0);
}

.learn-more i {
    transition: transform 0.3s ease;
}

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

/* Projects Show/Hide Functionality */
.featured-project {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.hidden-project {
    display: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.hidden-project.show {
    display: block;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.more-projects-container {
    text-align: center;
    margin-top: 2rem;
}

#moreProjectsBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
}

#moreProjectsBtn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 108, 247, 0.3);
}

#moreProjectsBtn i {
    transition: transform 0.3s ease;
}

#moreProjectsBtn:hover i {
    transform: rotate(180deg);
}

#moreProjectsBtn.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Ensure proper grid layout when projects are shown */
.projects-grid.expanded {
    animation: expandGrid 0.3s ease;
}

@keyframes expandGrid {
    from {
        max-height: 400px;
    }
    to {
        max-height: 1200px;
    }
}

/* Contact Section */
.contact {
    background-color: var(--section-dark);
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-item h3 {
    margin-bottom: 0.3rem;
}

.contact-form {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
    background-color: white;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.25);
}

.contact .btn-outline {
    background-color: var(--dark-color);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.contact .btn-outline:hover {
    background-color: var(--text-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.contact .social-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.contact .social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--dark-color);
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.contact .social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 108, 247, 0.3);
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
}

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

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: white;
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .about-details .detail {
        justify-content: center;
    }
    
    .skill-category h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .skill-category h3 {
        display: block;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        transition: all 0.5s ease;
        z-index: 1000;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        color: var(--text-primary);
        font-size: 1.2rem;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .hero {
        padding-top: 100px;
    }
    
    .hero-content {
        padding: 2rem 1rem;
    }
    
    .section {
        padding: 4rem 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        margin: 0;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        order: 2;
    }
    
    .contact-form {
        order: 1;
    }
}

/* Education Section */
.education {
    background-color: var(--section-light);
    position: relative;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.education-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.education-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #3a5bd9);
}

.education-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.university-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
    display: block;
}

.education-content h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.education-content h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.education-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.education-content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 992px) {
    .education-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

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

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5bd9 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.chat-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.chat-button::after {
    content: "Click to know me better!";
    position: absolute;
    top: -50px;
    right: 0;
    background: white;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    width: max-content;
    max-width: 180px;
}

.chat-button::before {
    content: "";
    position: absolute;
    top: -15px;
    right: 25px;
    border: 8px solid transparent;
    border-top-color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.chat-button.tooltip-shown::after,
.chat-button.tooltip-shown::before {
    opacity: 1;
    transform: translateY(0);
}

/* Remove the pulsing animation */
@keyframes pulseTooltip {
    0%, 100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chat-container.active {
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5bd9 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
}

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

.message {
    display: flex;
    max-width: 80%;
}

.user-message {
    justify-content: flex-end;
    align-self: flex-end;
}

.bot-message {
    justify-content: flex-start;
    align-self: flex-start;
}

.message-content {
    padding: 12px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5bd9 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message .message-content {
    background-color: #f0f2f5;
    color: var(--text-primary);
    border-bottom-left-radius: 5px;
}

.message-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

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

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.chat-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.chat-input button {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5bd9 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-input button:hover {
    transform: scale(1.1);
}

.chat-input button:active {
    transform: scale(0.95);
}

.loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 0;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    animation: loadingDots 1.5s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDots {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .chat-container {
        width: 300px;
        height: 450px;
        right: 0;
    }
    
    .chat-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* MLED Page Specific Styles */
.mled-overview {
    background-color: white;
    padding: 4rem 0;
}

/* MLED Page Background - Make it distinct from home page */
body:has([id="mled-hero"]) {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f1f3f4 100%);
    min-height: 100vh;
}

/* Alternative fallback for browsers that don't support :has() */
.mled-page-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f1f3f4 100%);
    min-height: 100vh;
}

/* MLED Hero section with distinct styling */
#mled-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #3b4a5c 100%);
    position: relative;
    overflow: hidden;
}

#mled-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

#mled-hero .hero-content {
    position: relative;
    z-index: 1;
}

/* MLED sections with subtle background variations */
.mled-overview {
    background: linear-gradient(to bottom, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.95) 100%);
    padding: 4rem 0;
    position: relative;
}

.mled-overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 100px,
        rgba(74, 108, 247, 0.01) 100px,
        rgba(74, 108, 247, 0.01) 102px
    );
    pointer-events: none;
}

/* Research section with different background */
#research {
    background: linear-gradient(to bottom, rgba(248,249,250,0.8) 0%, rgba(255,255,255,0.9) 100%);
    position: relative;
}

#research::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 25% 25%, rgba(74, 108, 247, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(74, 108, 247, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

.architecture-description {
    margin-bottom: 3rem;
}

.description-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.description-text h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.description-text p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.architecture-diagram {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 2px solid #dee2e6;
}

.level {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background-color: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.level span {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.layers {
    display: flex;
    gap: 0.5rem;
}

.layer {
    background-color: var(--section-dark);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.core-features, .mathematical-foundation, .framework-benefits {
    margin: 3rem 0;
}

.core-features h3, .mathematical-foundation h3, .framework-benefits h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-align: center;
}

.features-grid, .benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card, .benefit-item {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.feature-card:hover, .benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.feature-icon, .benefit-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5bd9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon i, .benefit-icon i {
    font-size: 1.5rem;
    color: white;
}

.feature-card h4, .benefit-item h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feature-card p, .benefit-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.feature-card ul {
    list-style: none;
    padding: 0;
}

.feature-card li {
    padding: 0.3rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.feature-card li::before {
    content: '▶';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 0.8rem;
}

.foundation-content {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.foundation-text p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.benefits-overview {
    text-align: center;
    margin-bottom: 2rem;
}

.benefits-overview p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.validation-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin-top: 2rem;
}

.validation-note p {
    margin: 0;
    font-style: italic;
    color: var(--text-primary);
}

.research-badges {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5bd9 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Responsive Design for MLED page */
@media (max-width: 992px) {
    .description-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .features-grid, .benefits-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .features-grid, .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .research-badges {
        justify-content: center;
    }
    
    .architecture-diagram {
        padding: 1rem;
    }
    
    .foundation-content {
        padding: 1.5rem;
    }
}

/* Research Section Improvements */
.publications-section, .artifacts-section, .implementation-summary {
    margin: 3rem 0;
}

.publications-section h3, .artifacts-section h3, .implementation-summary h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 1.6rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.publications-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.publication-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.publication-link:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    color: inherit;
    text-decoration: none;
}

.publication-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.publication-content .authors {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
    font-size: 0.95rem;
}

.publication-content .venue {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.publication-link i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-left: 1rem;
    transition: transform 0.3s ease;
}

.publication-link:hover i {
    transform: translateX(3px);
}

.artifacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.artifact-link {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.artifact-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    color: inherit;
    text-decoration: none;
}

.artifact-link i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 0.2rem;
}

.artifact-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.artifact-content p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.implementation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.impl-item {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.impl-item h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.impl-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Responsive improvements for research section */
@media (max-width: 768px) {
    .publication-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .publication-link i {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .artifacts-grid, .implementation-grid {
        grid-template-columns: 1fr;
    }
}
