/* PilePeak Design System - Core Variables */
:root {
  /* Colors - PilePeak Palette */
  --color-black-primary: #0B0B0B;
  --color-gray-50: #A7A7A7;
  --color-gray-10: #F3F3F3;
  --color-gray-15: #EDEDED;
  --color-white: #FFFFFF;
  
  /* Accent Colors */
  --color-cyan-accent: #00E8FF;
  --color-green-positive: #23C463;
  --color-red-negative: #E54D4D;
  --color-yellow-badge: #D9F470;
  
  /* Spacing Tokens */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Border Radius */
  --radius-card: 24px;
  --radius-button: 12px;
  --radius-small: 8px;
  
  /* Shadows */
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Modern Navigation Bar */
.modern-nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-15);
  box-shadow: var(--shadow-card);
}

.nav-link {
  position: relative;
  color: var(--color-gray-50);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--color-black-primary);
}

.nav-link.active {
  color: var(--color-black-primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-black-primary);
}

/* Mobile Menu Toggle */
.mobile-menu-button {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-button {
    display: block;
  }
  
  .desktop-nav {
    display: none;
  }
  
  .mobile-nav {
    display: block;
  }
}

/* PilePeak Typography System */
body {
  font-family: var(--font-family);
  color: var(--color-black-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Heading Styles */
.h1 {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-black-primary);
  line-height: 1.2;
}

.h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-black-primary);
  line-height: 1.3;
}

.h3 {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-black-primary);
  line-height: 1.4;
}

/* Body Text */
.body-l {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.body-m {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.body-s {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

/* Large Numbers */
.number-big {
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.number-medium {
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* Labels */
.label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-50);
}

/* PilePeak Card System */
.pilepeak-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--space-24);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-gray-15);
  transition: all 0.2s ease;
}

.pilepeak-card:hover {
  box-shadow: var(--shadow-hover);
}

/* Metric cards hover effect */
.bg-gray-50:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease-in-out;
  box-shadow: var(--shadow-hover);
}

/* Metric values */
#performanceMetrics p,
#riskMetrics p,
#tradeMetrics p {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background-color: white;
  transition: background-color 0.2s ease-in-out;
}

#performanceMetrics p:hover,
#riskMetrics p:hover,
#tradeMetrics p:hover {
  background-color: #f3f4f6;
}

/* Loading spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Chart containers */
#equityCurve,
#monthlyPerformance {
  min-height: 300px;
  width: 100%;
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Form input focus states */
input:focus,
select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Button hover states */
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Report link buttons */
#detailedReportLink:hover,
#visualizationLink:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  #equityCurve,
  #monthlyPerformance {
    min-height: 250px;
  }

  .grid {
    gap: 1rem;
  }
}

/* Custom styles for trading bot backtester */

