<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Medical & Emergency ID | OneQRScan</title>

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap" rel="stylesheet">

<style>
:root {
  --bg-app: #FFFFFF;
  --bg-page: #F1F5F9;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --primary: #2563EB;
  --primary-light: #EFF6FF;
  --success: #059669;
  --success-light: #ECFDF5;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --danger-border: #FCA5A5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --medical: #0D9488; /* Teal for medical */
  --medical-light: #F0FDFA;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-light: #94A3B8;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

h1, h2, h3, h4, .brand-text { font-family: 'Outfit', sans-serif; }

/* ─── APP CONTAINER ─── */
.app-container {
  width: 100%;
  max-width: 480px;
  background: var(--bg-app);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
  overflow-x: hidden;
  padding-bottom: 90px;
}

/* ─── HEADER & COVER (Medical Theme) ─── */
.header-cover {
  height: 140px;
  background: linear-gradient(135deg, #0F766E 0%, #0D9488 100%);
  position: relative;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}
.header-cover::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15) 0%, transparent 40%);
}
.medical-badge-top {
  position: absolute;
  top: 20px; right: 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  display: flex; align-items: center; gap: 6px;
  letter-spacing: 0.5px;
}

/* ─── PROFILE SECTION ─── */
.profile-section {
  padding: 0 24px;
  margin-top: -50px;
  position: relative;
  z-index: 10;
  text-align: center;
}
.avatar-wrap {
  width: 110px; height: 110px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 4px;
  background: var(--bg-app);
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--surface-alt);
  object-fit: cover;
}
.medical-icon-badge {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 32px; height: 32px;
  background: var(--danger);
  border: 3px solid var(--bg-app);
  border-radius: 50%;
  display: grid; place-items: center;
}
.medical-icon-badge svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2.5; }

.profile-name { font-size: 1.6rem; font-weight: 800; color: var(--text-main); margin-bottom: 2px; }
.profile-title { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; margin-bottom: 16px;}

