/* General Styles & Variables */
:root {
    --primary-color: #84C8A2;
    --secondary-color: #F2F2F2;
    --background-color: #FFFFFF;
    --text-color: #333333;
    --card-background: rgba(255, 255, 255, 0.85);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --border-radius: 16px;
    --inter-font: 'Inter', sans-serif;
}

body {
    font-family: var(--inter-font);
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--inter-font);
    font-weight: 700;
    margin-top: 0;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: #5AB084;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 1rem;
}

.cta-button:hover {
    background-color: #5AB084;
    transform: translateY(-2px);
}

.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 8px 20px var(--shadow-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.content-section {
    padding: 80px 0;
}

.section-header {
    margin-bottom: 40px;
}

/* Newspaper-Print Layout */
.main-content {
    column-count: 1;
    column-gap: 30px;
    margin-top: 50px;
}

.content-section.newspaper-column {
    break-inside: avoid-column;
    margin-bottom: 40px;
    padding: 40px 0;
}

.content-section:not(:last-child) {
    border-bottom: 1px solid var(--secondary-color);
}

.content-section:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.98);
    padding-left: 20px;
    padding-right: 20px;
}

.content-section:nth-child(even) {
    background-color: var(--secondary-color);
    padding-left: 20px;
    padding-right: 20px;
}

.content-section:nth-child(1) { column-span: all; margin-top: 0; padding-top: 0; }
.content-section:nth-child(2) { column-span: all; padding-top: 0;}
.content-section:nth-child(3) { column-span: all; padding-top: 0;}
.content-section:nth-child(4) { column-span: all; padding-top: 0;}
.content-section:nth-child(5) { column-span: all; padding-top: 0;}
.content-section:nth-child(6) { column-span: all; padding-top: 0;}


/* Header */
.site-header {
    background-color: var(--background-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s ease;
}

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

/* Hero Section */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 80px 20px;
    color: #FFFFFF;
}

.hero-section video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4); /* Dark overlay for readability */
}

.hero-content {
    max-width: 650px;
    padding: 20px; /* Added padding for better spacing */
}

.hero-section .brand-name {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5); /* Added text shadow */
}

.hero-section .tagline {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5); /* Added text shadow */
}

.hero-section .description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.85;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5); /* Added text shadow */
}

.waveform-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

#heartbeatWaveform {
    display: block;
    width: 100%;
    height: 100%;
}

/* Dashboard Widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.widget {
    text-align: center;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.widget-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.widget-info h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.widget-info .current-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.widget-info .trend {
    font-size: 0.9rem;
    color: #666;
    opacity: 0.8;
}

/* Symptom & Vitals Log */
.symptom-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.symptom-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.symptom-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.symptom-card .card-header h3 {
    font-size: 1.4rem;
    margin-bottom: 0;
}

.symptom-card .add-emoji, .symptom-card .add-vitals {
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.symptom-card .add-emoji:hover, .symptom-card .add-vitals:hover {
    transform: scale(1.1);
}

.emoji-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    justify-items: center;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.emoji-selector span {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

.emoji-selector span:hover {
    transform: scale(1.2);
}

.symptom-details textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    font-family: var(--inter-font);
    font-size: 1rem;
    box-sizing: border-box;
    resize: vertical;
}

.vitals-inputs label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.vitals-inputs input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: var(--inter-font);
    font-size: 1rem;
    box-sizing: border-box;
}

.log-button {
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
}

.log-button:hover {
    background-color: #5AB084;
    transform: translateY(-1px);
}

/* Medication & Appointment Hub */
.schedule-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.schedule-card .card-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--secondary-color);
}

.schedule-card .schedule-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.schedule-card .time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.schedule-card .icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.schedule-card.expanded .card-header .icon {
    transform: rotate(180deg);
}

.schedule-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-top: 0;
}

.schedule-card.expanded .schedule-details {
    max-height: 200px; /* Adjust as needed */
    padding-top: 15px;
}

.schedule-details p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.schedule-details strong {
    color: var(--text-color);
    opacity: 0.8;
}

/* Progress Ring Chart */
.progress-ring-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.progress-ring {
    position: relative;
    width: 200px;
    height: 200px;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Start from top */
}

.progress-ring-background {
    fill: none;
    stroke: var(--secondary-color);
    stroke-width: 12;
}

.progress-ring-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-in-out;
}

.progress-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-center .percentage {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-center p {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

.progress-summary {
    margin-top: 30px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* AI Chat Assistant Widget */
.ai-chat-widget {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px var(--shadow-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 450px;
    margin: 30px auto 0 auto;
    display: flex;
    flex-direction: column;
    height: 450px;
    overflow: hidden;
}

.chat-header {
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.chat-header .avatar {
    font-size: 1.8rem;
    margin-right: 15px;
}

.chat-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
    flex-grow: 1;
}

.chat-header .status {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

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

.message {
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 75%;
    word-wrap: break-word;
}

.message.bot {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border-bottom-left-radius: 0;
    align-self: flex-start;
}

.message.user {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border-bottom-right-radius: 0;
    align-self: flex-end;
}

.message p {
    margin-bottom: 0;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.chat-input-area {
    display: flex;
    padding: 15px 20px;
    background-color: #f8f8f8;
    border-top: 1px solid var(--secondary-color);
}

.chat-input-area input {
    flex-grow: 1;
    border: none;
    background: none;
    padding: 10px;
    font-family: var(--inter-font);
    font-size: 1rem;
    outline: none;
}

.chat-input-area button {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.chat-input-area button:hover {
    background-color: #5AB084;
}

/* Footer */
.site-footer {
    background-color: var(--secondary-color);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid var(--background-color);
}

.site-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.site-footer p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-links a {
    margin: 0 10px;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .main-content {
        column-count: 2;
    }
    .content-section:nth-child(odd) {
        padding-left: 20px;
        padding-right: 10px;
    }
    .content-section:nth-child(even) {
        padding-left: 10px;
        padding-right: 20px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        column-count: 3;
    }
    .content-section {
        padding: 60px 0;
    }
    .hero-section {
        min-height: 70vh;
    }
    .hero-section .brand-name {
        font-size: 4.5rem;
    }
    .hero-section .tagline {
        font-size: 2rem;
    }
    h2 {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        margin-top: 15px;
        display: none; /* Hamburger menu needed for real app */
    }
    .main-nav li {
        margin: 10px 0;
    }
    .hero-section {
        padding: 120px 20px 40px 20px;
    }
    .hero-section .brand-name {
        font-size: 3rem;
    }
    .hero-section .tagline {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 2rem;
    }
    .widget {
        padding: 20px 15px;
    }
    .symptom-card, .vitals-card, .schedule-card {
        min-width: 100%;
    }
    .ai-chat-widget {
        width: 90%;
        margin: 20px auto;
    }
}