/* Settings specific styling */

/* Modern Header */
.settings-header {
  margin-bottom: 2rem;
}

.settings-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.settings-header-icon {
  font-size: 2.5rem;
  color: #69b3f7;
  opacity: 0.9;
}

.settings-tab-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1f2d3d;
  margin: 0;
  letter-spacing: -0.02em;
}

.settings-subtitle {
  font-size: 0.95rem;
  color: #6c757d;
  margin: 0.25rem 0 0 0;
}

/* Settings Cards */
.settings-card {
  background: #ffffff;
  border: 1px solid #e5e9ef;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.settings-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e5e9ef;
  font-weight: 600;
  font-size: 0.95rem;
  color: #374151;
}

.settings-card-header i {
  color: #69b3f7;
  font-size: 1rem;
}

.settings-card-body {
  padding: 1.5rem;
}

/* Settings Groups */
.settings-tab-group {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0f3f6;
}

.settings-tab-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-label-container {
  flex: 1;
  padding-right: 1.5rem;
}

.settings-tab-label {
  font-weight: 500;
  font-size: 1rem;
  color: #1f2d3d;
  margin: 0;
  display: block;
}

.settings-description {
  display: block;
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.settings-tab-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

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

.settings-tab-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}

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

.settings-tab-switch input:checked + .settings-tab-slider {
  background-color: #69b3f7;
}

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

.settings-tab-select {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background-color: #f9fafb;
  color: #1f2d3d;
  max-width: 250px;
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8L0.803847 0.5L11.1962 0.5L6 8Z' fill='%231f2d3d'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}

.settings-tab-group select:focus {
  outline: none;
  border-color: #69b3f7;
  box-shadow: 0 0 0 2px rgba(105, 179, 247, 0.3);
}

/* Professional Margin Input Styling */
.settings-margin-input-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 180px;
}

.settings-margin-input-container .settings-tab-input {
  width: 180px;
  text-align: right;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.settings-help-text {
  font-size: 0.75rem;
  color: #6c757d;
  line-height: 1.2;
  text-align: right;
  margin: 0;
  font-style: italic;
  max-width: 180px;
}

/* Paper Trading Section Styles */
.settings-section-divider {
  border-top: 2px solid #e1e8ed;
  margin: 2rem 0 1.5rem 0;
}

.settings-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2d3d;
  margin-bottom: 1.5rem;
}

.settings-input-with-button {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.settings-tab-input {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background-color: #f9fafb;
  color: #1f2d3d;
  width: 200px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-tab-input:focus {
  outline: none;
  border-color: #69b3f7;
  box-shadow: 0 0 0 2px rgba(105, 179, 247, 0.3);
}

.settings-tab-input[type="number"] {
  -moz-appearance: textfield;
}

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

.settings-action-button {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  background-color: #69b3f7;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.settings-action-button:hover {
  background-color: #5a9ae3;
  transform: translateY(-1px);
}

.settings-action-button:active {
  transform: translateY(0);
}

.settings-reset-button {
  background-color: #dc3545;
}

.settings-reset-button:hover {
  background-color: #c82333;
}

/* Settings confirm modal */
#settings-confirm-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}

#settings-confirm-message {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.settings-modal-button {
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#settings-modal-cancel {
    background-color: #6c757d;
}

#settings-modal-cancel:hover {
    background-color: #5a6268;
}

#settings-modal-yes {
    background-color: #007bff;
}

#settings-modal-yes:hover {
    background-color: #0069d9;
}

#settings-button-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Margin Risk Confirmation Modal */
.margin-risk-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.margin-risk-modal-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 580px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideInModal 0.25s ease-out;
}

.margin-risk-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.margin-risk-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.margin-risk-header h3 {
    margin: 0 0 6px 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.margin-risk-subtitle {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 400;
}

.margin-risk-body {
    padding: 24px;
    line-height: 1.55;
}

.margin-risk-section {
    margin-bottom: 22px;
    position: relative;
}

.margin-risk-section h4 {
    color: #2d3748;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    letter-spacing: -0.01em;
}

.margin-risk-section p {
    color: #4a5568;
    margin: 0 0 12px 0;
    font-size: 0.95rem;
}

.margin-risk-list {
    margin: 0;
    padding-left: 18px;
    color: #4a5568;
}

.margin-risk-list li {
    margin-bottom: 10px;
    font-size: 0.94rem;
    position: relative;
}

.margin-risk-list li::marker {
    color: #e74c3c;
}

.margin-risk-list li strong {
    color: #e74c3c;
    font-weight: 600;
}

.margin-risk-warning {
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 100%);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 16px;
    margin-top: 20px;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.1);
}

.margin-risk-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #d97706, #f59e0b);
    border-radius: 6px 6px 0 0;
}

.margin-risk-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
}

.margin-modal-button {
    padding: 11px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 110px;
    position: relative;
    overflow: hidden;
}

.margin-modal-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.margin-modal-button:hover::before {
    left: 100%;
}

.margin-cancel-btn {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(74, 85, 104, 0.2);
}

.margin-cancel-btn:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 85, 104, 0.3);
}

.margin-confirm-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.margin-confirm-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(192, 57, 43, 0.4);
}

.margin-modal-button:active {
    transform: translateY(0);
}

/* About Section Styles */
.settings-about-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.settings-about-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.settings-about-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.settings-about-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.settings-about-info {
  flex: 1;
}

.settings-about-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2d3d;
  margin: 0;
  letter-spacing: -0.01em;
}

.settings-about-tagline {
  font-size: 0.9rem;
  color: #6c757d;
  margin: 0.25rem 0 0.75rem 0;
}

.settings-about-version {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #e5e9ef;
}

.settings-version-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.settings-version-number {
  font-size: 0.9rem;
  font-weight: 600;
  color: #69b3f7;
}

/* Margin Info Display */
.settings-margin-info {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 500px;
}

.settings-margin-info-paper {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border-color: #fde047;
}

.settings-margin-info-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #475569;
  font-size: 0.95rem;
}

.settings-margin-info-header i {
  color: #3b82f6;
  font-size: 1rem;
}

.settings-margin-info-paper .settings-margin-info-header i {
  color: #ca8a04;
}

.settings-margin-info-body {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.settings-margin-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
}

.settings-margin-info-label {
  font-size: 0.9rem;
  color: #64748b;
}

.settings-margin-info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

.settings-margin-info-highlight {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #93c5fd;
  margin-top: 0.25rem;
}

.settings-margin-info-highlight .settings-margin-info-label {
  color: #1e40af;
  font-weight: 500;
}

.settings-margin-info-highlight .settings-margin-info-value {
  color: #1e40af;
}

.settings-margin-info-note {
  font-size: 0.9rem;
  color: #854d0e;
  line-height: 1.5;
  padding: 0.25rem 0;
}