/* ============================================
   MEDMIND AI - PREMIUM HEALTHCARE APPLICATION
   Comprehensive CSS Styling
   ============================================ */

:root {
    --primary-color: #10b981;
    --secondary-color: #06b6d4;
    --accent-color: #8b5cf6;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
}

body.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================
   SPLASH SCREEN
   ============================================ */

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-slow);
    opacity: 1;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-logo {
    margin-bottom: 2rem;
}

.logo-gradient svg {
    width: 80px;
    height: 80px;
    animation: float 3s ease-in-out infinite;
}

.splash-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.splash-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.splash-loader {
    margin-top: 2rem;
}

.loader-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-body {
    overflow: hidden;
}

.auth-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.gradient-blob {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.blob-1 {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    top: -50px;
    right: -50px;
    animation: blob-move 8s ease-in-out infinite;
}

.blob-2 {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    bottom: -50px;
    left: -50px;
    animation: blob-move 8s ease-in-out infinite 4s;
}

@keyframes blob-move {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.dark-mode .auth-card {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(100, 116, 139, 0.3);
}

.auth-card-signup {
    max-width: 480px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.remember-me input {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-color);
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-group input {
    margin-top: 0.25rem;
    cursor: pointer;
}

.divider {
    position: relative;
    margin: 2rem 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 0;
}

.divider span {
    position: relative;
    background: var(--bg-primary);
    padding: 0 1rem;
}

body.dark-mode .divider span {
    background: var(--bg-secondary);
}

.demo-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.demo-note p {
    margin-bottom: 0.25rem;
}

.demo-note code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', monospace;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
    pointer-events: none;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 200px;
}

.nav-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo svg {
    width: 100%;
    height: 100%;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(16, 185, 129, 0.1);
}

.nav-link svg {
    width: 24px;
    height: 24px;
}

.nav-link span {
    font-size: 0.95rem;
    font-weight: 500;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all var(--transition-base);
    cursor: pointer;
    margin-left: auto;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

/* Bottom Navigation for Mobile */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding: 0.5rem 0;
}

body.dark-mode .bottom-nav {
    background: rgba(15, 23, 42, 0.95);
}

.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-align: center;
    transition: all var(--transition-base);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   HOME PAGE
   ============================================ */

.home-header {
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: white;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-greeting h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header-greeting p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 100px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.see-all-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Health Score Section */
.health-score-section {
    margin-bottom: 2rem;
}

.health-score-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.health-score-ring-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
}

.health-score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    stroke: var(--bg-secondary);
    fill: none;
    stroke-width: 4;
}

.score-ring-progress {
    stroke: url(#ringGradient);
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 408.407;
    stroke-dashoffset: 408.407;
    animation: fillRing 1.5s ease-out forwards;
}

@keyframes fillRing {
    to {
        stroke-dashoffset: 0;
    }
}

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

.health-score-value h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.health-score-value p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-score-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.score-detail {
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Quick Stats Grid */
.quick-stats {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-unit {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.stat-trend {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.25rem;
}

.trend-good {
    color: var(--success-color);
}

.trend-stable {
    color: var(--warning-color);
}

.trend-excellent {
    color: var(--success-color);
}

/* Activity Section */
.activity-section {
    margin-bottom: 2rem;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.activity-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.activity-header svg {
    color: var(--primary-color);
}

.activity-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
}

.progress-info {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.progress-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-goal {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width var(--transition-slow);
}

/* Medicines Section */
.medicines-section {
    margin-bottom: 2rem;
}

.medicines-list {
    display: grid;
    gap: 1rem;
}

.medicine-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-base);
}

.medicine-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.medicine-item.taken {
    opacity: 0.6;
    background: var(--bg-secondary);
}

.medicine-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.medicine-info {
    flex: 1;
}

.medicine-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.medicine-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.medicine-action {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.medicine-action:hover {
    transform: scale(1.1);
}

/* Hospitals Section */
.hospitals-section {
    margin-bottom: 2rem;
}

.hospitals-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.hospital-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
}

.hospital-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.hospital-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
}

.hospital-card h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.hospital-distance {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hospital-address {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.hospital-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-badge {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Risk Section */
.risk-section {
    margin-bottom: 2rem;
}

.risk-container {
    display: grid;
    gap: 1rem;
}

.risk-item {
    background: var(--bg-primary);
    border-left: 4px solid;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.risk-low {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.risk-medium {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.05);
}

.risk-high {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.risk-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: currentColor;
}

.risk-item.risk-low .risk-icon {
    color: var(--success-color);
}

.risk-item.risk-medium .risk-icon {
    color: var(--warning-color);
}

.risk-item.risk-high .risk-icon {
    color: var(--danger-color);
}

.risk-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.risk-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Emergency Button */
.fab-emergency {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--danger-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    z-index: 90;
    transition: all var(--transition-base);
    animation: pulse 2s ease-in-out infinite;
}

.fab-emergency:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6); }
}

/* ============================================
   AI PAGE
   ============================================ */

.ai-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-secondary);
    padding-top: 64px;
}

.chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.welcome-section {
    text-align: center;
    padding: 2rem;
}

.welcome-section h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.suggested-prompts h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.prompt-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.prompt-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.prompt-card svg {
    color: var(--primary-color);
    width: 24px;
    height: 24px;
}

.prompt-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.message {
    display: flex;
    margin: 1rem 0;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xl);
    word-wrap: break-word;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.ai-message .message-bubble {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.message-text {
    margin-bottom: 0.25rem;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.chat-input-area {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.chat-form {
    max-width: 1000px;
    margin: 0 auto;
}

.input-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

#chatInput {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.voice-btn,
.send-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    cursor: pointer;
}

.voice-btn:hover,
.send-btn:hover {
    background: var(--primary-color);
    color: white;
}

.voice-btn.listening {
    animation: pulse-voice 1.5s ease-in-out infinite;
}

@keyframes pulse-voice {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-disclaimer {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* ============================================
   MEDICINES PAGE
   ============================================ */

.meds-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 100px;
}

.page-header {
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.adherence-section {
    margin-bottom: 2rem;
}

.adherence-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.adherence-card h2 {
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.adherence-stats {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: center;
}

.adherence-stat {
    position: relative;
}

.stat-circle {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    stroke: var(--bg-secondary);
    fill: none;
    stroke-width: 8;
}

.progress-ring-fill {
    stroke: url(#adherenceGradient);
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    animation: fillRing 1.5s ease-out forwards;
}

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

.stat-value h3 {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.stat-value p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-label {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.adherence-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.detail-icon.taken {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.detail-icon.missed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.detail-icon.streak {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.detail-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail-item h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.active-medicines {
    margin-bottom: 2rem;
}

.medicines-timeline {
    display: grid;
    gap: 1.5rem;
}

.medicine-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.medicine-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.medicine-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.medicine-header h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.medicine-dosage {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.medicine-frequency {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
    color: var(--primary-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
}

.medicine-details {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.detail {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    font-size: 0.9rem;
}

.detail .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail .value {
    color: var(--text-primary);
}

.medicine-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--primary-color);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.action-btn.delete {
    color: var(--danger-color);
}

.action-btn.delete:hover {
    background: var(--danger-color);
    color: white;
}

.schedule-section {
    margin-bottom: 2rem;
}

.schedule-list {
    display: grid;
    gap: 1rem;
}

.schedule-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    gap: 1rem;
    align-items: center;
    transition: all var(--transition-base);
}

.schedule-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.schedule-item.taken {
    opacity: 0.6;
    background: var(--bg-secondary);
}

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

.schedule-medicine h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.schedule-medicine p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.checkbox-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.checkbox-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.history-section {
    margin-bottom: 2rem;
}

.history-list {
    display: grid;
    gap: 1rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp var(--transition-slow);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.modal-content > form,
.modal-content > div:not(.modal-header):not(.modal-close) {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}

.breathing-modal .modal-content {
    max-width: 400px;
}

.breathing-exercise {
    padding: 3rem 2rem;
    text-align: center;
}

.breathing-circle {
    width: 150px;
    height: 150px;
    margin: 2rem auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    animation: breathe 9s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    75% {
        transform: scale(1);
    }
}

.breathing-text h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.breathing-text p {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.exercise-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   MENTAL HEALTH PAGE
   ============================================ */

.mental-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 100px;
}

.wellness-overview {
    margin-bottom: 2rem;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.overview-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.overview-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.mood-selector {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mood-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mood-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.mood-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
    transform: scale(1.2);
}

.mood-label {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stress-meter {
    margin-bottom: 1rem;
}

.stress-indicator {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 6px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: all var(--transition-base);
}

.stress-value {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stress-value span:first-child {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stress-value span:last-child {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stress-label {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.stress-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-secondary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.stress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
}

.stress-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    border: none;
}

.sleep-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sleep-item {
    text-align: center;
}

.sleep-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sleep-item h4 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.sleep-item .unit {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.meditation-section {
    margin-bottom: 2rem;
}

.meditation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.meditation-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-base);
}

.meditation-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.meditation-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.exercise-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.journal-section {
    margin-bottom: 2rem;
}

.journal-entries {
    display: grid;
    gap: 1rem;
}

.journal-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.journal-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.journal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.journal-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
}

.journal-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.journal-mood {
    font-size: 1.5rem;
}

.journal-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.journal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.analytics-section {
    margin-bottom: 2rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.mood-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.5rem;
    height: 150px;
}

.day-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.bar-fill {
    width: 30px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0.5rem;
    transition: all var(--transition-base);
    cursor: pointer;
}

.bar-fill:hover {
    transform: scaleY(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.day-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sleep-chart {
    display: grid;
    gap: 1rem;
}

.sleep-day {
    display: grid;
    grid-template-columns: 30px 1fr 40px;
    gap: 0.75rem;
    align-items: center;
}

.sleep-day .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.sleep-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.sleep-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

.sleep-day .value {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
}

.suggestions-section {
    margin-bottom: 2rem;
}

.suggestions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.suggestion-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.suggestion-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.suggestion-icon {
    font-size: 1.75rem;
    text-align: center;
    line-height: 1;
}

.suggestion-content h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.suggestion-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================
   DOCTOR PAGE
   ============================================ */

.doctor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 100px;
}

.emergency-alert {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.1));
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.alert-content svg {
    color: var(--danger-color);
    flex-shrink: 0;
}

.alert-content h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.alert-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-danger {
    flex-shrink: 0;
}

.search-filter-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.filter-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.emergency-doctors-section {
    margin-bottom: 2rem;
}

.all-doctors-section {
    margin-bottom: 2rem;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doctor-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.doctor-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.doctor-header {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.doctor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.doctor-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.doctor-info h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.doctor-specialty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.doctor-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.stars {
    color: var(--warning-color);
    font-weight: 600;
}

.reviews {
    color: var(--text-tertiary);
}

.emergency-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.doctor-details {
    margin: 1rem 0;
    flex: 1;
}

.doctor-details .detail {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.doctor-details .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.doctor-details .value {
    color: var(--text-primary);
}

.doctor-card .btn {
    margin-top: auto;
}

.appointments-section {
    margin-bottom: 2rem;
}

.appointments-list {
    display: grid;
    gap: 1rem;
}

.appointment-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.appointment-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.appointment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.appointment-header h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.appointment-specialty {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.appointment-status {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.appointment-details {
    margin: 1rem 0;
}

.appointment-details .detail {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.appointment-details .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.appointment-details .value {
    color: var(--text-primary);
}

.appointment-actions {
    display: flex;
    gap: 0.5rem;
}

.appointment-actions .btn {
    flex: 1;
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 100px;
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.profile-header {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.profile-email {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item .stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-item .stat-value.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section > h2 {
    margin-bottom: 1.5rem;
}

.info-grid {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    box-shadow: var(--shadow-sm);
}

.info-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-item p {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.medical-section {
    margin-bottom: 2rem;
}

.medical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.medical-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.medical-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.medical-card h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.medical-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.insurance-section {
    margin-bottom: 2rem;
}

.insurance-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.insurance-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.emergency-section {
    margin-bottom: 2rem;
}

.emergency-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.emergency-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.documents-section {
    margin-bottom: 2rem;
}

.documents-list {
    display: grid;
    gap: 1rem;
}

.document-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    gap: 1rem;
    align-items: center;
    transition: all var(--transition-base);
}

.document-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.document-item svg {
    color: var(--primary-color);
}

.document-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.document-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-list {
    display: grid;
    gap: 1rem;
}

.settings-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.setting-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.setting-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    width: 50px;
    height: 28px;
    background: var(--bg-secondary);
    border-radius: 14px;
    position: relative;
    transition: all var(--transition-base);
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
    left: 24px;
}

.toggle-switch input:checked {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.toggle-switch:has(input:checked) {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.danger-section {
    margin-bottom: 2rem;
}

.danger-list {
    display: grid;
    gap: 1rem;
}

.danger-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.danger-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.danger-info p {
    font-size: 0.8rem;
    color: var(--danger-color);
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: slideInUp var(--transition-base);
    max-width: 350px;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification-message {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 0.75rem;
    }

    .main-content {
        padding: 1.5rem 0.5rem;
        padding-bottom: 120px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .activity-grid {
        grid-template-columns: 1fr;
    }

    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --radius-2xl: 1rem;
    }

    .navbar {
        padding: 0.5rem;
    }

    .nav-container {
        padding: 0.5rem;
    }

    .nav-brand span {
        display: none;
    }

    .nav-logo {
        width: 32px;
        height: 32px;
    }

    .nav-menu {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    .home-header {
        padding: 1.5rem 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .theme-toggle {
        margin-left: 0;
    }

    .main-content {
        padding: 1rem 0.75rem;
        padding-bottom: 120px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .activity-grid {
        grid-template-columns: 1fr;
    }

    .health-score-details {
        grid-template-columns: 1fr;
    }

    .adherence-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .adherence-details {
        grid-template-columns: 1fr;
    }

    .meditation-grid {
        grid-template-columns: 1fr;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .doctors-grid {
        grid-template-columns: 1fr;
    }

    .suggestions-list {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 90vw;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header .btn {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .profile-header {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .insurance-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .emergency-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .message-content {
        max-width: 85%;
    }

    .chat-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .splash-title {
        font-size: 1.5rem;
    }

    .auth-card {
        padding: 1.75rem;
        border-radius: var(--radius-xl);
    }

    .header-greeting h1 {
        font-size: 1.35rem;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .hospital-card {
        padding: 1rem;
    }

    .medicine-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-info h1 {
        font-size: 1.25rem;
    }

    .modal-content {
        border-radius: var(--radius-xl);
    }

    .document-item {
        grid-template-columns: 40px 1fr;
        gap: 0.75rem;
    }

    .document-item svg {
        display: none;
    }
}