:root {
    --primary-color: #00A896;
    --secondary-color: #F0F3F4;
    --accent-color: #FFD166;
    --text-color: #333;
    --bg-color: #FFFFFF;
    --sidebar-bg: #F8F9FA;
    --font-family: 'Montserrat', sans-serif;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.app-container {
    display: flex;
    flex-direction: column; /* Mobile-first: stack content vertically */
}

/* --- Mobile First Styles --- */

/* Hide desktop sidebar on mobile */
.sidebar {
    display: none;
}

/* Mobile Header */
.mobile-header {
    background-color: var(--bg-color);
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #EAECEE;
}
.mobile-header .logo {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

/* Main Content Area */
.main-content {
    width: 100%;
    padding: 1rem;
    /* Add padding at the bottom to avoid being covered by the mobile nav */
    padding-bottom: 100px;
}

.page {
    display: none;
}
.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

header h2 {
    font-size: 1.75rem; /* Slightly smaller for mobile */
    margin-bottom: 0.5rem;
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    border-top: 1px solid #EAECEE;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    padding: 10px 0;
    height: 70px;
}
.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: #888;
    font-size: 0.7rem;
    transition: color 0.3s;
}
.mobile-nav .nav-item:hover {
    color: var(--primary-color);
}
.mobile-nav .nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}
.mobile-nav .nav-item span {
    margin-top: 4px;
}
.mobile-nav .nav-item:first-child, /* Reset emoji size */
.mobile-nav .nav-item {
    font-size: 1.5rem; /* Emoji size */
}
.mobile-nav .nav-item span {
    font-size: 0.7rem; /* Text size */
}

/* Common Card and Accordion Styles (work on all devices) */
.card, .accordion-header {
    background-color: var(--bg-color);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}
#tip-of-the-day-card {
    background: linear-gradient(135deg, #FFD166, #FFB627);
    color: #4a3f1a;
}
.accordion-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.accordion-header::after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}
.accordion-header.active::after {
    transform: rotate(45deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background-color: #fdfdfd;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-top: -1.25rem;
    margin-bottom: 1.25rem;
    padding: 0 1.25rem;
}
.accordion-content h4 {
    color: var(--primary-color);
    margin: 1rem 0 0.5rem 0;
}
.accordion-content ul {
    padding-left: 20px;
}

.routine-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}
.routine-item input {
    width: 20px; height: 20px; margin-right: 1rem;
}


/* --- Tablet and Desktop Styles (min-width: 768px) --- */
@media (min-width: 768px) {
    .app-container {
        flex-direction: row; /* Switch back to horizontal layout */
    }
    
    /* Hide mobile nav and header on desktop */
    .mobile-nav, .mobile-header {
        display: none;
    }

    /* Show and style the desktop sidebar */
    .sidebar {
        display: flex;
        flex-direction: column;
        width: 240px;
        background-color: var(--sidebar-bg);
        padding: 2rem 1rem;
        border-right: 1px solid #EAECEE;
    }
    .logo {
        text-align: center;
        margin-bottom: 2rem;
    }
    .sidebar .nav-list {
        list-style: none;
    }
    .sidebar .nav-item {
        padding: 1rem;
        border-radius: var(--border-radius);
        cursor: pointer;
        transition: background-color 0.3s, color 0.3s;
        font-weight: 600;
    }
    .sidebar .nav-item:hover {
        background-color: #e0e6e8;
    }
    .sidebar .nav-item.active {
        background-color: var(--primary-color);
        color: white;
    }

    /* Adjust main content for desktop layout */
    .main-content {
        flex-grow: 1;
        padding: 2rem; /* Restore desktop padding */
        overflow-y: auto;
        height: 100vh;
    }

    header h2 {
        font-size: 2rem; /* Larger titles for desktop */
    }
}