/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* CSS Variables for theme colors, radii, icons, etc. */
:root {
    /* Basic colors  */
    --transition-smooth: all 0.5s ease-in-out;
    --cl-background: #ffffff;
    --cl-bgopacity1: hsl(0, 0%, 110%);
    --cl-bgopacity: rgba(255, 255, 255, 0.192);
    --cl-primary: #ffffff;
    --cl-prim-dark: #f1ecec;
    --cl-secondary: #007BFF;
    --cl-sec-light: #e0f0ff;
    --cl-sec-dark: #0056b3;
    --cl-card-h3: #999983;
    --cl-orange: #ff8000;
    --cl-green: #008000;
    --cl-red: #ff0000;
    --cl-text: #2c3e50;
    --cl-shadow: rgba(0, 0, 0, 0.2);
    --cl-shadow1: rgba(0, 0, 0, 0.5);
    --cl-shadow2: rgba(0, 0, 0, 0.09);

    /* Border radius */
    --radius-circle: 50%;
    --card-radius: 2rem;
    --radius-1: 0.4rem;
    --radius-2: 0.8rem;
    --radius-3: 1.2rem;

    /* Icon size */
    --icon-sm: 0.5rem;
    --icon-md: 1.5rem;
    --icon-lg: 2rem;

    /* Others */
    --box-shadow: 0.05rem 0.1rem 1.5rem var(--cl-shadow);
    --box-shadow-reverse: -0.05rem -0.1rem var(--cl-bgopacity);
    --box-shadow1: -0.1rem 0.1rem 1.5rem var(--cl-shadow);
    --box-shadow2: 0.05rem 0.1rem 1.5rem var(--cl-shadow1);
    --card-padding: 1.5rem;
    --bgopacity: 0.5;
}

/* Dark mode overrides */
body.dark-mode {
    --cl-background: #272424;
    --cl-bgopacity: hsl(0, 0%, 21%);
    --cl-primary: #ffffff;
    --cl-prim-dark: #3f3e3e;
    --cl-secondary: #007BFF;
    --cl-sec-light: #e0f0ff;
    --cl-sec-dark: #0056b3;
    --cl-card-h3: #999983;
    --cl-orange: #ff8000;
    --cl-green: #008000;
    --cl-red: #ff0000;
    --cl-text: #ffffff;
    --cl-shadow: rgba(0, 0, 0, 0.8);
}

/* Base font size */
html {
    font-size: 13px;
}

/* Body styles */
body {
    width: 100vw;
    background: var(--cl-background);
    color: var(--cl-text);
    user-select: none;
    list-style: none;
}

/* Anchor styles */
a {
    text-decoration: none;
    color: var(--cl-secondary);
}

/* Image styles */
img {
    width: 100vw;
    display: block;
}

/* Icon styles */
i {
    font-size: 1.32rem;
}

/* Heading styles */
h1 {
    font-size: 1.8rem;
    font-weight: 800;
}

h2 {
    font-size: 1.4rem;
    color: var(--cl-secondary);
}

h3 {
    font-size: 1.0rem;
}

/* Profile photo styles */
.profile-photo {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-circle);
    object-fit: cover;
    overflow: hidden;
}

/* Utility classes */
.text-muted {
    color: var(--cl-green);
    font-size: 0.9rem;
    font-weight: bold;
}

.good {
    color: var(--cl-sec-dark);
}

.danger {
    color: var(--cl-red);
}

/* Layout: Main container grid */
.container {
    display: grid;
    height: 100vh;
    width: 100%;
    grid-template-columns: 17rem auto;
    transition: var(--transition-smooth);
}

/* Sidebar navigation styles */
nav {
    height: 100dvh;
    text-align: center;
    display: flex;
    position: relative;
    flex-direction: column;
    gap: 2rem;
    box-shadow: var(--box-shadow);
    position: relative;
}

nav > .vitalgo-id img {
    width: 95%;
    height: auto;
    margin: 1rem auto;
    border-radius: var(--radius-2);
}
nav #motto{
    position: fixed;
    width: 17rem;
    text-align: center;
}

