/**
 * Account Dashboard Styles
 */

.dtd-account-dashboard {

  min-height: calc(100vh - 200px);
}

.account-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

#address-form .input-group{
  margin-bottom: 25px;
}

#address-form .btn{
    padding-left: 50px;
    padding-right: 50px;
}

/* SIDEBAR */
.account-sidebar {
  background: white;
  border-radius: 12px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 100px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.account-user-card {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e8e8e8;
}

.user-avatar-wrapper {
    display: flex;
    justify-content: center;
  margin-bottom: 16px;
}

.user-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #5ABC15;
}

.woocommerce-MyAccount-navigation{
    display: none;
}

.user-name {
  margin: 12px 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.user-email {
  margin: 0;
  font-size: 13px;
  color: #666;
}

/* Меню */
.account-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.account-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.account-menu-link:hover {
  background: rgba(90, 188, 21, 0.1);
  color: #5ABC15;
}

.account-menu-link.active {
  background: linear-gradient(135deg, #5ABC15 0%, #4a9611 100%);
  color: white;
}

.account-menu-link i {
  font-size: 18px;
}

/* Кнопки действия */
.account-actions {
  display: flex;
  gap: 8px;
}

.account-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* MAIN CONTENT */
.account-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.account-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.account-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e8e8e8;
}

.section-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}



.profile-photo-block {
  margin-bottom: 32px;
  text-align: center;
}

.photo-upload-wrapper {
  display: inline-block;
  position: relative;
  margin-bottom: 16px;
}

.photo-preview {
  margin-bottom: 12px;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid #5ABC15;
  display: block;
  margin: 0 auto;
}

.photo-upload-label {
  display: inline-block;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(90, 188, 21, 0.1);
  color: #5ABC15;
  border: 2px dashed #5ABC15;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.upload-btn:hover {
  background: #5ABC15;
  color: white;
}

.form-section-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-col {
  flex: 1;
}

.input-group {
  margin-bottom: 0;
}

.input-group__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.input-group__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.input-group__input:focus {
  outline: none;
  border-color: #5ABC15;
  box-shadow: 0 0 0 3px rgba(90, 188, 21, 0.1);
}

.input-group__input:disabled {
  background: #f5f5f5;
  color: #999;
}

.input-group small {
  display: block;
  margin-top: 4px;
  color: #999;
  font-size: 12px;
}

/* Notifications */
.notifications-block {
  margin: 32px 0;
  padding: 24px;
  background: rgba(90, 188, 21, 0.05);
  border-radius: 8px;
  border-left: 4px solid #5ABC15;
}

.notifications-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.notification-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.notification-checkbox input {
  display: none;
}

.checkbox-custom {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-checkbox input:checked ~ .checkbox-custom {
  background: #5ABC15;
  border-color: #5ABC15;
}

.notification-checkbox input:checked ~ .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1a1a1a;
  font-weight: 500;
}

.checkbox-label i {
  color: #5ABC15;
  font-size: 16px;
}

/* Danger Zone */
.danger-zone {
  margin: 32px 0;
  padding: 24px;
  background: rgba(225, 69, 69, 0.05);
  border-radius: 8px;
  border-left: 4px solid #E14545;
}

.danger-text {
  margin: 0 0 16px;
  color: #E14545;
  font-size: 14px;
}

.btn--danger {
  background: #E14545;
  color: white;
  border: none;
}

.btn--danger:hover {
  background: #d63a3a;
}

.form-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.profile-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

.profile-message.success {
  background: rgba(39, 174, 96, 0.1);
  color: #27AE60;
  border: 1px solid #27AE60;
}

