/* Advanced Strategy Module Styles */

:root {
  --indicator-positive: #10B981;
  --indicator-negative: #EF4444;
  --indicator-neutral: #8B5CF6;
  --indicator-warning: #F59E0B;
}

/* Strategy Dashboard Layout */
.strategy-dashboard {
  margin-top: 30px;
}

.notification-card {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.notification-card .notification-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
}

.notification-card .notification-icon i {
  color: var(--danger-color);
  font-size: 1.5rem;
}

.notification-card .notification-content {
  flex: 1;
}

.notification-card .notification-content h3 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
}

.notification-card .notification-content p {
  margin: 0;
  color: var(--text-muted);
}

.notification-card .notification-action {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
  margin-left: 20px;
}

.notification-card .notification-action:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.notification-card.success .notification-icon {
  background: rgba(16, 185, 129, 0.1);
}

.notification-card.success .notification-icon i {
  color: var(--success-color);
}

/* Strategy Control Card */
.strategy-control-card {
  margin-bottom: 30px;
}

.select-wrapper {
  position: relative;
  display: inline-block;
  margin-right: 15px;
}

.select-wrapper .select-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.strategy-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 40px 12px 15px;
  font-size: 0.95rem;
  min-width: 200px;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
}

.strategy-select:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--secondary-color);
}

.strategy-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

.strategy-select option {
  background-color: var(--card-bg);
  color: var(--text-color);
}

.strategy-summary {
  display: flex;
  padding: 0 24px 24px;
  gap: 30px;
  position: relative;
}

.strategy-description {
  flex: 1;
  min-width: 0;
}

.strategy-description h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.25rem;
  color: var(--text-color-secondary);
}

.strategy-description p {
  margin: 0 0 15px 0;
  line-height: 1.7;
  color: var(--text-muted);
}

.strategy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.strategy-tag {
  background: rgba(139, 92, 246, 0.1);
  color: var(--secondary-color);
  border-radius: 100px;
  padding: 5px 15px;
  font-size: 0.85rem;
  font-weight: 500;
}

.strategy-performance {
  width: 40%;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

.strategy-performance h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.25rem;
  color: var(--text-color-secondary);
}

.performance-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.performance-stat {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--text-color), var(--text-color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 5px;
}

.stat-value.win-rate {
  color: var(--success-color);
  background: var(--success-color);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-value.profit-factor {
  color: var(--secondary-color);
  background: var(--secondary-color);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-value.avg-trade {
  color: var(--accent-color);
  background: var(--accent-color);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-value.max-drawdown {
  color: var(--danger-color);
  background: var(--danger-color);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* AI Recommendations */
.ai-recommendations {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin: 0 24px 24px;
  overflow: hidden;
}

.ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 24px;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--border-color);
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-title i {
  color: var(--secondary-color);
  font-size: 1.2rem;
}

.ai-title h3 {
  margin: 0;
  font-size: 1.1rem;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ai-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
}

.ai-status-indicator.active {
  background: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
  animation: pulse 2s infinite;
}

.ai-content {
  padding: 20px 24px;
}

.ai-message {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  padding: 15px 20px;
  transition: opacity 0.3s;
}

.ai-message p {
  margin: 0 0 15px 0;
  line-height: 1.6;
}

.ai-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Strategy Chart Styles */
.chart-container-wrapper {
  position: relative;
  margin: 0 24px 24px;
}

.chart-period-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.chart-period {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.chart-period:hover {
  background: rgba(139, 92, 246, 0.1);
}

.chart-period.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 5px 15px rgba(109, 40, 217, 0.2);
}

.strategy-chart-container {
  height: 400px;
  background: rgba(15, 23, 42, 0.3);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.chart-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
}

.indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.indicator-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.indicator-color.bb-middle {
  background-color: white;
}

.indicator-color.bb-upper {
  background-color: var(--indicator-positive);
}

.indicator-color.bb-lower {
  background-color: var(--indicator-negative);
}

.indicator-color.trend-line {
  background-color: var(--indicator-neutral);
}

/* Strategy Panel Metrics */
.strategy-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 0 24px 24px;
}

.indicator-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  transition: all 0.3s;
}

.indicator-card:hover {
  background: rgba(15, 23, 42, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.indicator-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.2));
  color: var(--secondary-color);
  font-size: 1.2rem;
}

.indicator-info {
  flex: 1;
  min-width: 0;
}

.indicator-title {
  margin: 0 0 5px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.indicator-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.strategy-status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.position-long {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--indicator-positive);
}

