/* Safe Capital Investor Portal — Custom Styles */

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&family=Heebo:wght@300;400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* RTL defaults */
html { direction: rtl; text-align: right; }
body { font-family: 'Inter', sans-serif; }
h1, h2, h3 { font-family: 'Heebo', sans-serif; }

/* Header */
.portal-header {
  position: fixed; top: 0; right: 0; left: 0;
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(27,28,26,0.04);
  z-index: 50;
}
.portal-header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-logo img { height: 2rem; }
.portal-nav-desktop {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.portal-nav-link {
  display: flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 500;
  color: #43474e;
  text-decoration: none;
  transition: all 0.15s;
  position: relative;
}
.portal-nav-link:hover { background: #f5f3f0; color: #022445; }
.portal-nav-link.active { background: rgba(2,36,69,0.08); color: #022445; font-weight: 600; }

.portal-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.portal-logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 0.5rem;
  border: none; background: none; cursor: pointer;
  color: #43474e; transition: all 0.15s;
}
.portal-logout-btn:hover { background: #fef2f2; color: #991b1b; }
.portal-hamburger {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; background: none; cursor: pointer;
  color: #1b1c1a;
}

/* Mobile dropdown menu */
.portal-mobile-menu {
  background: #ffffff;
  padding: 0.5rem;
  box-shadow: 0 8px 24px rgba(27,28,26,0.04);
}
.portal-mobile-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  font-size: 1rem; color: #43474e;
  text-decoration: none; transition: all 0.15s;
}
.portal-mobile-link:hover { background: #f5f3f0; }
.portal-mobile-link.active { background: rgba(2,36,69,0.08); color: #022445; font-weight: 600; }

/* Notification badge */
.notification-badge {
  position: absolute; top: 2px; left: 2px;
  min-width: 18px; height: 18px;
  background: #984349; color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.625rem; font-weight: 700;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.portal-bottom-link .notification-badge {
  position: absolute; top: 0; left: 50%; transform: translateX(2px);
}

/* Footer */
.portal-footer { background: #f5f3f0; }

/* Bottom nav (mobile) */
.portal-bottom-nav {
  position: fixed; bottom: 0; right: 0; left: 0;
  background: #ffffff; z-index: 50;
  display: flex; justify-content: space-around;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 8px rgba(27,28,26,0.04);
}
.portal-bottom-link {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.125rem; padding: 0.375rem 0.75rem;
  color: #74777f; text-decoration: none;
  font-size: 0.625rem; position: relative;
  min-width: 48px; min-height: 48px;
  justify-content: center;
}
.portal-bottom-link.active { color: #022445; }
.portal-bottom-link .material-symbols-outlined { font-size: 1.375rem; }
.portal-bottom-label { font-size: 0.625rem; font-weight: 500; }

/* Status badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 700;
}
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-lightblue { background: #e0f2fe; color: #0369a1; }
.badge-orange { background: #fff7ed; color: #9a3412; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-green { background: #dcfce7; color: #166534; }

/* Metric card */
.metric-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0px 8px 24px rgba(2, 36, 69, 0.04);
  transition: transform 0.3s;
}
.metric-card:hover { transform: translateY(-4px); }
.metric-num {
  font-family: 'Heebo', sans-serif;
  font-weight: 800; font-size: 2.25rem; line-height: 1;
  color: #000e21;
}
.metric-label {
  font-size: 0.8125rem; color: #43474e; margin-top: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif; font-weight: 600;
}

/* Deal card */
.deal-card {
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0px 8px 24px rgba(2, 36, 69, 0.04);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0px 12px 32px rgba(2, 36, 69, 0.06);
}

/* Progress bar */
.progress-track {
  height: 8px; background: #eae8e5; border-radius: 9999px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: #000e21; border-radius: 9999px;
  transition: width 0.6s ease;
}

/* Toast notifications */
.portal-toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: #000e21; color: #fff;
  padding: 0.75rem 1.5rem; border-radius: 1rem;
  font-size: 0.875rem; z-index: 100;
  box-shadow: 0 4px 16px rgba(2,36,69,0.2);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* Form inputs — ring focus */
.portal-input {
  width: 100%; padding: 1rem;
  border: none; border-radius: 0.75rem;
  font-size: 1rem; font-family: 'Heebo', sans-serif;
  background: #eae8e5; transition: all 0.2s;
}
.portal-input:focus {
  outline: none;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 14, 33, 0.2);
}
.portal-input.ltr {
  direction: ltr; font-family: 'Inter', sans-serif;
}

/* Desktop nav visible at lg */
@media (min-width: 1024px) {
  .portal-nav-desktop { display: flex; }
  .portal-hamburger { display: none; }
  .portal-bottom-nav { display: none; }
}

/* Notification list */
.notification-item {
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.notification-item.unread {
  background: #f5f3f0;
  border-right: 3px solid #000e21;
}
.notification-item.read {
  background: #fff;
}
.notification-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  background: #ffffff;
}
.notification-icon.update { background: #ffffff; color: #0369a1; }
.notification-icon.milestone { background: #ffffff; color: #166534; }
.notification-icon.document { background: #ffffff; color: #92400e; }
.notification-icon.financial { background: #ffffff; color: #9d174d; }
.notification-icon.message { background: #ffffff; color: #6d28d9; }

.notification-body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Profile fields */
.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background: #f5f3f0;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: none;
}
.profile-field:last-child { border-bottom: none; }
.profile-field-label {
  color: #43474e; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.profile-field-value { font-weight: 500; }

/* Mobile adjustments */
@media (max-width: 767px) {
  .metric-num { font-size: 1.5rem; }
}
