/**
 * Backtesting Calculator Styles
 */

/* Calculator Section Styling */
.calc-section {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.calc-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.section-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 30px;
  border-bottom: 3px solid #5568d3;
  overflow: hidden;
}

.section-header i {
  font-size: 24px;
  margin-right: 10px;
  vertical-align: middle;
}

.section-header h2 {
  display: inline-block;
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 50px);
}

.section-body {
  padding: 30px;
  overflow: visible;
}

/* Execution Speed Grid Layout */
.execution-speed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.speed-input-group {
  min-width: 0;
}

.speed-input-group .form-group {
  margin-bottom: 0;
}

/* Form Styling */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  font-size: 14px;
  display: block;
  width: 100%;
  position: relative;
  z-index: 1;
  background: white;
  padding: 5px 0;
}

.form-control {
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 15px;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
  position: relative;
  z-index: 2;
}

.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
  outline: none;
}

/* Results Box */
.result-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 25px;
  margin-top: 20px;
  border: 2px solid #e9ecef;
}

.result-box h4 {
  color: #495057;
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 18px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #dee2e6;
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 500;
  color: #495057;
  font-size: 15px;
}

.result-value {
  font-weight: 600;
  color: #667eea;
  font-size: 16px;
  text-align: right;
}

.result-item.highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin: 15px -25px -25px -25px;
  padding: 20px 25px;
  border-radius: 0 0 6px 6px;
}

.result-item.highlight .result-label,
.result-item.highlight .result-value {
  color: white;
  font-size: 18px;
}

/* Button Styling */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5568d3 0%, #6a3d94 100%);
}

.btn-primary i {
  margin-right: 8px;
}

/* Alert Styling */
.alert {
  border-radius: 8px;
  border-left: 4px solid;
  padding: 15px 20px;
}

.alert-info {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
  color: #0d47a1;
}

.alert-warning {
  background-color: #fff3e0;
  border-left-color: #ff9800;
  color: #e65100;
}

.alert i {
  margin-right: 8px;
}

.alert ul {
  margin-top: 10px;
  padding-left: 20px;
}

.alert ul li {
  margin-bottom: 5px;
}

/* Page Header */
.page-header {
  padding: 40px 0;
}

.page-header .title {
  color: #2c3e50;
  font-weight: 700;
  margin-bottom: 15px;
}

.page-header .title i {
  color: #667eea;
  margin-right: 15px;
}

.page-header .lead {
  color: #7f8c8d;
  font-size: 18px;
}

/* Checkbox Styling */
.form-check {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-top: 15px;
}

.form-check-input {
  width: 20px;
  height: 20px;
  margin-top: 0.15em;
}

.form-check-label {
  margin-left: 10px;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-header {
    padding: 15px 20px;
  }

  .section-header h2 {
    font-size: 16px;
    max-width: calc(100% - 40px);
  }

  .section-header i {
    font-size: 20px;
  }

  .section-body {
    padding: 20px;
  }

  .execution-speed-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .result-box {
    padding: 20px;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-value {
    text-align: left;
    margin-top: 5px;
    word-break: break-word;
  }

  .page-header .title {
    font-size: 28px;
  }

  .page-header .lead {
    font-size: 16px;
  }

  /* Allow form labels to wrap on mobile */
  .form-group label {
    white-space: normal;
    word-wrap: break-word;
  }
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Transitions */
* {
  transition: background-color 0.3s ease;
}

/* Select Dropdown */
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  
  /* --- FIX START --- */
  height: auto !important; /* Overrides Bootstrap's fixed height */
  line-height: 1.5;        /* Ensures text is vertically centered */
  /* --- FIX END --- */
}
/* Number Input Arrows */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
