/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Body (Light Mode) */
body {
    background-color: #f4f7fa;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Body (Dark Mode) */
body.dark-mode {
    background-color: #1a202c;
    color: #e2e8f0;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: #e3f0fa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

body.dark-mode header {
    background-color: #2d3748;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Logo */
.logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #2c5282;
    transition: color 0.3s ease;
}

body.dark-mode .logo h1 {
    color: #63b3ed;
}

/* Header Controls (Search Bar, Dark Mode, Hamburger) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 5px;
    padding: 5px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

body.dark-mode .search-bar {
    background-color: #4a5568;
}

.search-bar input {
    border: none;
    padding: 5px;
    outline: none;
    background: transparent;
    color: #333;
    width: 150px;
}

body.dark-mode .search-bar input {
    color: #e2e8f0;
}

.search-bar button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #2c5282;
    transition: color 0.3s ease;
}

body.dark-mode .search-bar button {
    color: #63b3ed;
}

/* Dark Mode Toggle */
#dark-mode-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #2c5282;
    transition: color 0.3s ease;
}

body.dark-mode #dark-mode-toggle {
    color: #63b3ed;
}

body.dark-mode #dark-mode-toggle i::before {
    content: "\f185"; /* Sun icon for dark mode */
}

/* Hamburger Menu */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
}

.nav-toggle-label span {
    background-color: #2c5282;
    height: 3px;
    width: 100%;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

body.dark-mode .nav-toggle-label span {
    background-color: #e2e8f0;
}

.nav-toggle-label span:nth-child(1) {
    top: 0;
}

.nav-toggle-label span:nth-child(2) {
    top: 8px;
}

.nav-toggle-label span:nth-child(3) {
    top: 16px;
}

.nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
}

.nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
}

.nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: rotate(-45deg);
    top: 8px;
}

/* Navigation */
.nav-menu {
    width: 100%;
    order: 3;
}

.nav-menu .main-menu {
    list-style: none;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    margin: 0;
}

.nav-menu .main-menu li {
    position: relative;
}

.nav-menu .main-menu li a {
    text-decoration: none;
    color: #2c5282;
    font-weight: 500;
    padding: 8px 12px;
    display: block;
    transition: color 0.3s ease;
}

body.dark-mode .nav-menu .main-menu li a {
    color: #e2e8f0;
}

.nav-menu .main-menu li a:hover {
    color: #63b3ed;
}

/* Dropdown Menu */
.dropdown-toggle::after {
    content: '▼';
    display: inline-block;
    margin-left: 5px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after,
.dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    border: 1px solid #d3e2f1;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 10px;
    top: 100%;
    left: 0;
    min-width: 200px;
    z-index: 300;
}

