/* style.css */

:root {
  --bg-color: #101820;
  --surface-color: #1e1e1e;
  --primary-color: #0CD4A0;
  --primary-hover-color: #0AB889;
  --text-color: #e0e0e0;
  --text-secondary-color: #a0a0a0;
  --border-color: #333;
  --error-color: #ff5252;
  --success-color: #10B981;
  --font-family: 'Inter', sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
}

header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 32px;
  height: 32px;
}

.back-link {
  color: var(--text-secondary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

h1 {
  color: #fff;
  font-weight: 700;
  margin: 0;
  font-size: 1.5rem;
}

h2 {
  color: var(--text-secondary-color);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-top: 0;
}

.container {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.sidebar {
  flex: 1;
  min-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.main-content {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

section {
  background-color: var(--surface-color);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

/* Controls and Options Section */
#controls-and-options {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 0;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary-color);
}

.option-group input[type="date"],
.option-group input[type="number"],
.option-group select {
  width: 100%;
  background-color: #2a2a2a;
  border: 1px solid #444;
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 4px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.option-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

.option-group input:focus,
.option-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(12, 212, 160, 0.5);
}

/* Action Button Section */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#analyze-btn {
  background-color: var(--primary-color);
  color: #003329;
  font-weight: 500;
  font-size: 1rem;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

#analyze-btn:hover:not(:disabled) {
  background-color: var(--primary-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#analyze-btn:disabled {
  background-color: #555;
  color: #999;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

#upload-btn {
  background-color: #444;
  color: var(--text-secondary-color);
  font-weight: 500;
  font-size: 1rem;
  border: 1px solid #555;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  width: 100%;
}

#upload-btn:hover:not(:disabled) {
  background-color: #555;
  border-color: #777;
}

#upload-btn:disabled {
  background-color: #333;
  color: #777;
  cursor: not-allowed;
  border-color: #444;
}

/* Action Status Container */
.action-status {
  display: none;
  padding: 0.75rem 0rem 0rem 0rem;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.action-status.is-visible {
  display: flex;
}

.action-status p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary-color);
  transition: color 0.3s ease;
}

.action-status.is-error {
  background-color: rgba(255, 82, 82, 0.1);
}

.action-status.is-error p {
  color: var(--error-color);
}

.action-status.is-success p {
  color: var(--primary-hover-color);
}

#assets-list-container {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;
}

#assets-list,
#selected-assets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#assets-list li,
#selected-assets li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background-color: #2a2a2a;
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}

#assets-list li:hover,
#selected-assets li:hover {
  background-color: #333;
  border-color: #444;
}

.list-action-btn {
  background: #444;
  border: none;
  color: var(--text-secondary-color);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  font-family: monospace;
}

#assets-list li:hover .list-action-btn.add-btn,
.list-action-btn.add-btn:hover {
  background-color: var(--primary-color);
  color: #003329;
}

#selected-assets li:hover .list-action-btn.remove-btn,
.list-action-btn.remove-btn:hover {
  background-color: var(--error-color);
  color: #fff;
}

#add-all-btn,
#remove-all-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.6rem;
  background-color: #333;
  color: var(--text-secondary-color);
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

#add-all-btn:hover:not(:disabled) {
  background-color: #2c5c4c;
  border-color: var(--primary-color);
  color: #fff;
}

#remove-all-btn:hover:not(:disabled) {
  background-color: #5c2c2c;
  border-color: var(--error-color);
  color: #fff;
}

#add-all-btn:disabled,
#remove-all-btn:disabled {
  background-color: #2a2a2a;
  color: #666;
  cursor: not-allowed;
  border-color: #333;
}

.chart-container {
  position: relative;
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 0;
}

#equity-chart {
  height: 400px !important;
}

.chart-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #444;
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 1;
}

.chart-placeholder.is-hidden {
  opacity: 0;
}

/* Chart Toggles */
#chart-toggles-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 2rem;
  padding-top: 1rem;
}

#chart-toggles-container .checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

#chart-toggles-container input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary-color);
  cursor: pointer;
  margin: 0;
}

#chart-toggles-container label {
  cursor: pointer;
  font-size: 0.9rem;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-link {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border: none;
  background-color: transparent;
  color: var(--text-secondary-color);
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

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

.tab-link.active {
  color: var(--primary-hover-color);
  border-bottom-color: var(--primary-hover-color);
}

.tab-content {
  display: none;
}

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

/* Metrics */
.metric-category {
  background-color: #2a2a2a;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.metric-category:last-child {
  margin-bottom: 0;
}

.metric-category h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-color);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem 4rem;
}