.position-short {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--indicator-negative);
}

/* Risk Management Card */
.risk-management-card {
  height: fit-content;
}

.risk-visualizer {
  padding: 30px 24px;
}

.price-scale {
  height: 250px;
  width: 60px;
  position: relative;
  margin: 0 auto 30px;
  background: linear-gradient(to bottom, var(--indicator-positive), var(--primary-color), var(--indicator-negative));
  border-radius: 100px;
}

.price-point {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
}

.price-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--bg-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  z-index: 2;
  margin-left: -8px;
}

.price-label {
  position: absolute;
  left: calc(100% + 15px);
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 500;
}

.price-point.take-profit .price-marker {
  background-color: var(--indicator-positive);
}

.price-point.entry .price-marker {
  background-color: white;
  width: 20px;
  height: 20px;
  margin-left: -10px;
}

.price-point.stop-loss .price-marker {
  background-color: var(--indicator-negative);
}

.risk-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.risk-metric {
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
}

.risk-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.risk-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

/* Strategy Configuration */
.strategy-config {
  margin: 0 24px 24px;
}

.config-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-color-secondary);
  margin: 0 0 15px 0;
}

.config-title i {
  color: var(--secondary-color);
}

.config-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 5px;
}

.config-tabs::-webkit-scrollbar {
  display: none;
}

.config-tab {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
  white-space: nowrap;
}

.config-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.config-tab.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

.config-tab-panel {
  display: none;
}

.config-tab-panel.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.config-group {
  margin-bottom: 15px;
}

.config-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.config-input {
  width: 100%;
  padding: 10px 15px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.95rem;
  transition: all 0.3s;
}

.config-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

.input-with-tooltip {
  position: relative;
}

.tooltip {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: help;
}

.tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: rgba(15, 23, 42, 0.95);
  color: var(--text-color);
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-90%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  pointer-events: none;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 90%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.config-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

/* Toggle Switch */
.toggle-switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background: var(--primary-gradient);
}

input:focus + .switch-slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .switch-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  font-size: 0.95rem;
  color: var(--text-color);
}

/* Logs Container */
.logs-container {
  background-color: rgba(15, 23, 42, 0.7);
  color: #f0f0f0;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  font-family: 'Fira Code', monospace, sans-serif;
  font-size: 0.9rem;
  margin: 0 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.logs-container::-webkit-scrollbar {
  width: 6px;
}

.logs-container::-webkit-scrollbar-track {
  background: transparent;
}

.logs-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

.log-entry {
  margin-bottom: 8px;
  line-height: 1.5;
  word-break: break-word;
  display: flex;
  align-items: flex-start;
}

.log-time {
  color: #888;
  margin-right: 8px;
  flex-shrink: 0;
}

.log-info {
  color: #f0f0f0;
}

.log-warning {
  color: var(--warning-color);
}

.log-error {
  color: var(--indicator-negative);
}

.log-success {
  color: var(--indicator-positive);
}

.log-buy {
  color: #00c853;
  font-weight: bold;
}

.log-sell {
  color: #ff5252;
  font-weight: bold;
}

.log-exit {
  color: #00b0ff;
  font-weight: bold;
}

.log-signal {
  color: #8B5CF6;
}

.log-ai {
  color: #06B6D4;
}

.log-entry i {
  margin-right: 5px;
}

/* Filter Controls */
.filter-controls {
  position: relative;
}

.log-filter {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 30px 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.log-filter:focus {
  outline: none;
  border-color: var(--primary-color);
}

.filter-controls:after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .strategy-summary {
    flex-direction: column;
  }
  
  .strategy-performance {
    width: 100%;
  }
  
  .strategy-panel {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .strategy-panel {
    grid-template-columns: 1fr;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .card-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .config-tab-panel.active {
    grid-template-columns: 1fr;
  }
  
  .risk-metrics {
    grid-template-columns: 1fr;
  }
  
  .risk-visualizer {
    padding: 20px 15px;
  }
  
  .price-scale {
    margin: 0 auto 50px;
  }
  
  .price-label {
    font-size: 0.8rem;
  }
  
  .notification-card {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .notification-card .notification-icon {
    margin-right: 0;
  }
  
  .notification-card .notification-action {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .config-actions {
    flex-direction: column;
  }
  
  .chart-period-selector {
    overflow-x: auto;
    padding-bottom: 5px;
  }
  
  .chart-period {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}