body.dark-mode .dropdown-menu {
    background-color: #4a5568;
    border-color: #718096;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    color: #2c5282;
    padding: 8px 10px;
    display: block;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

body.dark-mode .dropdown-menu li a {
    color: #e2e8f0;
}

.dropdown-menu li a:hover {
    background-color: #e3f0fa;
    border-radius: 3px;
}

body.dark-mode .dropdown-menu li a:hover {
    background-color: #718096;
}

/* Hero Section */
.hero {
    background: linear-gradient(to right, #bee3f8, #e3f0fa);
    text-align: center;
    padding: 80px 0;
    margin-bottom: 30px;
    transition: background 0.3s ease;
}

body.dark-mode .hero {
    background: linear-gradient(to right, #2d3748, #4a5568);
}

.hero h2 {
    font-size: 40px;
    color: #2c5282;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

body.dark-mode .hero h2 {
    color: #e2e8f0;
}

.hero p {
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 25px;
    transition: color 0.3s ease;
}

body.dark-mode .hero p {
    color: #a0aec0;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #63b3ed;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: #4299e1;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    flex-direction: row-reverse;
}

.blog-posts {
    flex: 3;
}

.category-section {
    margin-bottom: 40px;
}

.category-section h3 {
    font-size: 26px;
    color: #2c5282;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

body.dark-mode .category-section h3 {
    color: #e2e8f0;
}

/* Latest Update Animation */
.latest-update {
    background-color: #e3f0fa;
    padding: 8px;
    margin-bottom: 15px;
    color: #2c5282;
    font-weight: 500;
    border-radius: 5px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    animation: pulse 2s infinite;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .latest-update {
    background-color: #4a5568;
    color: #e2e8f0;
}

@keyframes pulse {
    0% { background-color: #e3f0fa; }
    50% { background-color: #d3e2f1; }
    100% { background-color: #e3f0fa; }
}

body.dark-mode .latest-update {
    animation: pulse-dark 2s infinite;
}

@keyframes pulse-dark {
    0% { background-color: #4a5568; }
    50% { background-color: #718096; }
    100% { background-color: #4a5568; }
}

.latest-update span {
    display: inline-block;
    animation: scroll 10s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.post {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

body.dark-mode .post {
    background-color: #2d3748;
}

.post:hover {
    transform: translateY(-5px);
}

.post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.post h3 {
    font-size: 22px;
    color: #2c5282;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

body.dark-mode .post h3 {
    color: #e2e8f0;
}

.post .meta {
    font-size: 14px;
    color: #718096;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

body.dark-mode .post .meta {
    color: #a0aec0;
}

.post p {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

body.dark-mode .post p {
    color: #a0aec0;
}

.read-more {
    color: #63b3ed;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #4299e1;
    text-decoration: underline;
}

/* Sidebar */
.sidebar {
    flex: 1;
    background-color: #e3f0fa;
    padding: 20px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

body.dark-mode .sidebar {
    background-color: #2d3748;
}

.widget {
    margin-bottom: 30px;
}

.widget h3 {
    font-size: 20px;
    color: #2c5282;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

body.dark-mode .widget h3 {
    color: #e2e8f0;
}

.widget ul {
    list-style: none;
}

.widget ul li a {
    color: #4a5568;
    text-decoration: none;
    transition: color 0.3s ease;
}

body.dark-mode .widget ul li a {
    color: #a0aec0;
}

.widget ul li a:hover {
    color: #63b3ed;
}

/* Diet Calculator */
#diet-calculator {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#diet-calculator label {
    font-size: 14px;
    color: #2c5282;
    transition: color 0.3s ease;
}

body.dark-mode #diet-calculator label {
    color: #e2e8f0;
}

#diet-calculator input,
#diet-calculator select {
    padding: 8px;
    border: 1px solid #d3e2f1;
    border-radius: 5px;
    background-color: #fff;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.dark-mode #diet-calculator input,
body.dark-mode #diet-calculator select {
    background-color: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

#diet-calculator button {
    padding: 10px;
    background-color: #63b3ed;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#diet-calculator button:hover {
    background-color: #4299e1;
}

#calorie-result {
    font-size: 14px;
    color: #2c5282;
    transition: color 0.3s ease;
}

body.dark-mode #calorie-result {
    color: #e2e8f0;
}

/* Footer */
footer {
    background-color: #2c5282;
    color: #fff;
    padding: 20px 0;
    transition: background-color 0.3s ease;
}

body.dark-mode footer {
    background-color: #1a202c;
}

.footer-about {
    text-align: center;
    margin-bottom: 15px;
}

.footer-about h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.footer-about p {
    font-size: 14px;
    max-width: 600px;
    margin: 0 auto;
}

.social-links {
    text-align: right;
    margin-right: 20px;
}

.social-links a {
    color: #e3f0fa;
    margin: 0 10px;
    font-size: 20px;
    text-decoration: none;
    transition: color 0.3s ease;
}

body.dark-mode .social-links a {
    color: #a0aec0;
}

.social-links a:hover {
    color: #63b3ed;
}

/* Subfooter */
.subfooter {
    background-color: #1a3a5e;
    color: #e3f0fa;
    text-align: center;
    padding: 10px 0;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

body.dark-mode .subfooter {
    background-color: #0d1219;
    color: #a0aec0;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #63b3ed;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
    background-color: #4299e1;
    transform: scale(1.1);
}

/* Chatbot Toggle Button */
#chatbot-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: #63b3ed;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#chatbot-toggle:hover {
    background-color: #4299e1;
    transform: scale(1.1);
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 140px;
    right: 20px;
    width: 320px;
    height: 400px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

body.dark-mode .chatbot-window {
    background-color: #2d3748;
}

.chatbot-header {
    background-color: #63b3ed;
    color: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
}

#chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #f4f7fa;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

body.dark-mode .chatbot-messages {
    background-color: #4a5568;
}

.chatbot-messages p {
    margin: 8px 0;
    padding: 8px;
    border-radius: 5px;
    max-width: 85%;
    word-wrap: break-word;
}

.chatbot-messages .user-message {
    background-color: #63b3ed;
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
}

.chatbot-messages .bot-message {
    background-color: #e3f0fa;
    color: #333;
}

body.dark-mode .chatbot-messages .bot-message {
    background-color: #718096;
    color: #e2e8f0;
}

.chatbot-input {
    display: flex;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #d3e2f1;
    flex-shrink: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .chatbot-input {
    background-color: #2d3748;
    border-top-color: #718096;
}

#chatbot-input {
    flex: 1;
    padding: 6px;
    border: 1px solid #d3e2f1;
    border-radius: 5px;
    margin-right: 8px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

body.dark-mode #chatbot-input {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

#chatbot-send {
    background-color: #63b3ed;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#chatbot-send:hover {
    background-color: #4299e1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-controls {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .search-bar {
        width: 100%;
        margin-bottom: 10px;
    }

    .nav-toggle-label {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 250px;
        background-color: #e3f0fa;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding-top: 100px;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }

    body.dark-mode .nav-menu {
        background-color: #2d3748;
    }

    .nav-toggle:checked ~ .nav-menu {
        transform: translateX(0);
    }

    .nav-menu .main-menu {
        flex-direction: column;
        gap: 10px;
        padding: 20px;
    }

    .nav-menu .main-menu li a {
        font-size: 18px;
        padding: 10px;
        border-bottom: 1px solid #d3e2f1;
    }

    body.dark-mode .nav-menu .main-menu li a {
        border-bottom-color: #718096;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 20px;
        background-color: #d3e2f1;
    }

    body.dark-mode .dropdown-menu {
        background-color: #4a5568;
    }

    .main-content {
        flex-direction: column;
    }

    .hero h2 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .social-links {
        text-align: center;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 18px;
    }

    .search-bar input {
        width: 100px;
    }

    .chatbot-window {
        width: 280px;
        height: 350px;
        bottom: 100px;
        right: 10px;
    }

    .chatbot-header h3 {
        font-size: 14px;
    }

    #chatbot-input {
        font-size: 12px;
    }
}