.metric-grid p {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.metric-grid p strong {
  color: var(--text-secondary-color);
  font-size: 0.9em;
  font-weight: 400;
  white-space: nowrap;
}

.metric-grid p span {
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Courier New', Courier, monospace;
  text-align: right;
}

.hidden {
  display: none;
}

.loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.loader.show {
  display: block;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Custom Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.is-visible {
  display: flex;
}

.modal-content {
  background-color: var(--surface-color);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary-color);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-color);
}

.modal-content h2 {
  margin-top: 0;
  color: var(--text-color);
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.modal-content p {
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
  color: var(--text-secondary-color);
}

.modal-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  background-color: #2a2a2a;
  border-radius: 4px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
}

.modal-content ul li {
  padding: 0.5rem 0.75rem;
  font-family: 'Courier New', Courier, monospace;
  color: var(--text-color);
  border-bottom: 1px solid #3a3a3a;
}

.modal-content ul li:last-child {
  border-bottom: none;
}

/* Email Gate Modal Styles */
.email-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(16, 24, 32, 0.95) 0%, rgba(30, 30, 30, 0.98) 100%);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.email-gate-modal {
  background: linear-gradient(145deg, #1e1e1e 0%, #2a2a2a 100%);
  border: 1px solid rgba(12, 212, 160, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(12, 212, 160, 0.1);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.email-gate-content {
  padding: 2rem;
}

.email-gate-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(12, 212, 160, 0.2);
}

.email-gate-header .logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.email-gate-header .logo {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 10px rgba(12, 212, 160, 0.3));
}

.email-gate-header h2 {
  color: var(--primary-color);
  margin: 0;
  border: none;
  padding: 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color) 0%, #4EEDC4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.email-gate-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.benefits-section h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.subtitle {
  color: var(--text-secondary-color);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.feature-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(12, 212, 160, 0.05);
  border: 1px solid rgba(12, 212, 160, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(12, 212, 160, 0.08);
  border-color: rgba(12, 212, 160, 0.2);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 212, 160, 0.1);
  border-radius: 6px;
}

.feature-content h4 {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.feature-content p {
  color: var(--text-secondary-color);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.value-proposition {
  background: linear-gradient(135deg, rgba(12, 212, 160, 0.1) 0%, rgba(12, 212, 160, 0.05) 100%);
  border: 1px solid rgba(12, 212, 160, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.value-highlight {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.value-label {
  color: var(--text-secondary-color);
  font-size: 0.9rem;
  text-decoration: line-through;
}

.value-price {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 700;
}

.value-description {
  color: var(--text-secondary-color);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.form-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2rem;
}

.email-gate-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
}

.email-gate-input {
  padding: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.email-gate-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(12, 212, 160, 0.1);
  background: rgba(0, 0, 0, 0.5);
}

.email-gate-input.error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.1);
}

.checkbox-group {
  margin: 0.5rem 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-input {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: transparent;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.3s ease;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #003329;
  font-weight: bold;
  font-size: 12px;
}

.checkbox-text {
  color: var(--text-secondary-color);
  font-size: 0.9rem;
  line-height: 1.5;
}

.email-gate-button {
  background: linear-gradient(135deg, var(--primary-color) 0%, #4EEDC4 100%);
  color: #003329;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.email-gate-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(12, 212, 160, 0.3);
}

.email-gate-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.button-spinner {
  animation: spin 1s linear infinite;
  display: inline-block;
}

.email-gate-error {
  color: var(--error-color);
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem;
  border-radius: 4px;
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.2);
  margin-top: 0.5rem;
}

.email-gate-error:empty {
  display: none;
}

.trust-indicators {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trust-icon {
  font-size: 1rem;
  opacity: 0.8;
}

.trust-text {
  color: var(--text-secondary-color);
  font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 1rem;
  }
  
  .sidebar {
    min-width: auto;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 2rem;
  }

  .email-gate-modal {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }

  .email-gate-content {
    padding: 1.5rem;
  }

  .email-gate-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .email-gate-header h2 {
    font-size: 1.5rem;
  }

  .features-grid {
    gap: 1rem;
  }

  .feature-item {
    padding: 0.75rem;
  }

  .form-section {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
  
  .email-gate-header .logo-section {
    flex-direction: column;
    gap: 0.5rem;
  }

  .value-highlight {
    flex-direction: column;
    gap: 0.5rem;
  }

  .trust-indicators {
    gap: 0.5rem;
  }
}