/*-- scss:defaults --*/


/*-- scss:rules --*/


/* ============================================================================
   BIZANALYZER - Complete Stylesheet (MERGED VERSION)
   ============================================================================
   
   Complete CSS for the BizAnalyzer application including:
   - Base Quarto-native styles
   - Report viewer styles
   - Analysis results styles
   - Notifications and UI enhancements
   - Responsive design
   - Print optimization
   
   @version 2.0.0 (Merged)
   @author Second Difference Solutions, LLC
   ============================================================================ */

/* ============================================================================
   AUTHENTICATION & LOADING STATES
   ============================================================================ */

/**
 * Authentication loading screen
 * Displayed while checking user authentication
 */
.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
}

/**
 * Loading spinner animation
 * Used throughout the app for loading states
 */
.spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

.spinner-small {
  border: 3px solid #f3f4f6;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/**
 * Loading spinner container
 * Displayed while content is loading
 */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #6b7280;
}

.loading-spinner p {
  margin-top: 1rem;
  font-size: 0.875rem;
}

/* ============================================================================
   NAVIGATION CARDS
   ============================================================================ */

/**
 * Navigation cards grid
 * Card-based navigation on dashboard
 */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/**
 * Individual navigation card
 * Clickable cards for section navigation
 */
.nav-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

/**
 * Active navigation card
 * Highlight the currently active section
 */
