/* Settings Page Styles - Redesigned */

.settings-page {
  min-height: 100vh;
  padding: 20px 16px;
  overflow-y: auto;
  position: relative;
  z-index: 0;
}

.settings-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('assets/image 242.png') center center / cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

.settings-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
  pointer-events: none;
}

.settings-page .settings-container {
  position: relative;
  z-index: 2;
}

.settings-container {
  max-width: 420px;
  margin: 0 auto;
  padding-bottom: 80px;
}

/* Settings Header */
.settings-header {
  text-align: center;
  margin-bottom: 24px;
  padding-top: 40px;
}

.settings-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  font-style: normal;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Settings Section */
.settings-section {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-page .section-title {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  color: #fff !important;
  margin-bottom: 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  letter-spacing: 0.3px !important;
}

/* Bold titles for Account, Reward, Support */
.settings-page .settings-section:nth-child(2) .section-title,
.settings-page .settings-section:nth-child(3) .section-title,
.settings-page .settings-section:nth-child(4) .section-title {
  font-weight: 700 !important;
}

.settings-page .section-icon {
  width: 17px !important;
  height: 17px !important;
  stroke: #fff !important;
}


/* Settings Item */
.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-item:first-of-type {
  padding-top: 0;
}

/* Profile Row */
.settings-page .profile-row {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 12px 0 !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
}

.settings-page .profile-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  justify-content: flex-start !important;
  margin-right: auto !important;
}

.settings-page .profile-picture {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  flex-shrink: 0 !important;
}

.settings-page .profile-picture img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}

.settings-page .profile-initials {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #667eea !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 50% !important;
}

.settings-page .profile-name {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #fff !important;
}

/* Email Row */
.settings-page .email-row {
  display: flex !important;
  gap: 12px !important;
  justify-content: flex-start !important;
  align-items: center !important;
}

.item-icon-svg {
  width: 20px;
  height: 20px;
  stroke: #888;
  flex-shrink: 0;
}

.email-text {
  font-size: 0.9rem;
  color: #888;
}

/* Arrow Items (clickable rows) */
.settings-page .arrow-item {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  cursor: pointer;
  transition: background 0.2s ease;
  margin: 0 -20px;
  padding: 14px 20px !important;
  border-radius: 0;
  flex-wrap: nowrap !important;
}

.arrow-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.arrow-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.settings-page .item-text {
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  color: #fff !important;
  flex: 1 !important;
  text-align: left !important;
}

.settings-page .arrow-icon {
  width: 18px !important;
  height: 18px !important;
  stroke: #666 !important;
  transition: transform 0.2s ease;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.settings-page .arrow-item:hover .arrow-icon {
  stroke: #999 !important;
}

/* Settings Button - Override style.css position: absolute */
.settings-page .settings-btn {
  position: static !important;
  top: auto !important;
  right: auto !important;
  display: inline-flex !important;
  padding: 8px 16px !important;
  background: #2a2a2a !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.settings-page .settings-btn:hover {
  background: #333 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.settings-page .settings-btn:active {
  transform: scale(0.98) !important;
}

/* Redeem Row */
.settings-page .redeem-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.settings-page .redeem-input-new {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 10px 14px !important;
  background: #2a2a2a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-size: 0.9rem !important;
}

.settings-page #redeemBtn {
  display: inline-flex !important;
  flex-shrink: 0 !important;
}

.redeem-input-new::placeholder {
  color: #666;
}

.redeem-input-new:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Ensure redeem button is visible */
#redeemBtn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Redemption History Collapsed */
.redemption-history-list.collapsed {
  display: none;
}

.redemption-history-list:not(.collapsed) {
  display: block;
  padding: 12px 0 0 0;
}

/* Rotate arrow when expanded */
.arrow-item.expanded .arrow-icon {
  transform: rotate(90deg);
}

/* Support Row */
.settings-page .support-row {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
}

/* Buttons */
.secondary-btn {
  padding: 10px 20px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  background: #222;
  border-color: #fff;
  transform: translateY(-2px);
}

.primary-btn {
  padding: 10px 20px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.danger-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.danger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 65, 108, 0.4);
}

.danger-btn-outline {
  padding: 10px 20px;
  background: rgba(255, 65, 108, 0.1);
  color: #ff416c;
  border: 1px solid #ff416c;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.danger-btn-outline:hover {
  background: rgba(255, 65, 108, 0.2);
  transform: translateY(-2px);
}

/* Settings Actions */
.settings-actions {
  margin-top: 40px;
  text-align: center;
}

.back-btn {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  color: #a0a0b0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
}

/* Settings Modal */
.settings-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #111;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #a0a0b0;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Form Group */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

/* Warning Text */
.warning-text {
  color: #ff416c;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 16px;
  background: rgba(255, 65, 108, 0.1);
  border-radius: 8px;
  border-left: 4px solid #ff416c;
  margin-bottom: 20px;
}

/* Support Info */
.support-info {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 4px solid #fff;
}

.support-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #a0a0b0;
}

.support-info a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.support-info a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .settings-page {
    padding: 15px;
  }
  
  .settings-header {
    padding-top: 40px;
    margin-bottom: 30px;
  }
  
  .settings-title {
    font-size: 1.5rem;
  }
  
  .settings-section {
    padding: 20px 16px;
  }
  
  /* Keep row layout on mobile - don't switch to column */
  .settings-page .settings-item {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
  }
  
  .settings-page .profile-row {
    flex-direction: row !important;
  }
  
  .modal-content {
    width: 95%;
  }
  
  .modal-header h2 {
    font-size: 1.3rem;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .settings-title {
    font-size: 1.3rem;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
  
  .item-icon {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
  }
  
  .item-info h3 {
    font-size: 0.95rem;
  }
  
  .item-info p {
    font-size: 0.8rem;
  }
}

/* Redeem Code Styles */
.redeem-code-container {
  flex-direction: column !important;
  align-items: stretch !important;
}

.redeem-input-wrapper {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.redeem-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.redeem-input:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.redeem-input::placeholder {
  color: #6a6a7a;
}

.redeem-btn {
  min-width: 120px;
  white-space: nowrap;
  background: #000 !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.redeem-btn .btn-text {
  color: #fff !important;
}

.redeem-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.redeem-message {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.redeem-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.redeem-message.error {
  display: block;
  background: rgba(255, 65, 108, 0.1);
  color: #ff416c;
  border: 1px solid rgba(255, 65, 108, 0.3);
}

.redeem-message.info {
  display: block;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Redemption History */
.redemption-history-list {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item-info {
  flex: 1;
}

.history-item-code {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.history-item-tires {
  color: #22c55e;
  font-size: 0.85rem;
  font-weight: 600;
}

.history-item-date {
  font-size: 0.8rem;
  color: #a0a0b0;
  margin-top: 4px;
}

.loading-text {
  text-align: center;
  color: #a0a0b0;
  font-size: 0.9rem;
  padding: 20px;
}

.no-history-text {
  text-align: center;
  color: #6a6a7a;
  font-size: 0.9rem;
  padding: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .redeem-input-wrapper {
    flex-direction: column;
  }
  
  .redeem-btn {
    width: 100%;
  }
}