/* Loading spinner animation */
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Table styles */
.table-container {
  overflow-x: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.table-header {
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.table-row:hover {
  background-color: #f9fafb;
}

.sort-indicator {
  color: #9ca3af;
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

.sort-indicator.active {
  color: #3b82f6;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-badge.positive {
  background-color: #dcfce7;
  color: #166534;
}

.status-badge.negative {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-badge.neutral {
  background-color: #f3f4f6;
  color: #374151;
}

/* Strategy badges */
.strategy-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.strategy-badge.alligator {
  background-color: #dbeafe;
  color: #1e40af;
}

.strategy-badge.adaptive {
  background-color: #f3e8ff;
  color: #7c3aed;
}

.strategy-badge.darvas {
  background-color: #fef3c7;
  color: #d97706;
}

.strategy-badge.darvasM {
  background-color: #fed7aa;
  color: #ea580c;
}

.strategy-badge.hull {
  background-color: #ddd6fe;
  color: #7c3aed;
}

.strategy-badge.legacy {
  background-color: #f3f4f6;
  color: #374151;
}

/* Responsive table improvements */
@media (max-width: 768px) {
  .table-container {
    font-size: 0.875rem;
  }

  .table-container th,
  .table-container td {
    padding: 0.5rem 0.75rem;
  }
}

/* Filter section */
.filter-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.filter-section h2 {
  color: white;
  margin-bottom: 1rem;
}

.filter-section select,
.filter-section input {
  background-color: white;
  color: #374151;
}

/* Summary cards */
.summary-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.summary-card h3 {
  color: #374151;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.summary-card .metric {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

/* Action buttons */
.action-link {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.action-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-link.report {
  background-color: #dbeafe;
  color: #1e40af;
}

.action-link.report:hover {
  background-color: #bfdbfe;
}

.action-link.chart {
  background-color: #e9d5ff;
  color: #7c3aed;
}

.action-link.chart:hover {
  background-color: #ddd6fe;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #374151;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .page-info {
  padding: 0.5rem 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-state svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  color: #d1d5db;
}

/* Loading state */
.loading-state {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.75rem;
}

/* Responsive utilities */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

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

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

  .pagination {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination button {
    width: 100%;
  }
}

/* Modern Card Enhancements */
.card-hover {
  transition: all 0.2s ease-in-out;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* PilePeak Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-8) var(--space-12);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-success {
  background-color: var(--color-green-positive);
  color: var(--color-white);
}

.badge-danger {
  background-color: var(--color-red-negative);
  color: var(--color-white);
}

.badge-warning {
  background-color: var(--color-yellow-badge);
  color: var(--color-black-primary);
}

.badge-cyan {
  background-color: var(--color-cyan-accent);
  color: var(--color-black-primary);
}

.badge-neutral {
  background-color: var(--color-gray-10);
  color: var(--color-black-primary);
}

/* PilePeak Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-24);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-button);
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid var(--color-gray-15);
  outline: none;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-black-primary);
  color: var(--color-white);
  border-color: var(--color-black-primary);
}

.btn-primary:hover {
  background: #1a1a1a;
}

.btn-success {
  background: var(--color-green-positive);
  color: var(--color-white);
  border-color: var(--color-green-positive);
}

.btn-danger {
  background: var(--color-red-negative);
  color: var(--color-white);
  border-color: var(--color-red-negative);
}

.btn-outline {
  background: var(--color-white);
  color: var(--color-black-primary);
  border-color: var(--color-gray-15);
}

.btn-outline:hover {
  background: var(--color-gray-10);
}

/* PilePeak Form System */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--color-black-primary);
  background: var(--color-white);
  border: 1px solid var(--color-gray-15);
  border-radius: var(--radius-button);
  padding: var(--space-12) var(--space-16);
  transition: all 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-black-primary);
  box-shadow: 0 0 0 2px rgba(11, 11, 11, 0.05);
  outline: none;
}

input::placeholder {
  color: var(--color-gray-50);
}

/* PilePeak Table System */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

table thead tr {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-15);
}

table thead th {
  padding: var(--space-16) var(--space-20);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-gray-50);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table tbody tr {
  border-bottom: 1px solid var(--color-gray-15);
  transition: background-color 0.1s ease;
}

table tbody tr:hover {
  background-color: var(--color-gray-10);
}

table tbody td {
  padding: var(--space-16) var(--space-20);
  font-size: 14px;
  color: var(--color-black-primary);
}

/* PilePeak Status Indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: var(--space-8);
}

.status-dot.active {
  background-color: var(--color-green-positive);
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot.inactive {
  background-color: var(--color-red-negative);
}

.status-dot.pending {
  background-color: var(--color-yellow-badge);
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Color Utilities - PilePeak Palette */
.text-positive {
  color: var(--color-green-positive) !important;
}

.text-negative {
  color: var(--color-red-negative) !important;
}

.text-accent {
  color: var(--color-cyan-accent) !important;
}

.text-secondary {
  color: var(--color-gray-50) !important;
}

.bg-accent {
  background-color: var(--color-cyan-accent) !important;
}

.bg-neutral {
  background-color: var(--color-gray-10) !important;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading Spinner Enhancement */
.spinner {
  border: 2px solid #E5E7EB;
  border-top-color: #06B6D4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Notification Toast Styles */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  min-width: 300px;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .grid {
    gap: 1rem;
  }
  
  .text-4xl {
    font-size: 2rem;
  }
  
  .text-5xl {
    font-size: 2.5rem;
  }
}

/* Tooltip styles for strategy parameters */
.cursor-help {
  cursor: help;
}

.cursor-help:hover {
  color: #3b82f6;
}

/* Enhanced tooltip styling */
label[title],
i[title] {
  position: relative;
}

/* Dark mode support (disabled by default) */
/* Uncomment to enable dark mode */
/*
@media (prefers-color-scheme: dark) {
  body {
    background-color: #111827;
    color: #f9fafb;
  }

  .bg-white {
    background-color: #1f2937;
  }

  .text-gray-900 {
    color: #f9fafb;
  }

  .text-gray-700 {
    color: #e5e7eb;
  }

  .bg-gray-50 {
    background-color: #374151;
  }

  .border-gray-200 {
    border-color: #4b5563;
  }
}
*/
