/* Enhanced styling for Settings page buttons */

/* Normal state styles for Change Password button */
body.dark.settings-page .settings-btn:not(.danger) {
  background: #1a1a2e !important;
  color: #ffffff !important;
  border: 1px solid #3d3d54 !important;
  transition: all 0.3s ease !important;
}

body.dark.settings-page .settings-btn:not(.danger):hover {
  background: #25254a !important;
  box-shadow: 0 0 8px rgba(33, 156, 179, 0.4) !important;
}

/* Theme Mode Buttons - Dark Mode */
body.dark.settings-page .theme-btn.light,
body.dark.settings-page .theme-btn.system {
  background: #1a1a2e !important;
  color: #ffffff !important;
  border: 1px solid #3d3d54 !important;
}

body.dark.settings-page .theme-btn.light:hover,
body.dark.settings-page .theme-btn.system:hover {
  background: #25254a !important;
  box-shadow: 0 0 8px rgba(33, 156, 179, 0.4) !important;
}

/* Keep icons visible */
body.dark.settings-page .theme-btn.light i,
body.dark.settings-page .theme-btn.system i {
  color: #ffffff !important;
}

/* Normal state styles for Delete Account button */
body.dark.settings-page .settings-btn.danger {
  background: #6b0f0f !important;
  color: #ffffff !important;
  border: 1px solid #8a1c1c !important;
  transition: all 0.3s ease !important;
}

body.dark.settings-page .settings-btn.danger:hover {
  background: #8a1c1c !important;
  box-shadow: 0 0 8px rgba(138, 28, 28, 0.5) !important;
}

/* Maintain button structure */
body.dark.settings-page .settings-btn {
  display: inline-block !important;
  text-decoration: none !important;
  padding: 8px 14px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  margin-right: 10px !important;
  margin-bottom: 10px !important;
}

/* Icon styling for dark mode buttons */
body.dark.settings-page .settings-btn i {
  margin-right: 6px !important;
}

/* ============================
   SETTINGS MODALS
   ============================ */
.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.settings-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.settings-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

.settings-modal.orders-modal {
  max-width: 600px;
}

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

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.settings-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #333;
}

.settings-modal-header h3 i {
  color: #3f51b5;
}

.settings-modal-header .close-modal {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.settings-modal-header .close-modal:hover {
  background: #f5f5f5;
  color: #333;
}

.settings-modal-content {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.settings-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-modal-footer .btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-modal-footer .btn.primary {
  background: linear-gradient(120deg, #3f51b5, #5c6bc0);
  color: #fff;
}

.settings-modal-footer .btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

.settings-modal-footer .btn.secondary {
  background: #f5f5f5;
  color: #333;
}

.settings-modal-footer .btn.secondary:hover {
  background: #e0e0e0;
}

/* Form Styles */
.settings-modal .form-group {
  margin-bottom: 16px;
}

.settings-modal .form-row {
  display: flex;
  gap: 16px;
}

.settings-modal .form-row .form-group {
  flex: 1;
}

.settings-modal .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}

.settings-modal .form-group input,
.settings-modal .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.settings-modal .form-group input:focus,
.settings-modal .form-group textarea:focus {
  outline: none;
  border-color: #3f51b5;
}

.settings-modal .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Location Badge */
.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.location-badge i {
  font-size: 14px;
}

/* Select Dropdown */
.settings-modal .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}

.settings-modal .form-group select:focus {
  outline: none;
  border-color: #3f51b5;
}

body.dark .settings-modal .form-group select,
body.dark-mode .settings-modal .form-group select {
  background: #25254a;
  border-color: #333;
  color: #e0e0e0;
}

body.dark .settings-modal .form-group select option,
body.dark-mode .settings-modal .form-group select option {
  background: #1a1a2e;
  color: #e0e0e0;
}

body.dark .settings-modal .form-group select optgroup,
body.dark-mode .settings-modal .form-group select optgroup {
  background: #25254a;
  color: #aaa;
}

/* Saved Address Display */
.saved-address {
  line-height: 1.8;
  color: #333;
}

.saved-address > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.saved-address i {
  color: #5c6bc0;
  width: 16px;
  text-align: center;
  margin-top: 3px;
}

.saved-address strong {
  color: #3f51b5;
}

.saved-address em {
  font-style: italic;
  color: #666;
}

.saved-address .addr-name {
  font-size: 15px;
}

.saved-address .addr-area {
  color: #16a34a;
  font-weight: 500;
}

body.dark .saved-address .addr-area,
body.dark-mode .saved-address .addr-area {
  color: #4ade80;
}

/* No Orders State */
.no-orders {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.no-orders i {
  font-size: 48px;
  margin-bottom: 16px;
  color: #ddd;
}

.no-orders p {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 8px;
  color: #666;
}

.no-orders span {
  font-size: 14px;
}

/* Order Card */
.order-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #eee;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.order-id {
  font-weight: 600;
  color: #3f51b5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.order-status.status-success {
  background: #dcfce7;
  color: #16a34a;
}

.order-status.status-pending {
  background: #fef3c7;
  color: #d97706;
}

.order-status.status-failed {
  background: #fee2e2;
  color: #dc2626;
}

.order-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #666;
}