/* Mobile sidebar hidden by default */
.aside1 {
    display: none;
    overflow: hidden;
}

/* Sidebar open/close icons */
#close, #open {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.5rem;
    color: var(--cl-sec-dark);
    top: 1vh;
    position: absolute;
    right: 0.5rem;
    display: none;
    cursor: pointer;
}

/* Sidebar links */
.linkpages {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-left: 2.22rem;
    gap: 1rem;
    overflow-y: scroll;
}

.linkpages i {
    font-size: 1.32rem;
    margin-right: 1rem;
}

.linkpages a, .linkpages1 a {
    color: var(--cl-secondary);
    display: block;
    width: 14.5rem;
    background: transparent;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: var(--radius-1);
    transition: var(--transition-smooth);
}

/* Active and hover states for sidebar links */
.linkpages a.active, .linkpages1 a.active {
    background: var(--cl-secondary);
    color: var(--cl-primary);
    margin-left: -0.52rem;
    border-radius: var(--radius-1);
    padding: 0.6rem 1rem;
    box-shadow: var(--box-shadow);
}

.linkpages a:hover, .linkpages1 a:hover {
    background: var(--cl-secondary);
    color: var(--cl-primary);
    margin-left: -0.52rem;
    box-shadow: var(--box-shadow);
}

/* Sidebar footer */
.nav-footer {
    width: 100%;
    position: absolute;
    display: flex;
    justify-content: space-between;
    bottom: 2rem;
    padding: 0 0.97rem;
}

/* Main content area */
main {
    width: auto;
    padding-left: min(5%, 1.23rem);
    overflow-y: auto;
}

/* Header bar styles */
.header {
    width: 98%;
    height: 10vh;
    border-radius: var(--radius-2);
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 1.3rem auto;
    align-items: center;
    gap: 5rem;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

/* Search bar styles */
.search-bar input {
    width: 41.32rem;
    position: relative;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    height: 5vh;
    margin-left: 1rem;
    padding-left: 1.87rem;
    border-radius: var(--radius-2);
    background: var(--cl-prim-dark);
    color: var(--cl-text);
    border: none;
}

.search-bar i {
    position: absolute;
    top: 40%;
    left: 1.5rem;
    z-index: 1;
}

/* User menu styles */
.user-menu {
    width: 30%;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    text-align: right;
    margin: auto 1.5rem;
    gap: 2rem;
    justify-content: safe;
}

.user-menu .togglemenu {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cl-prim-dark);
    gap: 0.28rem;
    padding: 0.28rem 0.28rem;
    border-radius: var(--radius-1);
}

/* Active mode icon */
.active-mode {
    background: var(--cl-secondary);
    color: var(--cl-primary);
    border-radius: var(--radius-1);
    padding: 0.28rem 0.28rem;
}

/* AI floating icon */
#vg-ai {
    font-size: 30px;
    display: inline-block;
    position: absolute;
    top: 85dvh;
    left: 85vw;
    width: 60px;
    height: 60px;
    padding: 8px 10px;
    border-radius: var(--radius-circle);
    background: var(--cl-prim-dark);
    box-shadow: var(--box-shadow-reverse);
}

#vg-ai:hover {
    background: var(--cl-primary);
    box-shadow: var(--box-shadow1);
}

/* Dashboard card styles */
.dashboard {
    border-radius: var(--radius-3);
    box-shadow: var(--box-shadow1);
    padding-top: 1.1rem;
    padding-bottom: 1rem;
    margin: 1.8rem auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    margin: 2.26rem auto;
    gap: 2.22rem;
}

.dashHeader-right {
    text-align: center;
}

/* Stats grid for dashboard */
.stats-grids{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: space-between;
    align-items: center;
    margin: 1rem 5rem;
    column-gap: 3rem;
}

/* Stat card styles */
.stat-card {
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: var(--box-shadow);
    border-radius: var(--radius-2);
    margin-top: 1.2rem;
    padding: 1rem 1rem;
    gap: 1.2rem;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    margin-left: -1.1rem;
    scale: 1.1;
    box-shadow: none;
    border: 0.2rem inset var(--cl-prim-dark)
}

