/* layout.css - Premium Apple & Vercel Style Layout Architecture & User Health Portal 2026 */

/* 1. Global Reset & Box Protection */
html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary, #f8fafc);
  color: var(--text-primary, #0f172a);
}

/* 2. Container System */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-md, 1rem);
  padding-right: var(--spacing-md, 1rem);
  box-sizing: border-box;
}

@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 1024px) { .container { max-width: 960px; } }
@media (min-width: 1440px) { .container { max-width: 1280px; } }

/* 3. Header & Navbar (Unified Height 70px) */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  z-index: 1000;
  background: var(--glass-bg, rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border, rgba(226, 232, 240, 0.8));
  transition: all 0.3s ease;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  position: relative;
}

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

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--brand-accent, #0284c7);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  margin-bottom: 5px;
  transition: all 0.3s ease;
  border-radius: 2px;
}

@media (max-width: 992px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav-menu {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--surface-color, #ffffff);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-color);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.4s ease-in-out;
    opacity: 0;
    pointer-events: none;
  }

  .nav-menu.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .mobile-menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* 4. Portal Layout System */
.portal-layout {
  display: flex;
  min-height: calc(100vh - 70px);
  margin-top: 70px;
  background: var(--bg-primary, #f8fafc);
}

.portal-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface-color, #ffffff);
  border-left: 1px solid var(--border-color, #e2e8f0);
  padding: 1.75rem 1rem;
  box-shadow: var(--shadow-sm);
}

.portal-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-sidebar li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1.1rem;
  color: var(--text-secondary, #64748b);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 14px;
  transition: all 0.25s ease;
}

.portal-sidebar li a:hover, .portal-sidebar li a.active {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.12) 0%, rgba(2, 132, 199, 0.04) 100%);
  color: var(--brand-accent, #0284c7);
  transform: translateX(-4px);
}

.portal-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* 5. User Hero Banner Card (2026 Digital Health Style) */
.user-hero-card {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #075985 100%);
  color: #ffffff;
  border-radius: 26px;
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 15px 35px -5px rgba(2, 132, 199, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.4s ease-out;
}

.user-hero-card::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.user-hero-info h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  color: #ffffff;
}

.user-hero-info p {
  font-size: 0.98rem;
  opacity: 0.92;
  margin: 0;
  max-width: 520px;
  line-height: 1.6;
}

.user-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.user-hero-btn {
  background: #ffffff;
  color: #0284c7;
  padding: 10px 20px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.user-hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.user-hero-btn.outline {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 6. Health Portal Cards Grid */
.health-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.health-stat-card {
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.health-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-accent, #0284c7);
}

.health-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Responsive Portal Layout */
@media (max-width: 992px) {
  .portal-layout { flex-direction: column; }
  .portal-sidebar { width: 100%; min-width: 100%; border-left: none; border-bottom: 1px solid var(--border-color); }
  .user-hero-card { flex-direction: column; align-items: flex-start; }
}
