:root {
    --primary-color: #1A365D;
    /* Deep professional blue */
    --primary-hover: #2B6CB0;
    --secondary-color: #2D3748;
    --bg-color: #F7FAFC;
    --text-color: #1A202C;
    --text-muted: #4A5568;
    --card-bg: #FFFFFF;
    --border-radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: var(--text-color);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

h1 {
    font-size: 2.8rem;
    text-align: center;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 2rem;
    text-align: center;
    color: var(--secondary-color);
}

p {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius);
    padding: 18px 32px;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    min-height: 60px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn:hover,
.btn:focus {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    outline: none;
}

.btn:focus-visible {
    outline: 4px solid #63B3ED;
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.login-card {
    background-color: var(--card-bg);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-card h1 {
    font-size: 3.2rem;
    background: -webkit-linear-gradient(45deg, var(--primary-color), #4299E1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.login-card p {
    font-size: 1.25rem;
    margin-bottom: 40px;
}

/* Home Page */
.home-header {
    margin-bottom: 40px;
    padding-top: 40px;
}

.home-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    position: relative;
}

.home-header h1 {
    margin-bottom: 0;
    flex-grow: 1;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-logout:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-bottom: 40px;
}

.module-card {
    background-color: var(--card-bg);
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.module-card h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    text-align: left;
    color: var(--secondary-color);
}

.module-card p {
    font-size: 1.15rem;
    margin-bottom: 25px;
}

/* Module View Page */
.module-view-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding-top: 30px;
}

@media (min-width: 768px) {
    .module-view-header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }

    .module-view-header .btn-back {
        width: auto;
        min-width: 140px;
        margin-right: 25px;
    }

    .module-view-header h2 {
        margin-bottom: 0;
        text-align: left;
        font-size: 1.6rem;
    }
}

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

.btn-back:hover,
.btn-back:focus {
    background-color: #4A5568;
}

.pdf-container {
    width: 100%;
    height: 80vh;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background-color: #E2E8F0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Full Screen Module View Overrides */
body.module-view-active {
    overflow: hidden;
    /* Prevent body scroll */
}

body.module-view-active #app {
    max-width: 100%;
    padding: 10px;
    height: 100vh;
}

body.module-view-active .module-view-header {
    padding-top: 0;
    margin-bottom: 15px;
}

body.module-view-active .btn-back {
    margin-right: 0;
    min-height: 50px;
    padding: 10px 24px;
    width: auto;
}

body.module-view-active .pdf-container {
    flex-grow: 1;
    height: auto;
    border-radius: 12px;
}

/* Daily Cognitive Tracker */
.tracker-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border: 2px solid #E2E8F0;
}

.tracker-card h3 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.tracker-card p {
    font-size: 1.15rem;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.tracker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.tracker-item {
    display: flex;
    align-items: center;
    background-color: #EDF2F7;
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tracker-item:hover {
    background-color: #E2E8F0;
}

.tracker-item:focus-within {
    outline: 3px solid var(--primary-hover);
    outline-offset: 2px;
}

.tracker-item input[type="checkbox"] {
    width: 28px;
    height: 28px;
    margin-right: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.tracker-item span {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-color);
}

.tracker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #E2E8F0;
}

#tracker-progress {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.btn-reset {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid #CBD5E0;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background-color: #F7FAFC;
    color: var(--text-color);
    border-color: #A0AEC0;
}