/* Acquisitions Dashboard - Sunrise Communities */
/* Based on Sunrise Hub styling patterns */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
  color: #1e293b;
}

/* Header */
.header {
  background: linear-gradient(135deg, #1b3664 0%, #035a9c 100%);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(27, 54, 100, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 50px;
  width: auto;
}

.header-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

.internal-badge {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-link {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 1;
}

/* Sync Button */
.sync-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sync-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.sync-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sync-btn.syncing .sync-icon {
  animation: spin 1s linear infinite;
}

.sync-btn.syncing .sync-text::after {
  content: "ing...";
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

.notification-toast.success {
  border-left: 4px solid #059669;
}

.notification-toast.error {
  border-left: 4px solid #dc2626;
}

.notification-toast.info {
  border-left: 4px solid #2563eb;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.toast-close:hover {
  color: #1e293b;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Main Content */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Stats Bar */
.stats-bar {
  background: white;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1b3664;
}

.stat-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Filters */
.filters-bar {
  background: white;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-label {
  font-weight: 600;
  color: #64748b;
  font-size: 0.875rem;
}

.filter-select, .filter-input {
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1e293b;
  background: #f8fafc;
}

.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: #1b3664;
}

.filter-input {
  min-width: 200px;
}

/* Deals Grid */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Deal Card */
.deal-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(27, 54, 100, 0.15);
  border-color: #1b3664;
}

.deal-card-image {
  height: 160px;
  background: linear-gradient(135deg, #1b3664 0%, #035a9c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  position: relative;
}

.deal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deal-card-image .placeholder-icon {
  opacity: 0.5;
}

.deal-card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.deal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.deal-card-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.deal-card-location {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-badge.pipeline { background: #f1f5f9; color: #64748b; }
.status-badge.loi { background: #fef3c7; color: #92400e; }
.status-badge.dd { background: #dbeafe; color: #1e40af; }
.status-badge.ic-review { background: #dcfce7; color: #166534; }
.status-badge.closed { background: #1b3664; color: white; }
.status-badge.passed { background: #fee2e2; color: #991b1b; }

.deal-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.metric {
  text-align: center;
}

.metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1b3664;
}

.metric-label {
  font-size: 0.625rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Deal Detail Page */
.deal-header {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.deal-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.deal-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.deal-location {
  font-size: 1.125rem;
  color: #64748b;
}

.hero-metrics {
  display: flex;
  gap: 2rem;
}

.hero-metric {
  text-align: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
}

.hero-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1b3664;
}

.hero-metric-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tabs */
.tabs-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 1rem 1.5rem;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: #1b3664;
  background: #f8fafc;
}

.tab-btn.active {
  color: #1b3664;
  border-bottom-color: #1b3664;
  font-weight: 600;
}

.tab-content {
  padding: 2rem;
  display: none;
}

.tab-content.active {
  display: block;
}

/* Section Styles */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.info-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}

.info-value.highlight {
  color: #1b3664;
}

/* Cards Grid for Business Plan */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pillar-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
}

.pillar-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1b3664;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pillar-card-content {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.6;
}

.pillar-highlight {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1b3664;
  margin-bottom: 0.5rem;
}

/* Risk Cards */
.risk-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  border-left: 4px solid #f59e0b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.risk-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.risk-description {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.risk-mitigation {
  font-size: 0.875rem;
  color: #059669;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.risk-mitigation::before {
  content: "Mitigation:";
  font-weight: 600;
  color: #059669;
}

/* Timeline */
.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 4px;
  background: #e2e8f0;
  z-index: 0;
}

.timeline-item {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  background: #1b3664;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.timeline-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.timeline-date {
  font-size: 0.75rem;
  color: #64748b;
}

.timeline-type {
  font-size: 0.75rem;
  color: #1b3664;
  font-weight: 500;
}

/* Recommendation Section */
.recommendation-box {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  border: 2px solid #22c55e;
}

.recommendation-box.reject {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #ef4444;
}

.recommendation-verdict {
  font-size: 1.5rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 1rem;
}

.recommendation-box.reject .recommendation-verdict {
  color: #991b1b;
}

.recommendation-thesis {
  font-size: 1rem;
  color: #475569;
  max-width: 600px;
  margin: 0 auto;
}

/* Loading & Error States */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: #64748b;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #1b3664;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-message {
  background: #fee2e2;
  color: #991b1b;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  margin: 2rem 0;
}

.empty-state {
  text-align: center;
  padding: 4rem;
  color: #64748b;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  font-size: 0.875rem;
}

.footer img {
  height: 40px;
  margin-top: 0.75rem;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .stats-bar {
    justify-content: center;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-input {
    width: 100%;
  }

  .deals-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    flex-direction: column;
    gap: 1rem;
  }

  .tabs-nav {
    flex-wrap: nowrap;
  }

  .tab-btn {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }

  .main {
    padding: 1rem;
  }

  .timeline {
    flex-direction: column;
    gap: 1.5rem;
  }

  .timeline::before {
    top: 0;
    bottom: 0;
    left: 20px;
    right: auto;
    width: 4px;
    height: auto;
  }

  .timeline-item {
    text-align: left;
    padding-left: 60px;
  }

  .timeline-dot {
    position: absolute;
    left: 0;
    margin: 0;
  }
}

/* Print Styles */
@media print {
  .header, .tabs-nav, .footer {
    display: none;
  }

  .tab-content {
    display: block !important;
    page-break-inside: avoid;
  }
}

/* ========================================
   10-Year Cashflow Chart Styles
   ======================================== */

.section-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

.cashflow-chart {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.chart-legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-color.noi {
  background: linear-gradient(135deg, #1b3664 0%, #035a9c 100%);
}

.legend-color.levered {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 200px;
  padding-top: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bar-container {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  justify-content: center;
}

.bar {
  width: 12px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  cursor: pointer;
}

.bar:hover {
  opacity: 0.8;
}

.noi-bar {
  background: linear-gradient(135deg, #1b3664 0%, #035a9c 100%);
}

.levered-bar {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.levered-bar.negative {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.bar-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
}

/* Cashflow Table */
.cashflow-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 1rem;
}

.cashflow-table th,
.cashflow-table td {
  padding: 0.75rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid #e2e8f0;
}

.cashflow-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.cashflow-table th:first-child,
.cashflow-table td.row-label {
  text-align: left;
  font-weight: 500;
}

.cashflow-table .negative {
  color: #dc2626;
}

.cashflow-table .positive {
  color: #059669;
}

.cashflow-table .highlight-row {
  background: #f0fdf4;
}

.cashflow-table .highlight-row td {
  border-top: 2px solid #059669;
}

/* ========================================
   AI Insights Tab Styles
   ======================================== */

.tab-btn.ai-tab {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
}

.tab-btn.ai-tab:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
}

.tab-btn.ai-tab.active {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
}

.ai-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  border-left: 4px solid #64748b;
  margin-bottom: 1.5rem;
}

.ai-disclaimer.warning {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.ai-disclaimer svg {
  flex-shrink: 0;
  color: #f59e0b;
}

.ai-disclaimer p {
  font-size: 0.875rem;
  color: #78350f;
  margin-top: 0.25rem;
  line-height: 1.5;
}

.ai-confidence-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.ai-confidence-badge.high {
  background: #dcfce7;
  color: #166534;
}

.ai-confidence-badge.moderate {
  background: #fef3c7;
  color: #92400e;
}

.ai-confidence-badge.low {
  background: #fef2f2;
  color: #991b1b;
}

.ai-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.ai-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ai-section.strengths {
  border-top: 4px solid #059669;
}

.ai-section.concerns {
  border-top: 4px solid #dc2626;
}

.ai-section.recommendations {
  border-top: 4px solid #2563eb;
}

.ai-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

.ai-list {
  list-style: none;
  padding: 0;
}

.ai-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #475569;
}

.ai-list li:last-child {
  border-bottom: none;
}

.ai-list li::before {
  content: "•";
  color: #94a3b8;
  font-weight: bold;
  margin-right: 0.5rem;
}

.ai-commentary,
.ai-risk-assessment {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ai-commentary p,
.ai-risk-assessment p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #334155;
}

.ai-footer {
  display: flex;
  gap: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Responsive adjustments for charts */
@media (max-width: 768px) {
  .chart-bars {
    height: 150px;
    gap: 0.25rem;
  }

  .bar-container {
    height: 130px;
  }

  .bar {
    width: 8px;
  }

  .cashflow-table {
    font-size: 0.7rem;
  }

  .cashflow-table th,
  .cashflow-table td {
    padding: 0.5rem 0.25rem;
  }

  .ai-sections {
    grid-template-columns: 1fr;
  }
}

/* NOI Change Drivers Styles */
.noi-drivers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.noi-driver {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.noi-driver.positive {
  background: #f0fdf4;
  color: #059669;
}

.noi-driver.negative {
  background: #fef2f2;
  color: #dc2626;
}

.noi-driver.neutral {
  background: #f0f9ff;
  color: #0369a1;
}

.noi-driver.muted {
  background: #f1f5f9;
  color: #64748b;
  font-style: italic;
  cursor: help;
}

/* Expense Benchmark Styles */
.expense-benchmark-table {
  font-size: 0.875rem;
}

.expense-benchmark-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #64748b;
}

.expense-benchmark-table tbody tr:hover {
  background: #f8fafc;
}

.expense-variance {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8125rem;
}

.expense-variance.above {
  background: #fef2f2;
  color: #dc2626;
}

.expense-variance.below {
  background: #f0fdf4;
  color: #059669;
}

@media (max-width: 768px) {
  .expense-benchmark-table {
    font-size: 0.75rem;
  }

  .expense-variance {
    padding: 0.125rem 0.25rem;
    font-size: 0.6875rem;
  }
}
