@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');

:root {
  --bg-color: #F8F9FA; /* Softer, more premium background */
  --panel-bg: #FFFFFF;
  --panel-border: #E5E7EB;
  --panel-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  --primary: #0A66C2; /* LinkedIn/Enterprise Blue */
  --primary-hover: #084E96;
  --text-main: #111827;
  --text-muted: #6B7280;
  --success: #10B981;
  --danger: #EF4444;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 13px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  max-width: 1440px; /* Bootstrap-like wide container */
  padding: 32px 24px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding: 0 32px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-ash {
  color: var(--primary);
  font-weight: 700;
}

.header-status {
  background: #DFF6DD;
  color: var(--success);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #107C10;
}

/* Main Layout */
.app-content {
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

/* Glass Panels -> Solid Windows Panels */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--panel-shadow);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

/* Form Styles */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-main);
  margin-bottom: 4px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input[type="number"], input[type="text"], input[type="date"], select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
  background: #F9FAFB;
  transition: all 0.2s ease;
}

input[type="number"]:focus, input[type="text"]:focus, input[type="date"]:focus, select:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.help-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Drag & Drop Zone */
.file-upload {
  border: 1px dashed #8A8886;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  background: #FAFAFA;
}

.file-upload:hover, .file-upload.dragover {
  border-color: var(--primary);
  background: #F3F2F1;
}

.file-upload input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-main);
  pointer-events: none;
}

/* Toggles -> Standard Checkboxes */
.toggle-group {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border: none;
}

.toggle-label {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  cursor: pointer;
}

.toggle-label span:first-child {
  font-weight: 400;
  font-size: 13px;
}

.toggle-label input {
  display: inline-block !important;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  accent-color: var(--primary);
}

.toggle-switch {
  display: none !important;
}

/* Flat Sections */
.config-section-flat {
  margin-bottom: 20px;
  background: #FAFAFA;
  border-radius: var(--radius-sm);
  border: 1px solid #E1DFDD;
  padding: 16px;
}
.config-section-flat h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid #E1DFDD;
}

/* Buttons */
button {
  font-family: var(--font-family);
}

.primary-btn, .secondary-btn {
  width: 100%;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  height: 38px;
  transition: all 0.2s ease;
}

.primary-btn {
  background: var(--primary);
  color: #FFFFFF;
  border: 1px solid transparent;
}

.primary-btn:hover { 
  background: var(--primary-hover); 
}

.secondary-btn {
  background: #FFFFFF;
  color: #323130;
  border: 1px solid #8A8886;
}

.secondary-btn:hover { 
  background: #F3F2F1; 
}

.primary-btn:active, .secondary-btn:active { 
  opacity: 0.8;
}

.primary-btn:disabled, .secondary-btn:disabled { 
  background: #F3F2F1;
  color: #A19F9D;
  border: 1px solid #E1DFDD;
  cursor: not-allowed; 
}

/* Results Panel */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 4px solid var(--primary);
}

.metric-card::before {
  display: none;
}

.metric-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.metric-value {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-main);
}

.metric-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.highlight { color: var(--success); }
.danger { color: var(--danger); }

/* Chart Container */
.chart-container {
  height: 500px;
  position: relative;
  padding: 16px;
}

/* Modal and Tables */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #8A8886;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-body {
  overflow-y: auto;
  padding: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #E1DFDD;
  background: #FAFAFA;
}

.close-btn {
  background: transparent; 
  border: none;
  color: var(--text-main);
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.close-btn:hover { 
  background: #E1DFDD;
}

.table-container {
  overflow-y: auto;
  border: 1px solid #E1DFDD;
}

.opt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.opt-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-main);
  font-weight: 600;
  background: #FAFAFA;
  border-bottom: 1px solid #E1DFDD;
}

.opt-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #E1DFDD;
  color: var(--text-main);
}

.opt-table tr:hover td {
  background: #F3F2F1;
}

/* Responsive */
@media (max-width: 1200px) {
  .app-content {
    grid-template-columns: 280px 1fr;
  }
}

@media (max-width: 1024px) {
  .app-content {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Tabs */
.app-tabs {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  flex: 1;
  height: 100%;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  padding: 0 16px;
  height: 100%;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.tab-btn:hover {
  color: var(--text-light);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

main.tab-content.active {
  display: grid;
}

.tabs-header {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 24px;
}

/* Live Trading specific layouts */
.live-dashboard {
  grid-template-columns: 320px 1fr;
  gap: 24px;
  width: 100%;
}

.live-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.live-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.live-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.live-log-container {
  background: #0a0a0a;
  color: #4ade80;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 12px;
  height: 250px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid #333;
}

.position-card {
  background: rgba(30, 41, 59, 0.7);
  border-left: 4px solid var(--primary);
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.position-card.profit { border-left-color: #107C10; }
.position-card.loss { border-left-color: #D13438; }

.live-pairs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.live-pairs-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
