/**
 * Senna Financial Hub - Premium Cream & Teal Design
 * Luxury private markets interface for PE professionals
 * 
 * @package Senna_Messaging
 * @since 4.1.0
 */

/* ============================================
   CSS VARIABLES - Premium Cream & Teal Theme
   ============================================ */
:root {
  /* Typography - Ultra Premium */
  --font-headlines: "Playfair Display", "Didot", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "SF Mono", "Monaco", "Consolas", monospace;

  /* Cream Color Palette */
  --cream-primary: #faf8f3;
  --cream-secondary: #f5f2eb;
  --cream-accent: #ede8de;
  --cream-border: #e8e5dd;

  /* Teal Gradient & Colors */
  --teal-gradient: linear-gradient(135deg, #0d353e 0%, #1a5a65 100%);
  --teal-dark: #0d353e;
  --teal-medium: #1a5a65;
  --teal-light: #2a7a88;

  /* Senna Green */
  --senna-green: #2d7a3d;
  --senna-green-light: #3d9a4d;

  /* Accent Colors */
  --gold-accent: #c9a961;
  --gold-light: #e8d5a7;

  /* Text Colors */
  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-muted: #95a5a6;

  /* System Colors */
  --white: #ffffff;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(13, 53, 62, 0.05);
  --shadow-md: 0 4px 12px rgba(13, 53, 62, 0.08);
  --shadow-lg: 0 8px 24px rgba(13, 53, 62, 0.12);
  --shadow-xl: 0 12px 48px rgba(13, 53, 62, 0.16);
}

/* ============================================
   BASE & RESET
   ============================================ */
.financial-hub-body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--cream-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.financial-hub-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   SENNA NAVIGATION HEADER
   ============================================ */
.fh-nav.senna-header {
  background: var(--white);
  border-bottom: 1px solid var(--cream-border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.fh-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Brand Section */
.fh-brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 200px;
}

.fh-logo {
  font-family: var(--font-headlines);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0;
  letter-spacing: -0.5px;
}

.fh-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Senna Menu */
.senna-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-grow: 1;
  justify-content: center;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--cream-secondary);
  color: var(--teal-dark);
  transform: translateY(-1px);
}

.nav-item.active {
  background: var(--teal-gradient);
  color: var(--white);
}

.nav-item.active .nav-icon {
  stroke: var(--white);
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
}

.nav-counter {
  background: var(--danger);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  margin-left: 0.25rem;
  min-width: 18px;
  text-align: center;
}

/* Senna Quick Prompt */
.senna-quick-prompt {
  flex-shrink: 0;
}

.prompt-container {
  display: flex;
  align-items: center;
  background: var(--cream-secondary);
  border-radius: 20px;
  padding: 0.25rem 0.25rem 0.25rem 1rem;
  border: 1px solid var(--cream-border);
  transition: all 0.3s ease;
}

.prompt-container:focus-within {
  border-color: var(--teal-medium);
  box-shadow: 0 0 0 3px rgba(26, 90, 101, 0.1);
}

.senna-prompt-input {
  border: none;
  background: transparent;
  font-size: 0.875rem;
  width: 200px;
  padding: 0.25rem 0.5rem;
  outline: none;
  color: var(--text-primary);
}

.senna-prompt-input::placeholder {
  color: var(--text-muted);
}

.prompt-submit-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--teal-gradient);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.prompt-submit-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* User Menu */
.fh-user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  background: var(--cream-secondary);
  cursor: pointer;
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  min-width: 150px;
}

.fh-user-menu:hover .user-dropdown {
  display: block;
}

/* ============================================
   USER PROFILE DASHBOARD
   ============================================ */
.user-profile-dashboard {
  margin-bottom: 2rem;
}

.profile-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--cream-border);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cream-border);
}

.profile-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--cream-accent);
}

.profile-info {
  flex-grow: 1;
}

.profile-name {
  font-family: var(--font-headlines);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0 0 0.25rem 0;
}

.profile-title {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

.profile-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.status-text {
  color: var(--success);
  font-weight: 500;
}

/* Profile Button */
.btn-primary {
  background: var(--teal-gradient);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Profile Metrics */
.profile-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--cream-secondary);
  border-radius: 8px;
}