/* ─── EMERGENCY ALERT BANNER ─── */
.alert-banner {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  padding: 16px;
  margin: 0 24px 24px;
  text-align: left;
  display: flex; gap: 12px;
  animation: pulseAlert 2s infinite;
}
@keyframes pulseAlert {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.alert-icon { color: var(--danger); flex-shrink: 0; margin-top: 2px; }
.alert-text h4 { color: var(--danger); font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.alert-text p { color: #7F1D1D; font-size: 0.8rem; font-weight: 500; line-height: 1.4; }

/* ─── QUICK ACTIONS (Big Buttons for Emergency) ─── */
.quick-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 0 24px 32px;
}
.action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-strong);
  padding: 16px 8px; border-radius: 16px; cursor: pointer;
  text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: transform 0.2s, background 0.2s;
}
.action-btn:active { transform: scale(0.97); }
.action-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
}
.action-btn span { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.action-btn p { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.call-family { border-color: rgba(5, 150, 105, 0.3); background: var(--success-light); }
.call-family .action-icon { background: var(--success); color: #fff; }
.call-ambulance { border-color: rgba(220, 38, 38, 0.3); background: var(--danger-light); }
.call-ambulance .action-icon { background: var(--danger); color: #fff; }

/* ─── SECTION STYLES ─── */
.section-wrap { padding: 0 24px; margin-bottom: 24px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.section-head svg { width: 20px; height: 20px; stroke: var(--text-muted); fill: none; }
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }

/* ─── INFO CARDS ─── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.medical-highlight {
  border-color: rgba(13, 148, 136, 0.3);
  background: linear-gradient(180deg, rgba(13,148,136,0.03) 0%, var(--surface) 100%);
}

.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.data-grid.full { grid-template-columns: 1fr; }
.data-item p { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.data-item h4 { font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
.data-item .tag { 
  display: inline-block; padding: 4px 8px; border-radius: 6px; 
  font-size: 0.75rem; font-weight: 600; margin-top: 4px; margin-right: 4px;
}
.tag-red { background: #FEE2E2; color: #B91C1C; }
.tag-blue { background: #DBEAFE; color: #1D4ED8; }
.tag-yellow { background: #FEF3C7; color: #B45309; }

/* Contact List */
.contact-item {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.contact-item:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.contact-info h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
.contact-info p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.contact-call-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary);
  display: grid; place-items: center; text-decoration: none;
  transition: transform 0.2s; flex-shrink: 0;
}
.contact-call-btn:active { transform: scale(0.9); }

/* Address Box */
.address-box { display: flex; gap: 12px; align-items: flex-start; }
.address-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface-alt); display: grid; place-items: center; color: var(--text-muted); flex-shrink: 0;
}
.address-text { font-size: 0.9rem; color: var(--text-main); font-weight: 500; line-height: 1.5; }
.map-link { display: inline-block; margin-top: 8px; font-size: 0.85rem; font-weight: 600; color: var(--primary); text-decoration: none; }

/* ─── STICKY BOTTOM BAR ─── */
.bottom-bar {
  position: fixed; bottom: 0; width: 100%; max-width: 480px;
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 16px 24px 24px;
  display: flex; align-items: center; justify-content: space-between; z-index: 100;
}
.brand-footer { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { width: 24px; height: 24px; background: var(--medical); border-radius: 6px; display: grid; place-items: center; }
.brand-logo svg { width: 14px; height: 14px; fill: #fff; }
.brand-text { font-size: 1.1rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; }
.brand-text span { color: var(--medical); }

.btn-primary {
  background: var(--text-main); color: #fff; border: none; border-radius: 12px;
  padding: 12px 20px; font-weight: 600; font-size: 0.9rem; font-family: 'Inter', sans-serif;
  display: flex; align-items: center; gap: 8px; cursor: pointer; transition: transform 0.2s;
}
.btn-primary:active { transform: scale(0.96); }

/* Animation Classes */
.fade-up { opacity: 0; transform: translateY(20px); animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* Toast */
#toast {
  visibility: hidden; min-width: 250px; background-color: var(--text-main); color: #fff;
  text-align: center; border-radius: 10px; padding: 12px; position: fixed; z-index: 1000; left: 50%; bottom: 100px;
  transform: translateX(-50%); font-size: 0.85rem; font-weight: 500; box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
#toast.show { visibility: visible; animation: fadein 0.3s, fadeout 0.3s 2.5s; }
@keyframes fadein { from { bottom: 80px; opacity: 0; } to { bottom: 100px; opacity: 1; } }
@keyframes fadeout { from { bottom: 100px; opacity: 1; } to { bottom: 80px; opacity: 0; } }
</style>
</head>
<body>

<div class="app-container">
  
  <div class="header-cover">
    <div class="medical-badge-top">
      <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
      Medical ID
    </div>
  </div>

  <div class="profile-section fade-up">
    <div class="avatar-wrap">
      <img src="../elder.png" alt="Profile Photo" class="avatar">
      <div class="medical-icon-badge">
        <svg viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
      </div>
    </div>
    <h1 class="profile-name">Saraswathi- R.</h1>
    <p class="profile-title">78 Years Old • Male • Blood: <strong>O+</strong></p>
  </div>

  <div class="alert-banner fade-up delay-1">
    <div class="alert-icon">
      <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>
    </div>
    <div class="alert-text">
      <h4>If I am lost or confused</h4>
      <p>I am a diagnosed Dementia patient. I may not remember my address. Please call my son immediately and keep me safe.</p>
    </div>
  </div>

  <div class="quick-actions fade-up delay-1">
    <a href="tel:+919876543210" class="action-btn call-family">
      <div class="action-icon">
        <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.59a2 2 0 0 1 2-2.18h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 8.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
      </div>
      <span>Call Son</span>
      <p>Primary Contact</p>
    </a>
    <a href="tel:108" class="action-btn call-ambulance">
      <div class="action-icon">
        <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="3" width="15" height="13" rx="2" ry="2"/><path d="M16 8h4l3 3v5h-7V8z"/><circle cx="5.5" cy="18.5" r="2.5"/><circle cx="16.5" cy="18.5" r="2.5"/><line x1="8.5" y1="9.5" x2="8.5" y2="10.5"/><line x1="8.5" y1="9.5" x2="8.5" y2="10.5"/></svg>
      </div>
      <span>Call Ambulance</span>
      <p>Dial 108 / 112</p>
    </a>
  </div>

  <div class="section-wrap fade-up delay-2">
    <div class="section-head">
      <svg viewBox="0 0 24 24"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
      <h2 class="section-title">Medical Profile</h2>
    </div>

    <div class="info-card medical-highlight">
      <div class="data-grid full" style="margin-bottom: 16px;">
        <div class="data-item">
          <p>Primary Conditions</p>
          <span class="tag tag-red">Alzheimer's / Dementia</span>
          <span class="tag tag-blue">Hypertension (BP)</span>
        </div>
      </div>
      <div class="data-grid">
        <div class="data-item">
          <p>Blood Group</p>
          <h4 style="color: var(--danger); font-size: 1.2rem;">O Positive</h4>
        </div>
        <div class="data-item">
          <p>Known Allergies</p>
          <h4>Penicillin, Peanuts</h4>
        </div>
        <div class="data-item">
          <p>Hearing/Vision</p>
          <h4>Uses Hearing Aid</h4>
        </div>
        <div class="data-item">
          <p>Language Spoken</p>
          <h4>Tamil, English</h4>
        </div>
      </div>
    </div>
  </div>

  <div class="section-wrap fade-up delay-3">
    <div class="section-head">
      <svg viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>
      <h2 class="section-title">Emergency Contacts</h2>
    </div>

    <div class="info-card">
      <div class="contact-item">
        <div class="contact-info">
          <h4>Karthik R.</h4>
          <p>Son (Primary)</p>
        </div>
        <a href="tel:+919876543210" class="contact-call-btn" aria-label="Call Karthik">
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.59a2 2 0 0 1 2-2.18h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 8.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
        </a>
      </div>
      <div class="contact-item">
        <div class="contact-info">
          <h4>Priya K.</h4>
          <p>Daughter-in-law</p>
        </div>
        <a href="tel:+919876543211" class="contact-call-btn" aria-label="Call Priya">
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.59a2 2 0 0 1 2-2.18h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 8.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
        </a>
      </div>
      <div class="contact-item">
        <div class="contact-info">
          <h4>Dr. Srinivasan</h4>
          <p>Family Doctor</p>
        </div>
        <a href="tel:+914132222222" class="contact-call-btn" aria-label="Call Doctor">
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.59a2 2 0 0 1 2-2.18h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 8.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
        </a>
      </div>
    </div>
  </div>

  <div class="section-wrap fade-up delay-3">
    <div class="section-head">
      <svg viewBox="0 0 24 24"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
      <h2 class="section-title">Home Address</h2>
    </div>

    <div class="info-card">
      <div class="address-box">
        <div class="address-icon">
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
        </div>
        <div>
          <p class="address-text">No. 42, Kamaraj Salai, Lawspet,<br>Puducherry - 605008</p>
          <a href="https://maps.google.com/?q=Lawspet,Puducherry" target="_blank" class="map-link">Open in Google Maps →</a>
        </div>
      </div>
    </div>
  </div>

  <div class="bottom-bar">
    <div>
      <a href="https://oneqrscan.com" class="brand-footer">
        <div class="brand-logo">
          <svg viewBox="0 0 24 24"><path d="M3 3h7v7H3zM14 3h7v7h-7zM3 14h7v7H3zM14 14h3v3h-3zM19 14h2v2h-2zM17 17h2v2h-2zM19 19h2v2h-2zM14 19h2v2h-2z"/></svg>
        </div>
        <span class="brand-text">One<span>QR</span>Scan</span>
      </a>
      <p style="font-size: 0.7rem; color: var(--text-light); font-weight: 500;">Secure Medical ID Profile</p>
    </div>
    <button class="btn-primary" onclick="sendLocation()">
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
      Send Location
    </button>
  </div>

  <div id="toast"></div>

</div>

<script>
// Show Toast message
function showToast(message) {
  var toast = document.getElementById("toast");
  toast.innerText = message;
  toast.className = "show";
  setTimeout(function(){ toast.className = toast.className.replace("show", ""); }, 3000);
}

// Mock function for sending location
function sendLocation() {
  if (navigator.geolocation) {
    showToast("Requesting GPS permission...");
    navigator.geolocation.getCurrentPosition(function(position) {
      const lat = position.coords.latitude.toFixed(4);
      const long = position.coords.longitude.toFixed(4);
      showToast("Current Location (" + lat + ", " + long + ") sent to family.");
    }, function(error) {
      showToast("Unable to get location. Please enable GPS.");
    });
  } else {
    showToast("Geolocation is not supported by this browser.");
  }
}
</script>

</body>
</html>