.order-details > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-details i {
  color: #999;
}

.order-items-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddd;
  font-size: 13px;
  color: #666;
}

.order-items-preview .item-name {
  display: inline-block;
  background: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  margin-right: 6px;
  margin-bottom: 4px;
}

.order-items-preview .more-items {
  color: #3f51b5;
  font-weight: 500;
}

/* Dark Mode */
body.dark .settings-modal,
body.dark-mode .settings-modal {
  background: #1a1a2e;
  color: #e0e0e0;
}

body.dark .settings-modal-header,
body.dark-mode .settings-modal-header {
  border-bottom-color: #333;
}

body.dark .settings-modal-header h3,
body.dark-mode .settings-modal-header h3 {
  color: #e0e0e0;
}

body.dark .settings-modal-header h3 i,
body.dark-mode .settings-modal-header h3 i {
  color: #5c6bc0;
}

body.dark .settings-modal-header .close-modal,
body.dark-mode .settings-modal-header .close-modal {
  color: #999;
}

body.dark .settings-modal-header .close-modal:hover,
body.dark-mode .settings-modal-header .close-modal:hover {
  background: #25254a;
  color: #fff;
}

body.dark .settings-modal-footer,
body.dark-mode .settings-modal-footer {
  border-top-color: #333;
}

body.dark .settings-modal-footer .btn.secondary,
body.dark-mode .settings-modal-footer .btn.secondary {
  background: #25254a;
  color: #e0e0e0;
}

body.dark .settings-modal .form-group label,
body.dark-mode .settings-modal .form-group label {
  color: #e0e0e0;
}

body.dark .settings-modal .form-group input,
body.dark .settings-modal .form-group textarea,
body.dark-mode .settings-modal .form-group input,
body.dark-mode .settings-modal .form-group textarea {
  background: #25254a;
  border-color: #333;
  color: #e0e0e0;
}

body.dark .saved-address,
body.dark-mode .saved-address {
  color: #e0e0e0;
}

body.dark .order-card,
body.dark-mode .order-card {
  background: #25254a;
  border-color: #333;
}

body.dark .order-details,
body.dark-mode .order-details {
  color: #aaa;
}

body.dark .order-items-preview,
body.dark-mode .order-items-preview {
  border-top-color: #333;
  color: #aaa;
}

body.dark .order-items-preview .item-name,
body.dark-mode .order-items-preview .item-name {
  background: #1a1a2e;
}

body.dark .no-orders,
body.dark-mode .no-orders {
  color: #666;
}

body.dark .no-orders p,
body.dark-mode .no-orders p {
  color: #aaa;
}

/* Responsive */
@media (max-width: 576px) {
  .settings-modal {
    max-height: 90vh;
    border-radius: 12px;
  }
  
  .settings-modal-header {
    padding: 16px 18px;
  }
  
  .settings-modal-content {
    padding: 16px 18px;
  }
  
  .settings-modal-footer {
    padding: 14px 18px;
  }
  
  .settings-modal .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .order-details {
    flex-direction: column;
    gap: 8px;
  }
}
