/* Custom styles for the finance-themed personal website */

/* Financial dashboard-style metrics */
.financial-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  max-width: 100%;
  box-sizing: border-box;
}

.metric-card {
  background: var(--bs-card-bg, #ffffff);
  border: 1px solid var(--bs-border-color, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-warning));
  border-radius: 0.75rem 0.75rem 0 0;
  z-index: 1;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--bs-primary);
  margin-bottom: 0.25rem;
  font-family: 'Inter', sans-serif;
}

.metric-label {
  color: var(--bs-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.metric-change {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

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

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

/* Hero banner styling */
.hero-banner {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 50%, var(--bs-warning) 100%);
  color: white;
  padding: 4rem 2rem;
  border-radius: 1rem;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20h60v60H20z' fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1'/%3E%3Cpath d='M30 30h40v40H30z' fill='none' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'/%3E%3C/svg%3E") repeat;
  z-index: 1;
}

.hero-banner * {
  position: relative;
  z-index: 2;
}

.hero-banner h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-banner .subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Grid improvements */
.grid {
  margin: 2rem 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Card-like styling for project sections */
.g-col-md-4, .g-col-md-6 {
  padding: 1rem;
}

.g-col-md-4 h3, .g-col-md-6 h3 {
  color: var(--bs-dark);
  border-bottom: 2px solid var(--bs-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Button styling */
.btn-outline-primary {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: white;
  transform: translateY(-2px);
}

/* Code block improvements */
pre {
  border-radius: 0.5rem;
  border: 1px solid #e1e5e9;
}

/* Navigation improvements */
.navbar-brand {
  font-weight: 600;
  font-size: 1.3rem;
}

/* Footer styling */
.nav-footer {
  border-top: 1px solid #e1e5e9;
  margin-top: 3rem;
  padding-top: 2rem;
}

/* Disable TOC and sidebar completely */
.sidebar,
nav[role=doc-toc],
.toc-right {
  display: none !important;
}

/* Ensure main content takes full width */
.content-main {
  margin-right: 0 !important;
  max-width: 100% !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .hero-banner {
    padding: 2rem 1rem;
  }
  
  .hero-banner h1 {
    font-size: 2rem;
  }
  
  .sidebar {
    padding: 0.75rem;
    margin-right: 0;
    border-right: none;
    border-top: 1px solid var(--bs-border-color);
  }
  
  .sidebar nav[role=doc-toc] ul li a {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Sidebar functionality removed - no search styling needed */

/* Fix sidebar bleeding into main content */
.quarto-container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Main content area adjustments */
.content-main {
  padding-right: 1rem;
  margin-right: 0;
}

/* Clean layout without sidebar interference */
@media (min-width: 992px) {
  .content-main {
    margin: 0 auto;
    padding: 0 2rem;
    max-width: 1200px;
  }
}

/* Removed conflicting dark mode media query - handled by SCSS themes */

/* Finance-themed project and publication cards */
.project-card, .publication-card {
  border: 1px solid var(--bs-border-color, #e2e8f0);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  background: var(--bs-card-bg, #ffffff);
  position: relative;
  overflow: hidden;
}

.project-card::before, .publication-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-success), var(--bs-warning));
  border-radius: 0.75rem 0.75rem 0 0;
  z-index: 1;
}

.project-card:hover, .publication-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--bs-primary);
}

/* Financial portfolio section */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.portfolio-item {
  background: var(--bs-card-bg, #ffffff);
  border: 1px solid var(--bs-border-color, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.1);
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.portfolio-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bs-primary);
}

.portfolio-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bs-success);
}

.portfolio-change {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.portfolio-change.positive {
  background: color-mix(in srgb, var(--bs-success) 10%, transparent);
  color: var(--bs-success);
}

.portfolio-change.negative {
  background: color-mix(in srgb, var(--bs-danger) 10%, transparent);
  color: var(--bs-danger);
}

/* Financial charts and tables */
.financial-table {
  background: var(--bs-card-bg, #ffffff);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--bs-border-color, #e2e8f0);
  margin: 2rem 0;
}

.financial-table table {
  margin: 0;
  width: 100%;
}

.financial-table th {
  background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  padding: 1rem;
}

.financial-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
}

.financial-table .positive {
  color: var(--bs-success);
  font-weight: 600;
}

.financial-table .negative {
  color: var(--bs-danger);
  font-weight: 600;
}

/* Performance indicators */
.performance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.performance-badge.excellent {
  background: color-mix(in srgb, var(--bs-success) 10%, transparent);
  color: var(--bs-success);
}

.performance-badge.good {
  background: color-mix(in srgb, var(--bs-success) 8%, transparent);
  color: var(--bs-success);
}

.performance-badge.average {
  background: color-mix(in srgb, var(--bs-warning) 10%, transparent);
  color: var(--bs-warning);
}

.performance-badge.poor {
  background: color-mix(in srgb, var(--bs-danger) 10%, transparent);
  color: var(--bs-danger);
}

/* Links styling */
a {
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

/* Highlight boxes */
.callout {
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Profile image on about page */
.about-contents img {
  border-radius: 50%;
  border: 3px solid var(--bs-primary);
}

/* Homepage specific fixes */
.quarto-title-banner {
  margin-bottom: 0;
  padding-bottom: 0;
  border: none;
}

.quarto-title-block {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Fix potential border bleeding on homepage */
.content-main {
  border: none !important;
  box-shadow: none !important;
}

/* Remove unwanted margins on homepage elements */
.content-main > .hero-banner:first-child {
  margin-top: 0;
}

.content-main > .hero-banner {
  margin-left: 0;
  margin-right: 0;
}

/* Fix grid container margins */
.grid {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Financial metrics container */
.financial-metrics {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Remove potential border artifacts */
main {
  border: none !important;
  box-shadow: none !important;
}

.quarto-container {
  border: none !important;
  margin: 0;
  padding: 0;
}

/* Fix any container bleeding */
.container-fluid {
  padding-left: 0;
  padding-right: 0;
  border: none;
}

/* Sidebar disabled globally - no special homepage rules needed */

/* This rule is replaced by the new homepage layout fixes above */

/* Remove title banner margins that might cause spacing issues */
.quarto-title .quarto-title-block {
  margin: 0;
  padding: 0;
}

/* Fix footer spacing on homepage */
.nav-footer {
  border-top: 1px solid var(--bs-border-color);
  margin-top: 3rem;
  padding-top: 2rem;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

/* Articles page layout fixes */
body.quarto-listing .content-main {
  max-width: 100%;
  padding: 0 2rem;
  margin: 0 auto;
  border: none !important;
  box-shadow: none !important;
}

body.quarto-listing .quarto-title-banner {
  display: none;
}

body.quarto-listing .quarto-title-block {
  margin: 0;
  padding: 2rem 0;
}

/* Articles listing styling */
.quarto-listing .list {
  border: none;
  box-shadow: none;
}

.quarto-listing .listing-item {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bs-card-bg);
  transition: all 0.3s ease;
}

.quarto-listing .listing-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--bs-primary);
}

.quarto-listing .listing-title {
  color: var(--bs-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quarto-listing .listing-subtitle,
.quarto-listing .listing-description {
  color: var(--bs-body-color);
  margin-bottom: 0.75rem;
}

.quarto-listing .listing-date {
  color: var(--bs-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.quarto-listing .listing-categories {
  margin-top: 0.75rem;
}

.quarto-listing .listing-category {
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
  color: var(--bs-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

@media (max-width: 768px) {
  body.quarto-listing .content-main {
    padding: 0 1rem;
  }
}

/* Remove any unwanted borders from containers */
.page-columns,
.page-rows-contents,
.quarto-container,
.content-main {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Clean up any Bootstrap bleeding */
.container,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
  border: none !important;
  box-shadow: none !important;
}

/* Homepage layout fixes - simple and centered */
body.quarto-homepage {
  overflow-x: hidden;
}

body.quarto-homepage .content-main {
  max-width: 100vw;
  padding: 0;
  margin: 0;
  position: relative;
  left: 0;
  right: 0;
}

/* Ensure no elements extend beyond viewport */
body.quarto-homepage * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Hero banner full width */
.hero-banner {
  margin: 0 0 3rem 0;
  padding: 4rem 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* Content sections with proper padding */
.content-main > h2,
.content-main > p,
.content-main > .grid,
.content-main > .financial-metrics,
.content-main > ul {
  padding-left: 2rem;
  padding-right: 2rem;
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .hero-banner {
    padding: 2rem 1rem;
    border-radius: 0;
  }
  
  .content-main > h2,
  .content-main > p,
  .content-main > .grid,
  .content-main > .financial-metrics,
  .content-main > ul {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
