/* ===== CARDIO+ DESIGN SYSTEM ===== */
:root {
    --primary-blue: #1C549D;
    --primary-blue-dark: #0D2B55;
    --primary-teal: #1DBB9E;
    --primary-teal-light: #E0F7F4;
    --bg-light: #F8F9FA;
    --white: #FFFFFF;
    
    --text-main: #141A29;
    --text-gray: #7A869A;
    --text-gray-light: #C1C7D0;
    
    --red: #FF5E5E;
    --red-light: #FFEDED;
    --purple: #9B51E0;
    --purple-light: #F4E8FF;
    --green: #27AE60;
    --green-light: #EBF7EE;
    --yellow: #F2C94C;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px  ২৪px rgba(28, 84, 157, 0.15);
    
    --border-radius: 16px;
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: #E5E5E5; /* Wrapper background */
    color: var(--text-main);
    display: flex;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* Base Mobile App Container */
.app-container {
    width: 100%;
    max-width: 414px; /* iPhone Max Width */
    height: 100vh;
    background-color: var(--bg-light);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Utilities */
.text-white { color: var(--white); }
.text-primary { color: var(--primary-blue); }
.text-teal { color: var(--primary-teal); }
.text-gray { color: var(--text-gray); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-orange { color: #F2994A; }

.bg-white { background-color: var(--white); }
.bg-teal { background-color: var(--primary-teal); color: white; }
.bg-gray { background-color: #F0F2F5; color: var(--text-main); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }

.flex-align { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.align-start { align-items: flex-start !important; }
.flex-1 { flex: 1; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.inline { display: inline-block; vertical-align: middle; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }

/* Setup Icons */
i { display: inline-block; width: 20px; height: 20px; stroke-width: 2px; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 14px; height: 14px; }
.large-icon { width: 44px; height: 44px; margin-bottom: 12px; }
.huge-icon { width: 64px; height: 64px; }

/* HEADER */
.app-header {
    background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue) 40%, var(--primary-teal) 100%);
    padding: 20px;
    padding-top: 40px; /* Safe area top simulation */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    color: var(--white);
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.logo-area { display: flex; align-items: center; gap: 10px; }
.logo-area h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; margin:0; }
.logo-area h1 span { color: var(--primary-teal); }
.logo-area p { font-size: 9px; opacity: 0.8; font-weight: 600; text-transform: uppercase; margin:0; letter-spacing: 0.5px; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { background: rgba(255,255,255,0.15); border: none; color: white; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; backdrop-filter: blur(4px); }
.premium-badge { background: linear-gradient(90deg, #F2C94C 0%, #F2994A 100%); border: none; color: white; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 4px; cursor: pointer; box-shadow: 0 2px 6px rgba(242, 201, 76, 0.4); }
.premium-badge i { width: 14px; height: 14px; fill: currentColor; }

/* CONTENT & SCREENS */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px; /* Space for nav */
}

.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }

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

/* CARDS */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.status-text-lg { font-size: 14px; font-weight: 800; }

.card.bg-green-alert { background-color: var(--green-light); border-color: rgba(39, 174, 96, 0.3); }
.card.bg-yellow-alert { background-color: #FFFBE6; border-color: rgba(242, 201, 76, 0.4); }
.card.bg-orange-alert { background-color: #FFF2E6; border-color: rgba(242, 153, 74, 0.4); }
.card.bg-red-alert { background-color: var(--red-light); border-color: rgba(255, 94, 94, 0.3); }

/* HISTORY LIST ITEMS */
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: white; border-radius: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--text-gray-light); }
.history-item.bd-green { border-left-color: var(--green); }
.history-item.bd-yellow { border-left-color: var(--yellow); }
.history-item.bd-orange { border-left-color: #F2994A; }
.history-item.bd-red { border-left-color: var(--red); }
.history-item.bd-purple { border-left-color: var(--purple); }
.history-date { font-size: 12px; color: var(--text-gray); }
.history-type { font-weight: 700; color: var(--primary-blue-dark); font-size: 14px; margin-bottom:2px;}
.history-val { font-size: 16px; font-weight: 900; padding: 4px 12px; border-radius: 8px; }

/* HOME SCREEN */
.date-greeting { margin-bottom: 20px; }
.date-greeting .date { font-size: 12px; color: var(--text-gray); font-weight: 500; margin-bottom: 4px; }
.date-greeting h2 { font-size: 24px; font-weight: 700; color: var(--primary-blue-dark); }

.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.card.full-width { grid-column: 1 / -1; }

.card-header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-gray); margin-bottom: 10px; }
.card-value { display: flex; align-items:baseline; gap: 4px; }
.card-value h3 { font-size: 22px; font-weight: 800; color: var(--text-main); }
.card-value span { font-size: 12px; color: var(--text-gray); font-weight: 500; }

.icon-wrapper { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.icon-wrapper i { width: 16px; height: 16px; }
.icon-wrapper.blue { background-color: #E8F0FE; color: var(--primary-blue); }
.icon-wrapper.light-blue { background-color: #E6F7FF; color: #1890FF; }
.icon-wrapper.purple { background-color: var(--purple-light); color: var(--purple); }
.icon-wrapper.light-red { background-color: var(--red-light); color: var(--red); }
.icon-wrapper.light-green { background-color: var(--green-light); color: var(--green); }

.medicine-placeholder { text-align: center; padding: 20px; margin-bottom: 16px; }
.border-dashed { border: 2px dashed #E0E4EB; background: transparent; box-shadow: none; }
.medicine-placeholder p { font-size: 13px; color: var(--text-gray); margin: 8px 0; }
.text-link { color: var(--primary-blue); background: none; border: none; font-weight: 600; font-size: 13px; cursor: pointer; }

/* WATER WIDGET */
.water-widget { background: linear-gradient(to right, #F0FBF9, #E0F7F4); border: 1px solid rgba(29, 187, 158, 0.2); }
.icon-btn-small { width: 28px; height: 28px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn-small i { width: 16px; height: 16px; }
.water-progress-text { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; margin-bottom: 8px; }
.water-progress-text h3 { font-size: 24px; font-weight: 800; color: var(--primary-blue-dark); }
.water-progress-text span { font-size: 14px; color: var(--text-gray); font-weight: 500; }
.progress-bar-bg { width: 100%; height: 8px; background-color: white; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary-teal); border-radius: 4px; transition: width 0.4s ease; }
.progress-hint { font-size: 11px; color: var(--text-gray); margin-top: 8px; font-weight: 500;}

/* BUTTONS */
.btn-primary { width: 100%; padding: 16px; border-radius: var(--border-radius); background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-teal) 100%); color: white; border: none; font-size: 16px; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; box-shadow: var(--shadow-md); transition: transform 0.1s; }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { background: var(--primary-blue); color: white; border: none; padding: 12px 20px; border-radius: 12px; font-weight: 600; cursor: pointer; border-radius: 12px; }
.btn-secondary.small { padding: 8px 14px; font-size: 13px; display:flex; gap:4px; align-items:center; }
.btn-secondary.small i { width: 14px; height: 14px; }
.btn-white { background: white; border: none; border-radius: 8px; padding: 12px; font-weight: 600; color: var(--primary-blue-dark); width: 100%; cursor: pointer;}
.btn-white.outline { border: 1px solid #E0E4EB; color: var(--primary-blue); }

.disclaimer { font-size: 10px; color: var(--text-gray-light); text-align: center; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.disclaimer i { width: 12px; height: 12px; }

/* HEALTH SCREEN */
.screen-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.screen-header h2 { font-size: 22px; color: var(--primary-blue-dark); }
.tabs { display: flex; gap: 8px; background: white; padding: 4px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.tab { flex: 1; border: none; background: transparent; padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--text-gray); border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 6px; transition: 0.2s; }
.tab.active { background: var(--primary-blue); color: white; box-shadow: 0 4px 10px rgba(28, 84, 157, 0.3); }

.chart-filters { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.filter-group { display: flex; background: #F0F2F5; border-radius: 20px; padding: 2px; }
.filter { border: none; background: transparent; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 600; color: var(--text-gray); cursor: pointer; }
.filter.active { background: var(--primary-blue); color: white; }
.empty-state-chart { height: 150px; display: flex; align-items: center; justify-content: center; color: var(--text-gray-light); font-size: 13px; border: 1px dashed #E0E4EB; border-radius: 12px; }
.section-title { font-size: 16px; color: var(--primary-blue-dark); margin: 24px 0 12px 0; font-weight: 700; }

.empty-history { text-align: center; padding: 30px 20px; }
.red-outline { color: var(--red); opacity: 0.5; stroke-width: 1px; }
.gray-outline { color: var(--text-gray); opacity: 0.5; stroke-width: 1px; }

/* WATER SCREEN */
.water-circle-container { display: flex; flex-direction: column; align-items: center; margin-top: 20px; }
.water-circle { width: 180px; height: 180px; border-radius: 50%; background: conic-gradient(var(--primary-teal) 0%, #E0F7F4 0%); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: inset 0 0 20px rgba(0,0,0,0.05); }
.water-circle::before { content: ''; position: absolute; width: 140px; height: 140px; background: var(--bg-light); border-radius: 50%; box-shadow: var(--shadow-md); }
.water-circle-inner { position: relative; z-index: 2; }
.water-circle-inner h2 { font-size: 32px; font-weight: 800; color: var(--primary-blue-dark); margin:0; }
.water-total h1 { font-size: 28px; font-weight: 800; color: var(--text-main); }

.quick-add-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; /* Hide scrollbar below */ -ms-overflow-style: none; scrollbar-width: none; }
.quick-add-grid::-webkit-scrollbar { display: none; }
.quick-btn { flex: 0 0 auto; background: white; border: 1px solid rgba(29, 187, 158, 0.3); color: var(--primary-teal); font-weight: 600; padding: 10px 16px; border-radius: 20px; font-size: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: 0.1s;}
.quick-btn:active { background: var(--primary-teal-light); transform: scale(0.95); }

.manual-add-card { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.border-radius { border-radius: 12px; }
.no-glow { box-shadow: none; width: 36px; height: 36px; padding: 0;}

/* MEDICINE & MODALS */
.premium-banner { background: var(--primary-blue); color: white; padding: 16px; border-radius: var(--border-radius); box-shadow: var(--shadow-md); }
.premium-banner h4 { font-size: 15px; margin-bottom: 4px; }
.premium-banner p { font-size: 12px; opacity: 0.8; line-height: 1.4; }
.icon-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.medicine-item { box-shadow: var(--shadow-sm); border-radius: 12px; padding: 16px; background: white; margin-bottom: 12px; border-left: 4px solid var(--primary-teal); display: flex; justify-content: space-between; align-items: center; }
.medicine-name { font-weight: 700; font-size: 16px; color: var(--primary-blue-dark); margin-bottom: 4px; }
.medicine-dose { font-size: 13px; color: var(--text-gray); }
.med-time-pill { background: var(--primary-teal-light); color: var(--primary-teal); padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; margin-right: 4px;}

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 100; display: flex; justify-content: center; align-items: flex-end; /* Mobile bottom sheet style */ padding: 16px; opacity: 0; pointer-events: none; transition: 0.3s; }
.modal-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
.hidden { display: none !important; }
.modal-content { background: white; width: 100%; max-width: 414px; border-radius: 24px; padding: 24px; box-shadow: 0 -10px 40px rgba(0,0,0,0.2); transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-overlay:not(.hidden) .modal-content { transform: translateY(0); }

.input-field { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid #E0E4EB; font-family: var(--font-family); font-size: 15px; outline: none; background: #F8F9FA;}
.input-field:focus { border-color: var(--primary-blue); background: white; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-gray); margin-bottom: 8px; }
.time-picker-row { display: flex; gap: 8px; }
.time-input { flex: 1; }
.times-pill-container { min-height: 40px;}
.time-pill-del { cursor:pointer; color: var(--red); opacity:0.7;}

/* ALARM ANIMATION */
.alarm-pulse { animation: redpulse 1.5s infinite alternate; border: 2px solid var(--red); }
@keyframes redpulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 94, 94, 0.4); }
    100% { box-shadow: 0 0 0 20px rgba(255, 94, 94, 0); transform: translateY(0) scale(1.02); }
}

/* EDUCATION SCREEN */
.tags-scroll { display: flex; gap: 8px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; padding-bottom: 4px; }
.tags-scroll::-webkit-scrollbar { display: none; }
.tag { padding: 8px 16px; border-radius: 20px; background: white; border: 1px solid #E0E4EB; font-size: 13px; font-weight: 600; color: var(--text-gray); cursor: pointer; display: flex; align-items:center; gap: 6px; white-space: nowrap; transition: 0.2s;}
.tag.active { background: var(--primary-blue); color: white; border-color: var(--primary-blue); }

.article-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.article-card h4 { font-size: 15px; color: var(--primary-blue-dark); margin-bottom: 4px; }

/* BOTTOM NAVIGATION */
.bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 10px 24px 10px; /* Extra bottom padding for iOS bar */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    z-index: 10;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-gray-light);
    cursor: pointer;
    transition: 0.3s ease;
    width: 20%;
}

.nav-item i { width: 22px; height: 22px; transition: 0.3s; stroke-width: 2px;}
.nav-item span { font-size: 10px; font-weight: 600; transition: 0.3s; }

.nav-item.active { color: var(--primary-blue); }
.nav-item.active i { transform: translateY(-4px) scale(1.1); stroke-width: 2.5px;}
.nav-item.active span { transform: translateY(-2px); font-weight: 700; }