.stat-icon {
    width: 4rem;
    height: 4rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-1);
}

.stat-icon i, .pd-icon i {
    font-size: 2.2rem;
}

.stat-details {
    line-height: 1.6;
}

.stat-details h3 {
    color: var(--cl-card-h3);
    font-size: 0.9rem;
    font-weight: 800;
}

.stat-details h2 {
    color: var(--cl-text);
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-footer {
    position: absolute;
    background: var(--cl-secondary);
    padding: 0.2rem 0.2rem;
    border-radius: var(--radius-1);
    right: 1rem;
    bottom: 1rem;
}

.stat-footer a {
    color: var(--cl-sec-light);
}

/* Animation classes */
.slide-in {
    animation: slideIn 0.5s ease-in-out;
}

.slide-out {
    animation: slideOut 0.5s ease-in-out;
}

/* Patient uploaded details grid */
.pd {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    width: 95%;
    margin: 3rem auto;
    border-top: 0.3rem inset var(--cl-bgopacity);
    border-radius: var(--radius-2);
    padding-top: 2rem;
}

/* Dashboard container for patient details */
.dashboard-container {
    background: var(--cl-background);
    border-radius: var(--radius-2);
    padding: 0.5rem;
    border: 0.2rem solid var(--cl-shadow);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Grid row helpers */
.grid-row {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    padding-top: 0.25rem;
}

.row-2 {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0.5rem;

}

.row-3 {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 0.5rem;
}

/* Card styles for dashboard metrics */
.card {
    background: var(--cl-background);
    border-radius: 1.0rem;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* min-height: 70px; */
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
    width: 100%;
    /* min-width: 0; */
    box-sizing: border-box;
}

.card .text {
    display: flex;
    flex-direction: column;
}

/* Metric number styles */
.number-temp, .number-sugar, .number-bp, .number-o2, .number-lung, .number-weight, .number-heart {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 2px;
}

.number-o2, .number-weight, .number-bp {
    color: #2ab3bd;
}

.number-o2, .number-bp {
    color: #7537bd;
}

.number-heart, .number-lung {
    color: #db4f24;
}

.number-temp, .number-sugar {
    color: #9e1b1b
}

.unit {
    font-size: 20px;
    font-weight: 800;
    color: #9e1b1b;
    margin-bottom: 2px;
}

.label {
    font-size: 1.74rem;
    font-weight: 700;
    color: var(--cl-text);
}

.icon {
    font-size: 45px;
}

.card .icon-group {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

/* Icon color helpers */
.heart2 {
    color: #3c0e57;
    font-size: 2.0rem;
}

.heart {
    color: #d2db4c;
}

.bp {
    color: #b50d23;
}

.o2 {
    color: #ec4f6f;
}

.temp {
    color: red;
}

.lung {
    color: rgb(105, 37, 105);
}

.sugar {
    color: crimson;
}

.weight {
    color: royalblue;
}

.steps {
    color: skyblue
}

/* Summary Card Styles */
.summary-card {
    background: var(--cl-background);
    border-radius: var(--radius-2);
    box-shadow: var(--box-shadow);
    padding: 0.3rem;
    width: 100%;
    color: var(--cl-text);
    border: 0.2rem solid var(--cl-bgopacity);
    margin:0;
    display:flex;
    flex-direction: column;
    max-height: 500px;
    height:100%;
}

.summary-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--cl-secondary);
    text-align: center;
}

.metrics-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.2rem; 
  flex: 1;
  margin-top:-10px;
}

.metric {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius-1);
    background: var(--cl-prim-dark);
    margin: 0;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
    justify-content: space-between;
}

.icon2 {
    font-size: var(--icon-lg);
    margin-right: 1rem;
}

.metric-label {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.metric-value {
    font-weight: 700;
    font-size: 1.2rem;
}

/* Slide in/out animations */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}