.nav-card.active {
  border-color: #3b82f6;
  background: linear-gradient(to bottom right, #ffffff, #eff6ff);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
}

.nav-card.active .card-icon {
  transform: scale(1.1);
}

.card-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.nav-card h3 {
  margin: 0.5rem 0;
  color: #1f2937;
}

.nav-card p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* ============================================================================
   CONTENT SECTIONS
   ============================================================================ */

/**
 * Content section container
 * Main container for each app section
 */
.content-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/**
 * Section header
 * Header bar with title and actions
 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.section-header h2 {
  margin: 0;
  color: #1f2937;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* ============================================================================
   DASHBOARD METRICS
   ============================================================================ */

/**
 * Metrics container
 * Grid layout for metric boxes
 */
.metrics-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/**
 * Individual metric box
 * Displays single financial metric
 */
.metric-box {
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-label {
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
}

.metric-value {
  color: #1f2937;
  font-size: 2rem;
  font-weight: 700;
}

.metric-trend {
  font-size: 0.875rem;
  font-weight: 600;
}

.metric-trend.positive { color: #10b981; }
.metric-trend.negative { color: #ef4444; }
.metric-trend.neutral { color: #6b7280; }

/* ============================================================================
   CONNECTION STATUS
   ============================================================================ */

/**
 * QuickBooks connection status
 * Shows connection state and company info
 */
.connection-status {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/**
 * Connection status dot
 * Colored indicator for connection status
 */
.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #6b7280;
  transition: background-color 0.3s ease;
  margin-right: 0.5rem;
}

.status-dot.connected {
  background-color: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.connection-details {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* ============================================================================
   REPORTS LIST & VIEWER
   ============================================================================ */

/**
 * Report list container
 * List of available reports
 */
.report-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/**
 * Individual report item
 * Clickable report list item
 */
.report-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-item:hover {
  background: white;
  border-color: #667eea;
  transform: translateX(4px);
}

.report-icon {
  font-size: 2rem;
}

.report-info {
  flex: 1;
}

.report-info h3 {
  margin: 0 0 0.25rem 0;
  color: #1f2937;
}

.report-info p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.report-arrow {
  color: #667eea;
  font-size: 1.5rem;
}

/**
 * Report viewer container
 * Area where reports are displayed
 */
.report-viewer {
  margin-top: 2rem;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
  min-height: 300px;
}

/**
 * Report content container
 * Main wrapper for all report displays
 */
.report-content {
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-content h3 {
  margin: 0 0 0.5rem 0;
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 600;
}

.report-period {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0 0 2rem 0;
}

/**
 * Report sections
 * Individual sections within a report (Revenue, Expenses, etc.)
 */
.report-section {
  margin-bottom: 2rem;
}

.report-section h4 {
  margin: 0 0 1rem 0;
  color: #374151;
  font-size: 1.125rem;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

/**
 * Report line items
 * Individual rows showing account names and values
 */
.report-line {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.report-line:last-child {
  border-bottom: none;
}

.report-line span:first-child {
  color: #374151;
}

.report-line span:last-child {
  font-weight: 500;
  color: #1f2937;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

/**
 * Total lines within reports
 * Highlighted rows for totals and subtotals
 */
.report-total {
  font-weight: 600;
  background-color: #f9fafb;
  padding: 0.75rem 1rem;
  margin: 0.5rem -1rem;
}

.report-total span {
  font-weight: 600;
}

/**
 * Highlighted report lines
 * Used for net income, ending balances, etc.
 */
.report-highlight {
  background-color: #eff6ff;
  border-left: 4px solid #3b82f6;
}

/**
 * Report tables
 * For general ledger and transaction listings
 */
.report-table {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.report-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.report-table thead {
  background-color: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.report-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #374151;
}

.report-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
}

.report-table tbody tr:hover {
  background-color: #f9fafb;
}

/* ============================================================================
   ANALYSIS TOOLS & RESULTS
   ============================================================================ */

/**
 * Analysis tools grid
 * Grid of available analysis tools
 */
.analysis-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/**
 * Individual tool card
 * Card for each analysis tool
 */
.tool-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.tool-card h3 {
  margin: 0 0 0.5rem 0;
  color: #1f2937;
}

.tool-card p {
  margin: 0 0 1rem 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/**
 * Analysis results container
 * Area where analysis results are displayed
 */
.analysis-results {
  margin-top: 2rem;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
  min-height: 300px;
}

/**
 * Analysis content container
 * Main wrapper for analysis results
 */
.analysis-content {
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analysis-content h3 {
  margin: 0 0 0.5rem 0;
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 600;
}

.analysis-period {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0 0 2rem 0;
}

/**
 * Trends grid
 * Grid layout for trend cards
 */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/**
 * Trend cards
 * Individual metric cards showing trends
 */
.trend-card {
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background: white;
}

.trend-card h4 {
  margin: 0 0 1rem 0;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trend-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trend-number {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
}

.trend-arrow {
  font-size: 1.5rem;
}

/**
 * Trend status colors
 * Different colors for positive, negative, warning statuses
 */
.trend-positive {
  border-color: #10b981;
  background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}

.trend-positive .trend-number,
.trend-positive .trend-arrow {
  color: #059669;
}

.trend-warning {
  border-color: #f59e0b;
  background: linear-gradient(to bottom right, #ffffff, #fffbeb);
}

.trend-warning .trend-number,
.trend-warning .trend-arrow {
  color: #d97706;
}

.trend-negative {
  border-color: #ef4444;
  background: linear-gradient(to bottom right, #ffffff, #fef2f2);
}

.trend-negative .trend-number,
.trend-negative .trend-arrow {
  color: #dc2626;
}

/**
 * Insights section
 * Key insights and recommendations
 */
.insights-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
}

.insights-section h4 {
  margin: 0 0 1rem 0;
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
}

.insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insights-list li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: #374151;
  line-height: 1.6;
}

.insights-list li:before {
  content: '→';
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: bold;
}

/**
 * Ratios list
 * Container for ratio analysis cards
 */
.ratios-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/**
 * Ratio cards
 * Individual cards for each financial ratio
 */
.ratio-card {
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
}

.ratio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.ratio-header h4 {
  margin: 0;
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
}

.ratio-status {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.ratio-status-good {
  background-color: #d1fae5;
  color: #065f46;
}

.ratio-status-excellent {
  background-color: #bfdbfe;
  color: #1e40af;
}

.ratio-status-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.ratio-status-poor {
  background-color: #fee2e2;
  color: #991b1b;
}

.ratio-values {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

.ratio-value {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ratio-value .label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ratio-value .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.ratio-description {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
}

/**
 * Summary section
 * Overall summary for analysis results
 */
.summary-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #eff6ff;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
}

.summary-section p {
  margin: 0;
  color: #1f2937;
  line-height: 1.6;
}

/**
 * Forecast table
 * Table display for financial forecasts
 */
.forecast-table {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.forecast-table table {
  width: 100%;
  border-collapse: collapse;
}

.forecast-table thead {
  background-color: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.forecast-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

.forecast-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.forecast-table tbody tr:hover {
  background-color: #f9fafb;
}

/**
 * Assumptions section
 * List of forecast assumptions
 */
.assumptions-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #fef3c7;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
}

.assumptions-section h4 {
  margin: 0 0 1rem 0;
  color: #78350f;
  font-size: 1.125rem;
  font-weight: 600;
}

.assumptions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.assumptions-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: #92400e;
  line-height: 1.6;
}

.assumptions-list li:before {
  content: '⚠';
  position: absolute;
  left: 0;
  color: #f59e0b;
}

/* ============================================================================
   SETTINGS
   ============================================================================ */

/**
 * Settings groups
 * Grouped settings sections
 */
.settings-group {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-group h3 {
  margin: 0 0 1rem 0;
  color: #1f2937;
}

/**
 * Form groups
 * Input field groupings
 */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #374151;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.input-readonly {
  background: #f3f4f6;
  cursor: not-allowed;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

/**
 * Button styles
 * All button variations
 */
.btn-primary,
.btn-refresh,
.btn-signout,
.btn-danger,
.btn-tool {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-refresh {
  background: #f3f4f6;
  color: #374151;
}

.btn-refresh:hover {
  background: #e5e7eb;
}

.btn-signout {
  background: #fee;
  color: #dc2626;
}

.btn-signout:hover {
  background: #fdd;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-tool {
  background: #667eea;
  color: white;
  width: 100%;
}

.btn-tool:hover {
  background: #5568d3;
}

/* ============================================================================
   NOTIFICATIONS
   ============================================================================ */

/**
 * Toast notifications
 * Temporary notification messages
 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.notification-error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.notification-info {
  background-color: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

/* ============================================================================
   EMPTY & ERROR STATES
   ============================================================================ */

/**
 * Empty and error states
 * Displayed when no content or errors occur
 */
.empty-state,
.error-state {
  padding: 3rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

.error-state {
  color: #dc2626;
}

.no-data {
  text-align: center;
  color: #9ca3af;
  font-style: italic;
  padding: 3rem;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/**
 * Mobile adjustments
 * Optimize layout for smaller screens
 */
@media (max-width: 768px) {
  .nav-cards {
    grid-template-columns: 1fr;
  }
  
  .metrics-container {
    grid-template-columns: 1fr;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .header-actions {
    width: 100%;
  }
  
  .header-actions button {
    flex: 1;
  }
  
  .report-content,
  .analysis-content {
    padding: 1rem;
  }
  
  .trends-grid {
    grid-template-columns: 1fr;
  }
  
  .ratio-values {
    flex-direction: column;
    gap: 1rem;
  }
  
  .notification {
    left: 20px;
    right: 20px;
  }
  
  .report-table,
  .forecast-table {
    font-size: 0.75rem;
  }
  
  .report-table td,
  .report-table th,
  .forecast-table td,
  .forecast-table th {
    padding: 0.5rem;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

/**
 * Print optimization
 * Optimize reports for printing
 */
@media print {
  .report-content,
  .analysis-content {
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  .notification {
    display: none;
  }
  
  .btn-refresh,
  .btn-signout,
  .btn-primary,
  .btn-danger,
  .btn-tool {
    display: none;
  }
  
  .nav-cards,
  .header-actions {
    display: none;
  }
}
