:root {
    --primary-color: #0071e3;
    --text-color: #ffffff;
    --background-color: #121212;
    --secondary-background: #1e1e1e;
    --hobby-background: #37474f;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    font-size: 16px; /* Base font size */
}

body.dark-mode {
    --text-color: #ffffff;
    --background-color: #121212;
    --secondary-background: #1e1e1e;
    --hobby-background: #37474f;
}

header {
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    text-align: center;
}

.nav {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px 0; /* Reduced padding for mobile */
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav ul {
    list-style-type: none;
    display: flex;
    justify-content: center;
    align-items: center; /* Align items vertically */
    padding: 0;
    margin: 0;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.nav li {
    margin: 5px 10px; /* Reduced margin for mobile */
}

.nav a,
.nav button {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 300;
    transition: color 0.3s;
    padding: 10px; /* Increase touch target size */
    background: none; /* Remove background */
    border: none; /* Remove border */
    cursor: pointer; /* Pointer cursor */
    font-family: 'Poppins', sans-serif; /* Match font */
}

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

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--secondary-background);
    padding: 0 20px; /* Added padding for mobile */
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3rem; /* Adjusted for better scaling */
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem; /* Adjusted for better scaling */
    margin-bottom: 2rem;
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 400;
    transition: background-color 0.3s;
    display: inline-block;
}

.cta-button:hover {
    background-color: #005bb8;
}

.section-title {
    font-size: 2rem; /* Adjusted for better scaling */
    margin-bottom: 2rem;
    text-align: center;
}

.biography,
.projects,
.blogs,
.timeline,
.hobbies,
.call-for-speakers,
.call-for-papers {
    padding: 80px 20px; /* Reduced padding for mobile */
}

.bio-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.bio-image {
    float: none; /* Reset float for mobile */
    margin: 0 auto 20px;
    display: block;
    border-radius: 50%;
    width: 150px; /* Adjusted for mobile */
    height: 150px; /* Adjusted for mobile */
    object-fit: cover;
}

.projects-grid,
.blog-grid,
.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.projects-item,
.blog-post,
.hobby-item {
    background: var(--secondary-background);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.projects-item:hover,
.blog-post:hover,
.hobby-item:hover {
    transform: translateY(-5px);
}

.projects-item-image,
.blog-post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.projects-item-content,
.blog-post-content,
.hobby-item-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.projects-item h3,
.blog-post h3,
.hobby-item h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.projects-item p,
.blog-post p,
.hobby-item p {
    flex-grow: 1;
    margin-bottom: 15px;
}

.projects-item .cta-button,
.blog-post .cta-button,
.hobby-item .cta-button {
    align-self: flex-start;
}

.hobby-item {
    background: var(--hobby-background);
    height: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: var(--text-color);
    background-size: cover;
    background-position: center;
    position: relative;
}

.hobby-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    border-radius: 10px;
    z-index: 1;
}

.hobby-item h3,
.hobby-item p,
.hobby-item .cta-button {
    position: relative;
    z-index: 2;
}

.center-button {
    text-align: center;
    margin-top: 30px;
}

/* Timeline styles */
.timeline {
    background-color: var(--secondary-background);
    padding: 50px 0;
}

.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px;
    background-color: var(--background-color);
    border: 4px solid var(--primary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even)::after {
    left: -16px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: var(--background-color);
    position: relative;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.timeline-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

footer {
    text-align: center;
    padding: 20px 0;
    background-color: var(--secondary-background);
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 14px; /* Slightly smaller base font size for mobile */
    }

    .nav {
        padding: 10px 0; /* Adjusted padding */
    }

    .nav ul {
        flex-direction: column;
        align-items: center;
    }

    .nav li {
        margin: 5px 0;
    }

    .hero h1 {
        font-size: 2.5rem; /* Adjusted for better scaling */
    }

    .hero p {
        font-size: 1rem; /* Adjusted for better scaling */
    }

    .section-title {
        font-size: 1.8rem; /* Adjusted for better scaling */
    }

    .bio-image {
        margin: 0 auto 20px; /* Centered image */
        width: 150px; /* Adjusted for mobile */
        height: 150px; /* Adjusted for mobile */
    }

    .projects-grid,
    .blog-grid,
    .hobbies-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
    }

    .timeline-container::after {
        left: 31px; /* Adjusted for mobile */
    }

    .timeline-item {
        width: 100%; /* Full width for mobile */
        padding-left: 20px; /* Adjusted padding */
        padding-right: 20px; /* Adjusted padding */
        left: 0; /* Reset left positioning */
    }

    .timeline-item::after {
        left: 15px; /* Adjusted dot position */
    }

    .timeline-item:nth-child(even)::after {
        left: 15px; /* Adjusted dot position for even items */
    }

    .timeline-content {
        padding: 15px 20px; /* Adjusted padding */
    }

    .cta-button {
        display: block;
        text-align: center;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem; /* Adjusted for smaller screens */
    }

    .hero p {
        font-size: 0.9rem; /* Adjusted for smaller screens */
    }

    .section-title {
        font-size: 1.5rem; /* Adjusted for smaller screens */
    }

    .biography,
    .projects,
    .blogs,
    .timeline,
    .hobbies,
    .call-for-speakers,
    .call-for-papers {
        padding: 50px 10px; /* Reduced padding for very small screens */
    }

    .timeline-container::after {
        left: 21px; /* Adjusted for mobile */
    }

    .timeline-item {
        padding-left: 10px; /* Further reduced padding */
        padding-right: 10px; /* Further reduced padding */
    }

    .timeline-item::after {
        left: 5px; /* Adjusted dot position */
    }

    .timeline-item:nth-child(even)::after {
        left: 5px; /* Adjusted dot position for even items */
    }
}

/* Chat Popup Styles */
#chat-popup {
    position: fixed;
    bottom: 80px; /* Adjusted position to avoid overlapping with the button */
    right: 20px;
    width: 300px;
    height: 400px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: none; /* Initially hidden */
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

#chat-header {
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    cursor: pointer;
    text-align: center;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

#chat-input {
    display: flex;
    padding: 10px;
}

#chat-input input {
    flex-grow: 1;
    margin-right: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Brands Section Styles */
.brands-section {
    background-color: var(--secondary-background);
    padding: 50px 20px;
    text-align: center;
}

.brands-marquee {
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.brands-container {
    display: inline-block;
    animation: scroll 20s linear infinite; /* Adjust the duration for speed */
}

.brand-logo {
    height: 100px; /* Set a fixed height for all logos */
    width: 100px; /* Set a fixed width for all logos */
    object-fit: contain; /* Maintain aspect ratio */
    margin: 0 20px; /* Space between logos */
}

@keyframes scroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}
