/* ================= VARIABLES ================= */

:root{

--primary: #2563eb;
--primary-soft: #60a5fa;

--accent-teal: #14b8a6;
--accent-purple: #8b5cf6;
--accent-pink: #ec4899;

--bg-main: #f6f9ff;
--bg-soft: #f0f9ff;

--card-glass: rgba(255,255,255,0.7);

--text-main: #0f172a;
--text-sub: #475569;

--border: #e2e8f0;

--medical-primary:#0ea5a4;
--medical-blue:#2563eb;
--medical-soft:#06b6d4;

}


/* ================= RESET & BASE ================= */

*{
margin:0;
padding:0;
box-sizing:border-box;
}

html{
scroll-behavior:smooth;
}

body{
font-family: 'Manrope', 'Inter', system-ui, sans-serif;
margin:0;

background:
linear-gradient(120deg,#eef4ff 0%,#f0f9ff 30%,#f5f3ff 60%,#fff7fb 100%);

color: var(--text-main);
position: relative;
}

body::before{
content:"";
position:fixed;
top:0;
left:0;
width:100%;
height:100%;

background:
radial-gradient(circle at 15% 20%, rgba(37,99,235,0.25), transparent 40%),
radial-gradient(circle at 85% 30%, rgba(20,184,166,0.20), transparent 40%),
radial-gradient(circle at 60% 85%, rgba(236,72,153,0.18), transparent 40%);

z-index:-1;
pointer-events:none;
}

body::after{
content:"";
position:fixed;
top:0;
left:0;
width:100%;
height:100%;

background:
radial-gradient(circle at 90% 90%, rgba(139,92,246,0.15), transparent 40%);

z-index:-1;
pointer-events:none;
}

section{
margin-bottom:80px;
}


/* ================= HEADER ================= */

.header{
display:flex;
justify-content:space-between;
align-items:center;
padding:20px 60px;

background: rgba(255,255,255,0.75);
backdrop-filter: blur(12px);

box-shadow:0 2px 12px rgba(0,0,0,0.05);

position: sticky;
top:0;
z-index:100;
}

.logo{
display:flex;
align-items:center;
gap:10px;
font-size:20px;
font-weight:700;
color:var(--text-main);
}

.logo img{
height:36px;
width:auto;
border-radius:100px;
transition:.3s ease;
}

.logo img:hover{
transform:scale(1.05);
}

nav a{
margin-left:25px;
text-decoration:none;
color:#333;
font-size:15px;
}

nav a:hover{
color:#1a73e8;
}


/* ================= HOME ================= */

.home-split{
min-height:90vh;
display:flex;
align-items:center;
justify-content:center;
text-align:center;
padding:40px;
}

.home-center{
max-width:900px;
margin:auto;
}

.home-badge{
display:inline-block;
padding:6px 14px;

background:linear-gradient(135deg,#2563eb,#14b8a6);
color:white;

border-radius:20px;
font-size:12px;
font-weight:600;

margin-bottom:20px;
}

.home-center h1{
font-size:56px;
margin:10px 0;
letter-spacing:-1px;
}

.home-center p{
color:var(--text-sub);
font-size:17px;
margin-bottom:35px;
}

.home-buttons {
  display: flex;                  /* arrange buttons horizontally */
  justify-content: center;        /* center buttons in container */
  gap: 20px;                      /* spacing between buttons */
  flex-wrap: wrap;                /* wrap on smaller screens */
  margin-top: 30px;               /* space from paragraph above */
}

.home-card {
  display: flex;
  flex-direction: column;         /* keep h3 above span */
  align-items: center;            /* center content inside button */
  text-align: center;
  padding: 20px 25px;

  background: rgba(255, 255, 255, 0.7); /* translucent background */
  backdrop-filter: blur(10px);          /* glassmorphism effect */
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.1);   /* subtle border */
  
  color: #2563eb;                      /* heading/main text color */
  text-decoration: none;

  transition: transform 0.25s, box-shadow 0.25s;
  flex: 1 1 200px;                     /* flexible width */
  max-width: 250px;
}

.home-card h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: #2563eb;                       /* heading color */
}

.home-card span {
  font-size: 12px;
  color: #555;                           /* subtitle color */
}

.home-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.home-trust{
margin-top:30px;
font-size:13px;
color:var(--text-sub);
}


/* ================= FEATURES ================= */