.profile-message.error {
  background: rgba(225, 69, 69, 0.1);
  color: #E14545;
  border: 1px solid #E14545;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ADDRESSES SECTION */
.addresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.address-card {
  background: white;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
}

.address-card:hover {
  border-color: #5ABC15;
  box-shadow: 0 4px 12px rgba(90, 188, 21, 0.15);
}

.address-card.primary {
  border-top: 4px solid #5ABC15;
}

.address-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.address-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.badge-primary {
  display: inline-block;
  padding: 4px 12px;
  background: #5ABC15;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.address-content {
  margin-bottom: 16px;
  min-height: 60px;
}

.address-street,
.address-city,
.address-postal {
  margin: 4px 0;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.address-empty {
  color: #999;
  font-size: 14px;
  font-style: italic;
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
}

/* Address Modal */
.address-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.address-modal.is-active {
  display: flex !important;
}

.address-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.address-modal__content {
  position: relative;
  z-index: 1001;
  max-width: 500px;
  width: 100%;
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
}

.modal__close:hover {
  color: #1a1a1a;
}

/* ORDERS SECTION */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.order-card:hover {
  border-color: #5ABC15;
  box-shadow: 0 4px 12px rgba(90, 188, 21, 0.1);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}

.order-number {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.order-date {
  display: block;
  font-size: 12px;
  color: #999;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge--completed,
.badge--processing {
  background: rgba(39, 174, 96, 0.1);
  color: #27AE60;
}

.badge--pending {
  background: rgba(255, 193, 7, 0.1);
  color: #FFC107;
}

.badge--cancelled {
  background: rgba(225, 69, 69, 0.1);
  color: #E14545;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.order-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  font-size: 14px;
  color: #555;
  align-items: center;
}

.item-name {
  font-weight: 500;
}

.item-qty {
  text-align: center;
}

.item-price {
  font-weight: 600;
  color: #5ABC15;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
}

.order-total {
  font-size: 14px;
}

.order-total strong {
  color: #1a1a1a;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state i {
  font-size: 64px;
  color: #e8e8e8;
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1a1a1a;
}

.empty-state p {
  margin: 0 0 24px;
  font-size: 14px;
}

/* BONUSES SECTION */
.bonus-history {
  margin-top: 32px;
}

.section-subtitle {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.bonus-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bonus-entry {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  align-items: start;
}

.entry-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.entry-icon.earned {
  background: rgba(39, 174, 96, 0.1);
  color: #27AE60;
}

.entry-icon.spent {
  background: rgba(225, 69, 69, 0.1);
  color: #E14545;
}

.entry-title {
  margin: 0 0 4px;
  font-weight: 600;
  color: #1a1a1a;
}

.entry-description {
  margin: 0 0 4px;
  font-size: 12px;
  color: #666;
}

.entry-date {
  margin: 0;
  font-size: 11px;
  color: #999;
}

.entry-amount {
  text-align: right;
  font-weight: 700;
  font-size: 16px;
}

.entry-amount.earned {
  color: #27AE60;
}

.entry-amount.spent {
  color: #E14545;
}

.bonus-rules {
  margin-top: 32px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.rule-card {
  padding: 20px;
  background: linear-gradient(135deg, rgba(90, 188, 21, 0.05) 0%, rgba(90, 188, 21, 0.02) 100%);
  border: 1px solid rgba(90, 188, 21, 0.1);
  border-radius: 8px;
  text-align: center;
}

.rule-icon {
  font-size: 32px;
  color: #5ABC15;
  margin-bottom: 12px;
  display: block;
}

.rule-card h5 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #1a1a1a;
}

.rule-card p {
  margin: 0;
  font-size: 13px;
  color: #666;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .account-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .account-sidebar {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
  }

  .account-user-card {
    grid-column: 1 / -1;
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
  }

  .account-menu {
    grid-column: 1 / -1;
    flex-direction: row;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .account-menu-link {
    flex: 1;
    min-width: 120px;
  }

  .account-content {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .notifications-grid {
    grid-template-columns: 1fr;
  }

  .addresses-grid {
    grid-template-columns: 1fr;
  }

  .order-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .item-qty,
  .item-price {
    display: inline;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }
}