.metric {
  text-align: center;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Actions */
.profile-quick-actions {
  margin-top: 1rem;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.quick-action {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.quick-action:hover {
  background: var(--cream-secondary);
  border-color: var(--teal-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-action svg {
  color: var(--teal-medium);
}

.quick-action span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================
   SENNA CHAT BUBBLE
   ============================================ */
.senna-chat-bubble {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--cream-primary);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  padding: 1rem;
  z-index: 1000;
  max-width: 320px;
  border: 2px solid var(--senna-green);
  animation: slideUp 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.senna-chat-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble-avatar {
  position: absolute;
  top: -20px;
  left: 20px;
}

.senna-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid var(--senna-green);
  object-fit: cover;
  background: var(--white);
}

.bubble-content {
  margin-top: 20px;
}

.bubble-greeting {
  margin-bottom: 1rem;
}

.bubble-greeting p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.bubble-greeting p:first-child {
  font-weight: 600;
  color: var(--teal-dark);
  font-size: 1rem;
}

.bubble-input-container {
  display: flex;
  gap: 0.5rem;
  background: var(--white);
  border-radius: 20px;
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  border: 1px solid var(--cream-border);
}

.bubble-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  padding: 0.5rem;
  outline: none;
  color: var(--text-primary);
}

.bubble-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--teal-gradient);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.bubble-send-btn:hover {
  transform: scale(1.05);
}

.bubble-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.bubble-close:hover {
  background: var(--cream-secondary);
  color: var(--text-primary);
}

/* ============================================
   M42 CHAT INTERFACE
   ============================================ */
.sffc-conversational {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 400px;
  height: 600px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.fh-main {
  flex-grow: 1;
  padding: 2rem 0;
  background: var(--cream-primary);
}

.fh-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* News Grid */
.fh-content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.fh-news-feed {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

/* Section Titles */
.section-title {
  font-family: var(--font-headlines);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--cream-border);
}

/* News Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.news-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--cream-border);
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-light);
}

.news-card-image {
  height: 160px;
  background: var(--cream-secondary);
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.05);
}

.news-card-content {
  padding: 1rem;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.news-category {
  color: var(--teal-medium);
  font-weight: 600;
  text-transform: uppercase;
}

.news-time {
  color: var(--text-muted);
}

.news-card-title {
  font-family: var(--font-headlines);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.news-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-card-title a:hover {
  color: var(--teal-medium);
}

.news-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--cream-border);
}

/* Sidebar */
.fh-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-widget {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--cream-border);
}

.widget-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cream-border);
}

/* Market Overview */
.market-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--cream-border);
}

.market-item:last-child {
  border-bottom: none;
}

.market-info {
  display: flex;
  flex-direction: column;
}

.market-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.market-symbol {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.market-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.market-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.market-change {
  font-size: 0.75rem;
  font-weight: 500;
}

.market-change.positive {
  color: var(--success);
}

.market-change.negative {
  color: var(--danger);
}

/* Newsletter */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.newsletter-form input[type="email"] {
  padding: 0.5rem;
  border: 1px solid var(--cream-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--cream-secondary);
}

.newsletter-form button {
  background: var(--teal-gradient);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.newsletter-form button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Footer */
.fh-footer {
  background: var(--white);
  border-top: 1px solid var(--cream-border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.fh-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .fh-content-grid {
    grid-template-columns: 1fr;
  }

  .profile-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .fh-nav-inner {
    flex-wrap: wrap;
    padding: 1rem;
  }

  .senna-menu {
    order: 3;
    width: 100%;
    justify-content: space-around;
    margin-top: 1rem;
  }

  .nav-item span {
    display: none;
  }

  .nav-item {
    padding: 0.5rem;
  }

  .senna-quick-prompt {
    display: none;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .senna-chat-bubble {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  border: 2px solid var(--cream-border);
  border-top: 2px solid var(--teal-medium);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Transitions */
* {
  transition-property: background-color, border-color, color, fill, stroke,
    opacity, box-shadow, transform;
  transition-timing-function: ease-in-out;
  transition-duration: 150ms;
}