.home-features {
  margin-top: 60px;
  padding-top: 20px;

  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.features-text {
  display: flex;                  /* horizontal layout */
  gap: 60px;                      /* spacing between items */
  flex-wrap: wrap;                /* wrap on smaller screens */
  justify-content: center;        /* center items horizontally */
  align-items: flex-start;        /* align text top */
  margin-top: 120px;              /* push section down for central gap */
}

.feature-item h4 {
  font-size: 18px;
  margin: 0 0 6px 0;
  color: #2563eb;
  text-align: center;             /* center heading inside item */
}

.feature-item p {
  margin: 0;
  font-size: 14px;
  color: #555;
  text-align: center;             /* center paragraph inside item */
}

.safety-image {
  display: flex;
  align-items: flex-end;
  margin: 10px auto;
  gap: 10px;
}

/* ================= CALCULATOR SECTION ================= */

.calculator-section {
max-width: 1100px;
margin: 50px auto;
padding: 40px;
border-radius: 16px;
border: 1px solid var(--border);

background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
backdrop-filter: blur(14px);

box-shadow: 
0 10px 30px rgba(0,0,0,0.08),
inset 0 1px 0 rgba(255,255,255,0.6);

text-align: center;
position: relative;
overflow: hidden;
}

.calculator-section::before {
content: "";
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;

background: radial-gradient(circle, rgba(20,184,166,0.05) 10%, transparent 10%);
background-size: 45px 45px;

z-index: 0;
}

.calculator-section * {
position: relative;
z-index: 1;
}

.calculator-section h2 {
font-size: 40px;
font-weight: 800;

background: linear-gradient(90deg, #1e3a8a, #2563eb, #14b8a6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;

margin-bottom: 25px;
}

/* ================= CALCULATOR TITLE ================= */

#calcTitle {
  font-size: 20px;
  font-weight: 600;

  color: #1f2937;   /* dark professional grey */

  margin-bottom: 14px;
  padding-bottom: 8px;

  border-bottom: 1px solid var(--border);

  letter-spacing: 0.3px;
}

/* ================= FORMULA TEXT ================= */

mjx-container[jax="CHTML"] {

margin:18px 0 26px 0;

font-size:1.4rem !important;
font-weight:600;

color:#0f172a !important;

background:none;
padding:0;
border:none;
box-shadow:none;

}

/* ================= CATEGORY ================= */

.category-block{
margin-bottom:20px;
}

.category-header{
background: linear-gradient(135deg,#4f8cff,#6ee7b7);
color:white;
padding:14px 18px;
border-radius:10px;

cursor:pointer;
font-weight:600;

display:flex;
justify-content:space-between;
align-items:center;

transition:0.3s;
}

.category-header:hover{
transform:translateY(-2px);
box-shadow:0 5px 15px rgba(0,0,0,0.1);
}

.category-content{
display:none;
padding:15px 0;
}

.category-content.active{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
gap:15px;
}

.arrow{
transition:0.3s;
}

.category-header.active .arrow{
transform:rotate(180deg);
}


/* ================= SEARCH ================= */

#searchBar {
width:100%;
max-width:340px;

padding: 12px 16px;
border-radius: 10px;

border: 1px solid var(--border);
background: #ffffff;

font-size: 14px;
margin-bottom: 40px;
}

#searchBar:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}


/* ================= CARD GRID ================= */

.card-container{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
gap:20px;
margin-top:18px;
padding:5px;
}


/* ================= CARD ================= */

.card {

background:rgba(255,255,255,0.85);

backdrop-filter:blur(12px);

border-radius:18px;
padding:24px;

border:1px solid var(--border);

box-shadow:
0 10px 25px rgba(0,0,0,0.06);

transition:0.3s ease;

position:relative;
overflow:hidden;
}

.card::before{
content:"";
position:absolute;
top:0;
left:0;
width:100%;
height:4px;

background:linear-gradient(
90deg,
#2563eb,
#14b8a6,
#8b5cf6
);
}

.card:hover {
transform: translateY(-3px);

box-shadow:
0 18px 35px rgba(0,0,0,0.10),
0 0 0 1px rgba(20,184,166,0.15);
}

.card h3{
font-size:18px;
font-weight:700;
margin-bottom:8px;
}

.card p{
font-size:14px;
color:var(--text-sub);
margin-bottom:14px;
}

.card button{

padding:10px 20px;
border:none;

background:linear-gradient(
135deg,
#2563eb,
#14b8a6
);

color:white;
border-radius:10px;

font-weight:600;
cursor:pointer;

transition:.25s ease;
}

.card button:hover{

transform:translateY(-5px);

background: linear-gradient(135deg, #0f766e, #14b8a6);
box-shadow:0 10px 20px rgba(20,184,166,0.35);

}

.calc-count{
color:#64748b;
font-weight:500;
font-size:13px;
margin-left:6px;
}

.calculator-intro{
color:var(--text-sub);
margin-bottom:30px;
font-size:15px;
}

.btn-calc{

padding:13px 28px;

background:linear-gradient(
135deg,
#2563eb,
#0ea5a4
);

color:white;

border:none;

border-radius:14px;

font-weight:600;

cursor:pointer;

transition:0.25s;

box-shadow:0 8px 18px rgba(37,99,235,0.25);
}

.btn-calc:hover{

transform:translateY(-3px);

box-shadow:
0 14px 28px rgba(37,99,235,0.35);
}

.btn-clear{

padding:13px 24px;

background:#f8fafc;

border:1px solid #e2e8f0;

color:#334155;

border-radius:14px;

font-weight:600;

cursor:pointer;

transition:0.25s;
}

.btn-clear:hover{

background:#f1f5f9;

transform:translateY(-2px);
}

.btn-close{

padding:13px 24px;

background:white;

border:1px solid #e2e8f0;

color:#64748b;

border-radius:14px;

font-weight:600;

cursor:pointer;

transition:0.25s;
}

.btn-close:hover{

transform:translateY(-2px);
background:#f8fafc;
}

/* ================= MODAL ================= */

.modal {
display: none;
position: fixed;

top: 0;
left: 0;

width: 100%;
height: 100%;

background: rgba(15,23,42,0.6);
backdrop-filter: blur(6px);
}

.modal.active {
display: flex;
align-items: flex-start;
justify-content: center;
padding: 80px 20px 200px 20px;
}


/* ================= MODAL CONTENT ================= */

.modal-content {

background: linear-gradient(135deg, #ffffff, #f8fafc);

padding: 25px;
width: 90%;
max-width: 480px;

max-height: 90vh;
overflow-y: auto;

border-radius: 12px;
border: 1px solid var(--border);

box-shadow: 
0 12px 30px rgba(0,0,0,0.2),
inset 0 1px 0 rgba(255,255,255,0.7);

text-align: center;
}


/* ================= CLOSE ================= */

.close {
float: right;
font-size: 24px;
cursor: pointer;
color: var(--text-sub);
}


/* ================= CALCULATOR UI ================= */

.calc-body {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  padding-top: 22px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
}

.inputs {
  display: grid;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.input-group label {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-sub);
  font-weight: 500;
}

.input-group input{

padding:14px 16px;

border-radius:12px;

border:1px solid #e2e8f0;

background:white;

transition:0.25s;
}

.input-group input:focus{

border-color:#2563eb;

box-shadow:
0 0 0 3px rgba(37,99,235,0.15);
}

.calc-button {
  background: rgba(37, 99, 235, 0.8);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, background 0.25s;
}

.calc-button:hover {
  background: rgba(37, 99, 235, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37,99,235,0.25);
}

/* ================= UNIT SECTION ================= */

.unit-section {
max-width: 950px;
margin: 50px auto;
padding: 35px;
border-radius: 18px;

background: linear-gradient(135deg, #f0f9ff, #ecfeff);
border: 1px solid transparent;

box-shadow: 
0 20px 40px rgba(0,0,0,0.10);

position: relative;
overflow: hidden;
}

.unit-section h2{
font-size:42px;
font-weight:800;
margin-bottom:10px;
}

.unit-section p{
color:var(--text-sub);
margin-bottom:20px;
}

/* ================= UNIT CONVERTER ================= */

.unit-converter{
padding:24px;
border-radius:16px;
border:1px solid var(--border);

background:rgba(255,255,255,0.75);
backdrop-filter:blur(12px);
text-align:center;

margin-bottom:30px;
}

.unit-converter input,
.unit-converter select{
padding:11px 14px;
border:1px solid var(--border);
border-radius:8px;
font-size:14px;
margin:0 8px;
display:inline-block;
}

.unit-converter button{

padding:14px 18px;
min-width:140px;
width:auto;

background:linear-gradient(135deg,#14b8a6);

color:white;

border:none;
border-radius:10px;

font-size:14px;
font-weight:600;
cursor:pointer;

transition:.25s;
margin-top:18px;
}

.unit-converter button:hover{
transform:translateY(-2px);
background:linear-gradient(135deg,#007168,#14b8a6)
}

#conversionResult{

margin-top:20px;

font-weight:600;

color:#0f172a;

}

/* ================= TABLE ================= */

table{

width:820px;
max-width:100%;

margin:30px auto;

border-collapse:collapse;
background:white;

border-radius:12px;
overflow:hidden;

border:1px solid var(--border);

text-align:center;
table-layout:fixed;
}

th{
background:#1e293b;
color:white;
padding:12px;
}

td{
padding:12px;
border-bottom:1px solid #eef1f5;
text-align:center;
vertical-align:middle;
width:50%;
}

tr:nth-child(even){
background:#f9fbfd;
}

/* ================= SAFETY ================= */

.safety{

display:flex;
align-items:center;
justify-content:space-between;

padding:40px 0;
background:#f0f4f9;

margin-top:60px;
}

.safety-text{
max-width:500px;
}

.safety-text h2{
font-size:36px;
margin-bottom:20px;
}

.safety-image img{
width:420px;
border-radius:10px;
}

/* ================= FOOTER ================= */

.footer{

background:#0d1b2a;

display:grid;
grid-template-columns:repeat(auto-fit,minmax(200px,1fr));

gap:30px;
padding:24px;

font-size:14px;
color:#cbd5e1;
}

/* ================= ACCORDION ================= */

.accordion {
  margin-top: 30px;
}

.accordion-header {
  width: 300px;                    /* fixed smaller width */
  max-width: 80%;                  /* responsive on smaller screens */
  margin: 10px 0 10px 40px;               /* center horizontally with spacing */
  padding: 12px 20px;              /* smaller padding for compact look */
  
  background: linear-gradient(
    135deg,
    #2563eb,
    #14b8a6
  );
  
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;                 /* smaller text for compact look */
  text-align: left;                /* keep text left-aligned */
  transition: transform 0.25s, box-shadow 0.25s;
}

.accordion-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease;
}

.accordion-item.active .accordion-content {
  opacity: 1;
}

/* ================= MOLECULAR ================= */

.molecular-section{

max-width:950px;
margin:50px auto;
padding:35px;

border-radius:18px;

background: linear-gradient(135deg, #f0f9ff, #ecfeff);

border:1px solid transparent;

box-shadow:
0 20px 40px rgba(0,0,0,0.10);

text-align:center;

}


/* Header styling same as previous sections */

.molecular-section h2{

font-size:42px;
font-weight:800;
margin-bottom:10px;

}

.molecular-section p{

color:var(--text-sub);
margin-bottom:25px;

}


.molecular-box{

background:rgba(255,255,255,0.75);

backdrop-filter:blur(12px);

padding:24px;

border-radius:16px;

border:1px solid var(--border);

margin-top:20px;

}


.molecular-box label{

display:block;

margin-bottom:8px;

font-weight:500;

color:var(--text-sub);

}


.molecular-box input{

width:100%;

padding:11px 14px;

border-radius:8px;

border:1px solid var(--border);

margin-bottom:18px;

font-size:14px;

}


.calc-btn{

padding:14px 18px;

min-width:140px;
width:auto;

background:linear-gradient(
135deg,#14b8a6
);

color:white;

border:none;

border-radius:10px;

cursor:pointer;

font-size:14px;
font-weight:600;

margin-top:12px;

transition:.25s;

}

.calc-btn:hover{

transform:translateY(-2px);

background:linear-gradient(135deg,#007168,#14b8a6);

}


/* Result styling */

#mwResult{

margin-top:20px;

padding:12px;

background:rgba(255,255,255,0.85);

border-radius:10px;

border:1px solid var(--border);

font-weight:600;

min-width:200px;

}

/* ================= NAV BUTTONS ================= */

.section-nav{
display:flex;
justify-content:space-between;
margin-bottom:20px;
gap:10px;
flex-wrap:wrap;
}

.nav-btn{

padding:12px 22px;

background:linear-gradient(
135deg,
#2563eb,
#14b8a6
);

color:white;

border:none;
border-radius:10px;

font-weight:600;
cursor:pointer;

transition:0.25s ease;
}

.nav-btn:hover{

transform:translateY(-2px);
background: linear-gradient(135deg, #0f766e, #14b8a6);

box-shadow:
0 8px 18px rgba(37,99,235,0.35);

}


/* ================= MODAL ACTION BUTTONS ================= */

.actions{
display:flex;
gap:10px;
justify-content:center;
margin-top:20px;
flex-wrap:wrap;
}

.actions button{

padding:11px 20px;

color:white;

border:none;
border-radius:10px;

cursor:pointer;
font-weight:600;

transition:.25s;
letter-spacing:0.2px;
}


/* Calculate Button — Green */

.actions button:nth-child(1){

background:linear-gradient(
135deg,
#007168, 
#14b8a6);

}

.actions button:nth-child(1):hover{

transform:translateY(-2px);

box-shadow:
0 8px 18px rgba(16,185,129,0.35);

}


/* Clear Button — Blue */

.actions button:nth-child(2){

background:linear-gradient(
135deg,
#00277f, 
#14b8a6
);

}

.actions button:nth-child(2):hover{

transform:translateY(-2px);

box-shadow:
0 8px 18px rgba(245,158,11,0.35);

}


/* Close Button — Soft Medical Red */

.actions button:nth-child(3){

background:linear-gradient(
135deg,
#b30000,
#ef4444
);

}

.actions button:nth-child(3):hover{

transform:translateY(-2px);

box-shadow:
0 8px 18px rgba(239,68,68,0.35);

}

/* ================= RESPONSIVE ================= */

@media (max-width:768px){

.header{
flex-direction:column;
padding:14px 18px;
}

.home-center h1{
font-size:36px;
}

.safety{
flex-direction:column;
text-align:center;
}

.card-container{
grid-template-columns:1fr;
}

.footer{
grid-template-columns:1fr;
}

}
