// WooCommerce Analytics Dashboard Styles
// wooanalytics.scss

// Variables
$primary-color: #008080;
$secondary-color: #10b981;
$danger-color: #ef4444;
$warning-color: #f59e0b;
$success-color: #10b981;
$text-dark: #1f2937;
$text-medium: #6b7280;
$text-light: #9ca3af;
$background-light: #f9fafb;
$background-gradient-start: #f8fafc;
$background-gradient-end: #eff6ff;
$card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
$card-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
$border-radius: 12px;
$border-radius-lg: 16px;

// Mixins
@mixin card {
  border-radius: $border-radius-lg;
  box-shadow: $card-shadow-lg;
  padding: 2rem;
}

@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@mixin transition {
  transition: all 0.3s ease;
}

// Main Container
.woo-analytics-container {
  min-height: 100vh;
  background: linear-gradient(135deg, $background-gradient-start 0%, $background-gradient-end 100%);
  padding: 2rem;

  @media (max-width: 768px) {
    padding: 1rem;
  }
}

// Dashboard Wrapper
.woo-analytics-dashboard {
  max-width: 1400px;
  margin: 0 auto;
}

// Loading State
.analytics-loading {
  @include card;
  text-align: center;
  padding: 3rem;

  .loading-content {
    max-width: 500px;
    margin: 0 auto;

    h3 {
      font-size: 1.75rem;
      font-weight: 700;
      color: $text-dark;
      margin-bottom: 0.5rem;
    }

    p {
      color: $text-medium;
      margin-bottom: 2rem;
    }
  }

  .loading-spinner {
    @include flex-center;
    margin-bottom: 1.5rem;
    position: relative;
    width: 64px;
    height: 64px;
    margin-left: auto;
    margin-right: auto;

    .spinner-ring {
      position: absolute;
      width: 64px;
      height: 64px;
      border: 4px solid #e5e7eb;
      border-top-color: $primary-color;
      border-radius: 50%;
      animation: spin 1s linear infinite;

      &:nth-child(2) {
        width: 52px;
        height: 52px;
        border-top-color: $secondary-color;
        animation-delay: 0.15s;
      }

      &:nth-child(3) {
        width: 40px;
        height: 40px;
        border-top-color: $warning-color;
        animation-delay: 0.3s;
      }
    }
  }

  .loading-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    .step {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem;
      border-radius: $border-radius;
      @include transition;

      &.completed {
        background: #dcfce7;

        .step-number {
          background: $success-color;
          color: white;

          &::after {
            content: '✓';
          }
        }
      }

      &.active {
        background: #dbeafe;

        .step-number {
          background: $primary-color;
          color: white;
        }
      }

      &.pending {
        background: $background-light;

        .step-number {
          background: #d1d5db;
          color: white;
        }
      }

      .step-number {
        @include flex-center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-weight: 700;
        font-size: 0.875rem;
        flex-shrink: 0;
        @include transition;
      }

      .step-text {
        color: $text-dark;
        font-size: 0.95rem;
      }
    }
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

// Analytics Disabled State
.analytics-disabled {
  @include card;
  max-width: 1000px;
  margin: 0 auto;

  .disabled-content {
    text-align: center;

    .disabled-icon {
      @include flex-center;
      width: 80px;
      height: 80px;
      background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
      border-radius: 50%;
      margin: 0 auto 1.5rem;

      svg {
        width: 40px;
        height: 40px;
        color: $primary-color;
      }
    }

    h2 {
      font-size: 2rem;
      font-weight: 700;
      color: $text-dark;
      margin-bottom: 0.75rem;
    }

    .disabled-description {
      font-size: 1.125rem;
      color: $text-medium;
      max-width: 600px;
      margin: 0 auto 3rem;
    }
  }

  .features-preview {
    margin-bottom: 3rem;

    h3 {
      font-size: 1.25rem;
      font-weight: 600;
      color: $text-dark;
      margin-bottom: 1.5rem;
    }

    .features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1.5rem;

      .feature-item {
        display: flex;
        gap: 1rem;
        padding: 1.5rem;
        border-radius: $border-radius;
        text-align: left;
        @include transition;

        &:nth-child(1) {
          background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
        }

        &:nth-child(2) {
          background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
        }

        &:nth-child(3) {
          background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
        }

        &:nth-child(4) {
          background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
        }

        &:nth-child(5) {
          background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
        }

        &:nth-child(6) {
          background: linear-gradient(135deg, #b9a5f5 0%, #a78bfa 100%);
        }

        .feature-icon {
          width: 32px;
          height: 32px;
          flex-shrink: 0;
          margin-top: 0.25rem;
        }

        .feature-text {
          h4 {
            font-size: 1rem;
            font-weight: 600;
            color: $text-dark;
            margin-bottom: 0.25rem;
          }

          p {
            font-size: 0.875rem;
            color: $text-medium;
            line-height: 1.5;
          }
        }
      }
    }
  }

  .activation-section {
    background: linear-gradient(135deg, $background-light 0%, #e5e7eb 100%);
    border-radius: $border-radius;
    padding: 2rem;

    h3 {
      font-size: 1.25rem;
      font-weight: 600;
      color: $text-dark;
      margin-bottom: 1rem;
    }

    >p {
      color: $text-medium;
      margin-bottom: 1.5rem;
    }

    .activation-steps {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      margin-bottom: 2rem;

      .step-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;

        .step-number {
          @include flex-center;
          width: 32px;
          height: 32px;
          background: $primary-color;
          color: white;
          border-radius: 50%;
          font-weight: 700;
          font-size: 0.875rem;
          flex-shrink: 0;
        }

        span:last-child {
          color: $text-dark;

          strong {
            font-weight: 600;
          }
        }
      }
    }

    .enable-analytics-btn {
      display: block;
      width: 100%;
      background: $primary-color;
      color: white;
      font-weight: 600;
      padding: 0.75rem 1.5rem;
      border-radius: $border-radius;
      text-decoration: none;
      text-align: center;
      border: none;
      @include transition;

      &:hover {
        background: darken($primary-color, 10%);
      }
    }
  }
}

// Error States
.analytics-error {
  @include card;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;

  .error-content {
    .error-icon {
      @include flex-center;
      width: 80px;
      height: 80px;
      background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
      border-radius: 50%;
      margin: 0 auto 1.5rem;
      color: $danger-color;

      svg {
        width: 40px;
        height: 40px;
      }
    }

    h2 {
      font-size: 2rem;
      font-weight: 700;
      color: $text-dark;
      margin-bottom: 0.75rem;
    }

    p {
      font-size: 1.125rem;
      color: $text-medium;
      margin-bottom: 2rem;
    }

    .error-actions {
      display: flex;
      gap: 1rem;
      justify-content: center;
      flex-wrap: wrap;

      .install-woo-button,
      .retry-button {
        padding: 0.75rem 1.5rem;
        border-radius: $border-radius;
        font-weight: 600;
        text-decoration: none;
        border: none;
        cursor: pointer;
        @include transition;
      }

      .install-woo-button {
        background: $primary-color;
        color: white;

        &:hover {
          background: darken($primary-color, 10%);
        }
      }

      .retry-button {
        background: #e5e7eb;
        color: $text-dark;

        &:hover {
          background: #d1d5db;
        }
      }
    }
  }
}

.analytics-no-data {
  @include card;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;

  .no-data-content {
    .no-data-icon {
      @include flex-center;
      width: 80px;
      height: 80px;
      background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
      border-radius: 50%;
      margin: 0 auto 1.5rem;
      color: $primary-color;

      svg {
        width: 40px;
        height: 40px;
      }
    }

    h3 {
      font-size: 1.75rem;
      font-weight: 700;
      color: $text-dark;
      margin-bottom: 0.75rem;
    }

    >p {
      font-size: 1.125rem;
      color: $text-medium;
      margin-bottom: 2rem;
      line-height: 1.6;
    }

    .no-data-suggestions {
      background: linear-gradient(135deg, $background-light 0%, #e5e7eb 100%);
      border-radius: $border-radius;
      padding: 1.5rem;
      margin-bottom: 2rem;
      text-align: left;

      h4 {
        font-size: 1.125rem;
        font-weight: 600;
        color: $text-dark;
        margin-bottom: 1rem;
        text-align: center;
      }

      ul {
        list-style: none;
        padding: 0;
        margin: 0;

        li {
          color: $text-medium;
          padding: 0.5rem 0;
          font-size: 0.95rem;
          line-height: 1.5;

          &:not(:last-child) {
            border-bottom: 1px solid #e5e7eb;
          }
        }
      }
    }

    .retry-button {
      padding: 0.75rem 1.5rem;
      background: $primary-color;
      color: white;
      border: none;
      border-radius: $border-radius;
      font-weight: 600;
      cursor: pointer;
      @include transition;

      &:hover {
        background: darken($primary-color, 10%);
      }
    }
  }
}

// Header
.analytics-header {
  @include card;
  background: linear-gradient(135deg, #008080 0%, #024343 100%);
  margin-bottom: 2rem;

  h1 {
    font-size: 2rem;
    font-weight: 700;
    color: $text-dark;
    display: flex;
    align-items: center;
    color: #e6e6e6;
    gap: 1rem;
    margin-bottom: 0.5rem;

    .header-icon {
      width: 48px;
      height: 48px;
      padding: 10px;
      background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
      border-radius: $border-radius;
      color: $primary-color;
    }
  }

  .last-updated {
    color: #ffffff;
    font-size: .95rem;
    padding-left: 64px;
    text-align: left;
  }
}

// Analytics Sections
.analytics-section {
  margin-bottom: 3rem;

  h2 {
    border-bottom: 2px solid #e5e7eb;
    color: $text-dark;
    font-size: 1.5rem; 
    font-weight: 700;
    margin-bottom: 0;
    padding-bottom: .5rem;
    margin-left: 15px;
  }
}

// Analytics Grid
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-card {
  @include card;
  @include transition;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  }

  .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;

    .card-icon {
      width: 40px;
      height: 40px;
      padding: 8px;
      border-radius: 10px;
      flex-shrink: 0;
      background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
      color: $primary-color;
    }

    h3 {
      font-size: 1rem;
      font-weight: 600;
      color: $text-medium;
    }
  }

  .card-content {
    .main-value {
      font-size: 2rem;
      font-weight: 700;
      color: $text-dark;
      margin-bottom: 0.75rem;
    }

    .sub-value {
      color: $text-medium;
      font-size: 0.875rem;
      margin-bottom: 0.75rem;
    }

    .order-breakdown {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;

      .status {
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: 600;

        &.completed {
          background: #dcfce7;
          color: #166534;
        }

        &.processing {
          background: #dbeafe;
          color: #1e40af;
        }

        &.pending {
          background: #fef3c7;
          color: #92400e;
        }

        &.cancelled {
          background: #fee2e2;
          color: #991b1b;
        }

        &.refunded {
          background: #f3e8ff;
          color: #7c3aed;
        }

        &.on-hold {
          background: #fef3c7;
          color: #92400e;
        }

        &.failed {
          background: #fee2e2;
          color: #991b1b;
        }
      }
    }
  }
}

// Customer Analytics
.customer-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.customer-card {
  @include card;

  h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: $text-dark;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
  }

  .customer-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    .stat {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .label {
        color: $text-medium;
        font-size: 0.875rem;
      }

      .value {
        font-weight: 700;
        font-size: 1.125rem;
        color: $text-dark;
      }
    }
  }
}

// Revenue Overview Cards (Legacy - keeping for compatibility)
.revenue-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;

  .revenue-card {
    @include card;
    @include transition;

    &:hover {
      transform: translateY(-4px);
      box-shadow: 0 25px 30px -10px rgba(0, 0, 0, 0.15);
    }

    .card-header {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 1rem;

      .card-icon {
        width: 40px;
        height: 40px;
        padding: 8px;
        border-radius: 10px;
        flex-shrink: 0;
      }

      h3 {
        font-size: 1rem;
        font-weight: 600;
        color: $text-medium;
      }
    }

    &:nth-child(1) .card-icon {
      background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
      color: $success-color;
    }

    &:nth-child(2) .card-icon {
      background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
      color: $primary-color;
    }

    &:nth-child(3) .card-icon {
      background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
      color: #a855f7;
    }

    &:nth-child(4) .card-icon {
      background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
      color: $warning-color;
    }

    .card-content {
      .main-value {
        font-size: 2rem;
        font-weight: 700;
        color: $text-dark;
        margin-bottom: 0.5rem;
      }

      .growth-indicator {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.875rem;
        font-weight: 600;

        &.positive {
          color: $success-color;
        }

        &.negative {
          color: $danger-color;
        }

        svg {
          width: 16px;
          height: 16px;
        }
      }

      .sub-value {
        color: $text-medium;
        font-size: 0.875rem;
      }
    }
  }
}

// Charts Section
.analytics-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;

  @media (max-width: 1024px) {
    grid-template-columns: 1fr;
  }

  .chart-container {
    @include card;

    .chart-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.5rem;

      h3 {
        font-size: 1.25rem;
        font-weight: 600;
        color: $text-dark;
      }

      .period-selector {
        display: flex;
        gap: 0.5rem;

        button {
          padding: 0.5rem 1rem;
          border-radius: $border-radius;
          border: none;
          font-weight: 600;
          font-size: 0.875rem;
          cursor: pointer;
          background: $background-light;
          color: $text-medium;
          @include transition;

          &:hover {
            background: #e5e7eb;
          }

          &.active {
            background: $primary-color;
            color: white;
          }
        }
      }
    }

    .chart-content {
      // Recharts styles are handled by the library
      position: relative;
    }
  }
}

// Top Products Table
.top-products-table {
  @include card;

  h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: $text-dark;
    margin-bottom: 1.5rem;
  }

  .table-container {
    overflow-x: auto;

    table {
      width: 100%;
      border-collapse: collapse;

      thead {
        tr {
          border-bottom: 2px solid #e5e7eb;

          th {
            padding: 0.75rem 1rem;
            text-align: left;
            font-weight: 600;
            color: $text-dark;
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;

            &:not(:first-child) {
              text-align: right;
            }
          }
        }
      }

      tbody {
        tr {
          border-bottom: 1px solid #f3f4f6;
          @include transition;

          &:hover {
            background: $background-light;
          }

          td {
            padding: 1rem;
            color: $text-dark;

            &:not(.product-name):not(.rank-cell) {
              text-align: right;
            }

            &.rank-cell {
              text-align: center;

              .rank {
                @include flex-center;
                width: 32px;
                height: 32px;
                background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
                color: $primary-color;
                border-radius: $border-radius;
                font-weight: 700;
                font-size: 0.875rem;
                margin: 0 auto;
              }
            }

            &.product-name {
              font-weight: 500;
              text-align: left;
            }

            &.revenue-cell {
              font-weight: 600;
              color: $success-color;
            }
          }
        }
      }
    }
  }
}

// Responsive Design
@media (max-width: 768px) {
  .analytics-header {
    h1 {
      font-size: 1.5rem;
      flex-direction: column;
      align-items: flex-start;
    }

    .last-updated {
      padding-left: 0;
    }
  }

  .revenue-overview {
    grid-template-columns: 1fr;
  }

  .analytics-charts {
    grid-template-columns: 1fr;

    .chart-container {
      .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
      }
    }
  }

  .top-products-table {
    .table-container {
      table {
        font-size: 0.875rem;

        thead th,
        tbody td {
          padding: 0.5rem;
        }
      }
    }
  }

  .analytics-disabled {
    .features-grid {
      grid-template-columns: 1fr;
    }

    .activation-section {
      padding: 1.5rem;
    }
  }
}

// Glass Effect Styles for Preview Mode
.analytics-preview-mode {
  .preview-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    color: #92400e;
    padding: 0.5rem 1rem;
    border-radius: $border-radius;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
    border: 1px solid #f59e0b;
  }

  .glass-effect-container {
    position: relative;
    overflow: hidden;

    &:hover .glass-overlay {
      opacity: 1;
      visibility: visible;
    }

    .glass-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: $border-radius-lg;
      opacity: 0;
      visibility: hidden;
      @include transition;
      @include flex-center;
      z-index: 10;

      .glass-content {
        text-align: center;
        padding: 2rem;
        max-width: 400px;

        h4 {
          font-size: 1.25rem;
          font-weight: 700;
          color: $text-dark;
          margin-bottom: 0.75rem;
        }

        p {
          color: $text-medium;
          line-height: 1.6;
          margin-bottom: 1rem;
          font-size: 0.95rem;
        }

        .enable-hint {
          background: linear-gradient(135deg, $primary-color, darken($primary-color, 10%));
          color: white;
          padding: 0.75rem 1.5rem;
          border-radius: $border-radius;
          font-weight: 600;
          font-size: 0.875rem;
          box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
        }
      }
    }

    // Disable interactions for preview elements
    input,
    button,
    .sortable {
      pointer-events: none;
      opacity: 0.7;
    }

    .tab-button {
      pointer-events: none;
      opacity: 0.8;
    }
  }

  // Chart placeholders
  .chart-placeholder {
    height: 300px;
    @include flex-center;
    background: linear-gradient(135deg, $background-light 0%, #e5e7eb 100%);
    border-radius: $border-radius;

    .placeholder-chart {
      width: 80%;
      height: 80%;
      position: relative;

      &.horizontal {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        padding: 1rem;

        .product-bar {
          display: flex;
          align-items: center;
          gap: 1rem;

          .product-name {
            min-width: 120px;
            font-size: 0.875rem;
            color: $text-medium;
            font-weight: 500;
          }

          .bar {
            height: 20px;
            background: linear-gradient(90deg, $primary-color, $secondary-color);
            border-radius: 10px;
            opacity: 0.7;

            &.abandoned {
              background: linear-gradient(90deg, $danger-color, #f87171);
            }
          }
        }
      }

      &.line-chart {
        @include flex-center;

        svg {
          opacity: 0.6;
        }

        .chart-lines {
          width: 100%;
          height: 100%;
        }
      }

      .chart-bars {
        display: flex;
        align-items: flex-end;
        justify-content: space-around;
        height: 100%;
        padding: 1rem;

        .bar {
          width: 20px;
          background: linear-gradient(180deg, $primary-color, $secondary-color);
          border-radius: 4px 4px 0 0;
          opacity: 0.7;
          @include transition;
        }

        &.stacked {
          .bar-stack {
            display: flex;
            flex-direction: column;
            align-items: center;
            height: 100%;
            width: 30px;
            justify-content: flex-end;

            .bar-segment {
              width: 100%;
              border-radius: 2px;

              &.completed {
                background: $success-color;
              }

              &.processing {
                background: $primary-color;
              }

              &.pending {
                background: $warning-color;
              }
            }
          }
        }
      }

      .placeholder-pie-chart {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        margin: 0 auto;

        .pie-segment {
          width: 100%;
          height: 100%;
          border-radius: 50%;
          opacity: 0.7;
        }
      }
    }
  }

  // Activation guide at bottom
  .activation-guide {
    @include card;
    margin-top: 3rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;

    .guide-content {
      text-align: center;

      h3 {
        font-size: 1.5rem;
        font-weight: 700;
        color: $text-dark;
        margin-bottom: 1rem;
      }

      >p {
        color: $text-medium;
        margin-bottom: 2rem;
        font-size: 1.125rem;
      }

      .activation-steps {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;

        .step-item {
          display: flex;
          align-items: center;
          gap: 1rem;
          padding: 1rem;
          background: white;
          border-radius: $border-radius;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

          .step-number {
            @include flex-center;
            width: 32px;
            height: 32px;
            background: $primary-color;
            color: white;
            border-radius: 50%;
            font-weight: 700;
            font-size: 0.875rem;
            flex-shrink: 0;
          }

          span:last-child {
            color: $text-dark;
            text-align: left;

            strong {
              font-weight: 600;
              color: $primary-color;
            }
          }
        }
      }

      .enable-analytics-btn {
        display: inline-block;
        background: linear-gradient(135deg, $primary-color, darken($primary-color, 10%));
        color: white;
        font-weight: 700;
        padding: 1rem 2rem;
        border-radius: $border-radius;
        text-decoration: none;
        border: none;
        cursor: pointer;
        font-size: 1.125rem;
        box-shadow: 0 8px 16px rgba(0, 115, 170, 0.3);
        @include transition;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 12px 20px rgba(0, 115, 170, 0.4);
        }
      }
    }
  }
}

// Enhanced glass effect animations
@keyframes glassAppear {
  0% {
    opacity: 0;
    transform: scale(0.95);
    backdrop-filter: blur(0px);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    backdrop-filter: blur(10px);
  }
}

.glass-effect-container:hover .glass-overlay {
  animation: glassAppear 0.3s ease-out;
}

// Print Styles
@media print {
  .woo-analytics-container {
    background: white;
    padding: 0;
  }

  .revenue-card,
  .chart-container,
  .top-products-table {
    box-shadow: none;
    page-break-inside: avoid;
  }

  .period-selector {
    display: none;
  }

  .glass-overlay,
  .preview-badge,
  .activation-guide {
    display: none !important;
  }
}

// ModalStyles
.woo-analytics-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  @include flex-center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.woo-analytics-modal {
  background: white;
  border-radius: $border-radius-lg;
  box-shadow: $card-shadow-lg;
  max-width: 740px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;

    h3 {
      font-size: 1.25rem;
      font-weight: 600;
      color: $text-dark;
      margin: 0;
    }

    .close-icon {
      width: 24px;
      height: 24px;
      color: $text-medium;
      cursor: pointer;
      @include transition;

      &:hover {
        color: $text-dark;
      }
    }
  }

  .modal-content {
    padding: 2rem;
    max-width: 90%;
  }
}

// Modal Content Styles
.modal-stats {
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;

    .stat-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 1rem;
      border-radius: $border-radius;
      background: $background-light;

      &.completed {
        background: #dcfce7;
        border-left: 4px solid $success-color;
      }

      &.processing {
        background: #dbeafe;
        border-left: 4px solid $primary-color;
      }

      &.pending {
        background: #fef3c7;
        border-left: 4px solid $warning-color;
      }

      &.cancelled,
      &.refunded {
        background: #fee2e2;
        border-left: 4px solid $danger-color;
      }

      &.on-hold {
        background: #f3f4f6;
        border-left: 4px solid $text-medium;
      }

      .stat-label {
        color: $text-medium;
        font-size: 0.875rem;
        font-weight: 500;
      }

      .stat-value {
        font-weight: 700;
        font-size: 1.125rem;
        color: $text-dark;
      }
    }
  }

  .revenue-breakdown,
  .period-summary,
  .customer-breakdown,
  .trends-summary,
  .products-summary {
    margin-bottom: 1.5rem;

    h4,
    h5 {
      font-size: 1.125rem;
      font-weight: 600;
      color: $text-dark;
      margin-bottom: 1rem;
    }

    .revenue-item,
    .summary-item,
    .trend-item,
    .product-stat {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 0;
      border-bottom: 1px solid #f3f4f6;

      &:last-child {
        border-bottom: none;
      }

      .revenue-label,
      .summary-label,
      .trend-label,
      .product-label {
        color: $text-medium;
        font-size: 0.875rem;
      }

      .revenue-value,
      .summary-value,
      .trend-value,
      .product-value {
        font-weight: 600;
        color: $text-dark;
      }
    }

    .revenue-sources {
      margin-top: 1rem;
      padding: 1rem;
      background: $background-light;
      border-radius: $border-radius;

      .source-item {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        font-size: 0.875rem;

        span:first-child {
          color: $text-dark;
          font-weight: 500;
        }

        span:last-child {
          color: $text-medium;
        }
      }
    }

    .summary-grid,
    .customer-grid,
    .trends-grid,
    .products-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 1rem;
    }

    .customer-period {
      padding: 1rem;
      background: $background-light;
      border-radius: $border-radius;

      .customer-stats {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;

        span {
          display: flex;
          justify-content: space-between;
          font-size: 0.875rem;
          color: $text-dark;
        }
      }
    }
  }

  .modal-description {
    padding: 1rem;
    background: linear-gradient(135deg, $background-light 0%, #e5e7eb 100%);
    border-radius: $border-radius;

    p {
      color: $text-medium;
      font-size: 0.875rem;
      line-height: 1.6;
      margin: 0;
    }
  }
}

.trends-tab{
  .trends-summary{
    table {
      width: 100%;
      border-collapse: collapse;

      th, td {
        padding: 1rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
      }

      th {
        background: #f9fafb;
        font-weight: 600;
        color: $text-dark;
      }

      
    }
  }
}

// Info Icons
.info-icon,
.section-info-icon,
.chart-info-icon,
.table-info-icon {
  width: 20px;
  height: 20px;
  color: $text-medium;
  cursor: pointer;
  @include transition;

  &:hover {
    color: $primary-color;
    transform: scale(1.1);
  }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;

  h2 {
    margin: 0;
    padding: 0;
    border: none;
  }
}

.chart-header {
  .chart-info-icon {
    margin-left: auto;
  }
}

.card-header {
  .info-icon {
    margin-left: auto;
  }
}

// Enhanced Top Products Table
.top-products-table {
  .table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;

    .table-title {
      display: flex;
      align-items: center;
      gap: 0.75rem;

      h3 {
        margin: 0;
      }
    }

    .table-controls {
      display: flex;
      align-items: center;
      gap: 1rem;

      .search-box {
        position: relative;

        .search-icon {
          position: absolute;
          left: 0.75rem;
          top: 50%;
          transform: translateY(-50%);
          width: 16px;
          height: 16px;
          color: $text-medium;
        }

        input {
          padding: 0.5rem 0.75rem 0.5rem 2.5rem;
          border: 1px solid #d1d5db;
          border-radius: $border-radius;
          font-size: 0.875rem;
          width: 200px;
          @include transition;

          &:focus {
            outline: none;
            border-color: $primary-color;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
          }

          &::placeholder {
            color: $text-light;
          }
        }
      }
    }
  }

  .table-container {
    table {
      thead {
        th {
          &.sortable {
            cursor: pointer;
            user-select: none;
            position: relative;
            @include transition;

            &:hover {
              background: $background-light;
            }

            &.active {
              background: $background-light;
              color: $primary-color;
            }

            .sort-icon {
              width: 14px;
              height: 14px;
              margin-left: 0.25rem;
              opacity: 0.5;
              @include transition;
            }

            &:hover .sort-icon,
            &.active .sort-icon {
              opacity: 1;
            }
          }
        }
      }

      tbody {
        .actions-cell {
          text-align: center;

          .edit-product-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            background: $primary-color;
            color: white;
            border: none;
            border-radius: $border-radius;
            cursor: pointer;
            @include transition;

            &:hover {
              background: darken($primary-color, 10%);
              transform: scale(1.05);
            }

            svg {
              width: 16px;
              height: 16px;
            }
          }
        }
      }
    }
  }

  .pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 1rem;

    .pagination-info {
      color: $text-medium;
      font-size: 0.875rem;
    }

    .pagination-controls {
      display: flex;
      align-items: center;
      gap: 0.5rem;

      .pagination-btn {
        padding: 0.5rem 0.75rem;
        border: 1px solid #d1d5db;
        background: white;
        color: $text-dark;
        border-radius: $border-radius;
        font-size: 0.875rem;
        cursor: pointer;
        @include transition;

        &:hover:not(:disabled) {
          background: $background-light;
          border-color: $primary-color;
        }

        &.active {
          background: $primary-color;
          color: white;
          border-color: $primary-color;
        }

        &:disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }
      }
    }
  }
}

// Mobile Responsive for New Features
@media (max-width: 768px) {
  .woo-analytics-modal {
    width: 95%;
    max-height: 90vh;

    .modal-header {
      padding: 1rem 1.5rem;

      h3 {
        font-size: 1.125rem;
      }
    }

    .modal-content {
      padding: 1.5rem;
    }
  }

  .modal-stats {
    .stat-grid {
      grid-template-columns: 1fr;
    }

    .summary-grid,
    .customer-grid,
    .trends-grid,
    .products-grid {
      grid-template-columns: 1fr;
    }
  }

  .top-products-table {
    .table-header {
      flex-direction: column;
      align-items: stretch;

      .table-controls {
        justify-content: stretch;

        .search-box input {
          width: 100%;
        }
      }
    }

    .pagination {
      flex-direction: column;
      align-items: stretch;
      text-align: center;

      .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
      }
    }
  }

  // Mobile glass effect adjustments
  .analytics-preview-mode {
    .glass-effect-container {

      // On mobile, show glass overlay on tap instead of hover
      &:active .glass-overlay {
        opacity: 1;
        visibility: visible;
      }

      .glass-overlay {
        .glass-content {
          padding: 1.5rem;

          h4 {
            font-size: 1.125rem;
          }

          p {
            font-size: 0.875rem;
          }

          .enable-hint {
            padding: 0.5rem 1rem;
            font-size: 0.8rem;
          }
        }
      }
    }

    .chart-placeholder {
      height: 250px;

      .placeholder-chart {
        &.horizontal {
          padding: 0.5rem;

          .product-bar {
            .product-name {
              min-width: 80px;
              font-size: 0.8rem;
            }

            .bar {
              height: 16px;
            }
          }
        }

        .chart-bars {
          padding: 0.5rem;

          .bar {
            width: 16px;
          }
        }

        .placeholder-pie-chart {
          width: 120px;
          height: 120px;
        }
      }
    }

    .activation-guide {
      margin-top: 2rem;

      .guide-content {
        h3 {
          font-size: 1.25rem;
        }

        >p {
          font-size: 1rem;
        }

        .activation-steps {
          .step-item {
            padding: 0.75rem;

            .step-number {
              width: 28px;
              height: 28px;
              font-size: 0.8rem;
            }

            span:last-child {
              font-size: 0.9rem;
            }
          }
        }

        .enable-analytics-btn {
          padding: 0.75rem 1.5rem;
          font-size: 1rem;
        }
      }
    }

    .preview-badge {
      font-size: 0.8rem;
      padding: 0.4rem 0.8rem;
    }
  }
}

// Enhanced Modal Styles for Detailed Tables
.modal-table-container {
  max-height: 400px;
  overflow-y: auto;
  margin: 20px 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;

  .modal-products-table,
  .modal-daily-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;

    thead {
      background: #f8f9fa;
      position: sticky;
      top: 0;
      z-index: 1;

      th {
        padding: 12px 8px;
        text-align: left;
        font-weight: 600;
        color: #333;
        border-bottom: 2px solid #dee2e6;
        white-space: nowrap;
      }
    }

    tbody {
      tr {
        border-bottom: 1px solid #f0f0f0;
        transition: background-color 0.2s ease;

        &:hover {
          background-color: #f8f9fa;
        }

        &:last-child {
          border-bottom: none;
        }
      }

      td {
        padding: 10px 8px;
        vertical-align: middle;

        &.rank-cell {
          text-align: center;
          width: 60px;

          .rank {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 12px;
            background: #e9ecef;
            color: #495057;
            font-weight: 600;
            font-size: 12px;

            &.top-performer {
              background: linear-gradient(135deg, #ffd700, #ffed4e);
              color: #b8860b;
              box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
            }
          }
        }

        &.product-name-cell {
          max-width: 200px;

          strong {
            color: #2c3e50;
            display: block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }

        &.quantity-cell,
        &.orders-cell {
          text-align: center;
          font-weight: 600;
          color: #495057;
        }

        &.price-cell,
        &.revenue-cell,
        &.avg-cell {
          text-align: right;
          font-weight: 600;
          color: #28a745;
        }

        &.date-cell {
          font-weight: 500;
          color: #495057;
          white-space: nowrap;
        }

        &.completed-cell {
          text-align: center;
          color: #28a745;
          font-weight: 600;
        }

        &.processing-cell {
          text-align: center;
          color: #ffc107;
          font-weight: 600;
        }

        &.performance-cell {
          width: 120px;

          .performance-bar {
            position: relative;
            height: 20px;
            background: #e9ecef;
            border-radius: 10px;
            overflow: hidden;

            .performance-fill {
              height: 100%;
              background: linear-gradient(90deg, #28a745, #20c997);
              border-radius: 10px;
              transition: width 0.3s ease;
            }

            .performance-text {
              position: absolute;
              top: 50%;
              left: 50%;
              transform: translate(-50%, -50%);
              font-size: 11px;
              font-weight: 600;
              color: #333;
              text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
            }
          }
        }
      }
    }
  }
}

// Enhanced Modal Content Sections
.products-detailed-table,
.daily-breakdown-table {
  margin-top: 30px;

  h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
  }
}

.revenue-orders-summary {
  margin-bottom: 25px;

  h4 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
  }
}

.revenue-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;

  .summary-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007cba;

    .summary-label {
      display: block;
      font-size: 13px;
      color: #6c757d;
      margin-bottom: 5px;
      font-weight: 500;
    }

    .summary-value {
      display: block;
      font-size: 16px;
      font-weight: 700;
      color: #2c3e50;
    }
  }
}

// Responsive adjustments for modal tables
@media (max-width: 768px) {
  .modal-table-container {

    .modal-products-table,
    .modal-daily-table {
      font-size: 12px;

      thead th {
        padding: 8px 4px;
      }

      tbody td {
        padding: 8px 4px;

        &.product-name-cell {
          max-width: 150px;
        }

        &.performance-cell {
          width: 80px;

          .performance-bar {
            height: 16px;

            .performance-text {
              font-size: 10px;
            }
          }
        }
      }
    }
  }

  .revenue-orders-grid {
    grid-template-columns: 1fr;
    gap: 10px;

    .summary-item {
      padding: 12px;

      .summary-label {
        font-size: 12px;
      }

      .summary-value {
        font-size: 14px;
      }
    }
  }
}


// ======================//

// Incomplete Orders Section Styles - Compatible SCSS
.incomplete-orders-section {
    margin-top: 2rem;

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #e5e7eb;

        h2 {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #1f2937;
            font-size: 1.5rem;
            margin: 0;
        }

        .section-icon {
            color: #ef4444;
        }

        .section-tabs {
            display: flex;
            gap: 0.5rem;
        }

        .tab-button {
            padding: 0.5rem 1rem;
            border: 1px solid #d1d5db;
            background: white;
            color: #6b7280;
            border-radius: 0.375rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .tab-button:hover {
            background: #f9fafb;
            border-color: #9ca3af;
        }

        .tab-button.active {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }
    }

    // Loading and Error States
    .incomplete-orders-loading,
    .incomplete-orders-error {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 3rem;
        text-align: center;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f4f6;
        border-top: 4px solid #ef4444;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 1rem;
    }

    .error-icon {
        font-size: 3rem;
        color: #ef4444;
        margin-bottom: 1rem;
    }

    .retry-button {
        padding: 0.5rem 1rem;
        background: #ef4444;
        color: white;
        border: none;
        border-radius: 0.375rem;
        cursor: pointer;
        margin-top: 1rem;
    }

    .retry-button:hover {
        background: #dc2626;
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    // Overview Tab
    .incomplete-orders-overview {
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 1.5rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .stat-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .stat-icon {
            color: #ef4444;
            font-size: 1.5rem;
        }

        .stat-header h3 {
            color: #6b7280;
            font-size: 0.875rem;
            font-weight: 500;
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: #1f2937;
            margin-bottom: 0.25rem;
        }

        .stat-subtext {
            color: #6b7280;
            font-size: 0.875rem;
        }

        .charts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
            gap: 2rem;
        }

        .chart-container {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 1.5rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .chart-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
        }

        .chart-header h3 {
            color: #1f2937;
            font-size: 1.125rem;
            margin: 0;
        }

        .chart-info-icon {
            color: #6b7280;
            cursor: pointer;
        }

        .chart-info-icon:hover {
            color: #374151;
        }

        .chart-content {
            height: 300px;
        }
    }

    // Orders Tab
    .incomplete-orders-list {
        .orders-header {
            margin-bottom: 1.5rem;
        }

        .orders-header h3 {
            color: #1f2937;
            font-size: 1.25rem;
            margin: 0 0 0.5rem 0;
        }

        .orders-header p {
            color: #6b7280;
            margin: 0;
        }

        .orders-table-container {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .orders-table {
            width: 100%;
            border-collapse: collapse;
        }

        .orders-table thead {
            background: #f9fafb;
        }

        .orders-table th {
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            color: #374151;
            border-bottom: 1px solid #e5e7eb;
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .orders-table tbody tr {
            border-bottom: 1px solid #f3f4f6;
        }

        .orders-table tbody tr:hover {
            background: #f9fafb;
        }

        .orders-table td {
            padding: 1rem;
            vertical-align: top;
        }

        .customer-info strong {
            display: block;
            color: #1f2937;
            margin-bottom: 0.25rem;
        }

        .customer-email {
            color: #6b7280;
            font-size: 0.875rem;
        }

        .contact-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.25rem;
            font-size: 0.875rem;
            color: #6b7280;
        }

        .contact-icon {
            font-size: 1rem;
            color: #9ca3af;
        }

        .product-item {
            background: #f3f4f6;
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            margin-bottom: 0.25rem;
            font-size: 0.875rem;
            color: #374151;
        }

        .more-products {
            color: #6b7280;
            font-size: 0.75rem;
            font-style: italic;
        }

        .no-products {
            color: #9ca3af;
            font-style: italic;
        }

        .value-cell strong {
            color: #059669;
            font-size: 1.125rem;
        }

        .date-cell {
            color: #6b7280;
            font-size: 0.875rem;
        }

        .status-badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .status-badge.incomplete {
            background: #fef2f2;
            color: #dc2626;
        }

        .status-badge.contacted {
            background: #fef3c7;
            color: #d97706;
        }

        .status-badge.completed {
            background: #d1fae5;
            color: #059669;
        }

        .action-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .action-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 2rem;
            height: 2rem;
            border-radius: 0.375rem;
            border: none;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
        }

        .action-btn svg {
            font-size: 1rem;
        }

        .action-btn.email-btn {
            background: #dbeafe;
            color: #2563eb;
        }

        .action-btn.email-btn:hover {
            background: #bfdbfe;
        }

        .action-btn.contact-btn {
            background: #d1fae5;
            color: #059669;
        }

        .action-btn.contact-btn:hover {
            background: #a7f3d0;
        }

        .no-orders {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 4rem 2rem;
            text-align: center;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            border-radius: 12px;
            margin: 2rem 0;
            border: 2px dashed #cbd5e1;

            .no-orders-icon {
                font-size: 4rem;
                color: #94a3b8;
                margin-bottom: 1.5rem;
                opacity: 0.7;
            }

            h3 {
                color: #475569;
                font-size: 1.5rem;
                font-weight: 600;
                margin: 0 0 1rem 0;
            }

            p {
                color: #64748b;
                font-size: 1rem;
                line-height: 1.6;
                margin: 0 0 2rem 0;
                max-width: 400px;
            }

            .suggestions {
                background: white;
                padding: 1.5rem;
                border-radius: 8px;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                max-width: 500px;
                width: 100%;

                h4 {
                    color: #334155;
                    font-size: 1.125rem;
                    margin: 0 0 1rem 0;
                    font-weight: 600;
                }

                ul {
                    list-style: none;
                    padding: 0;
                    margin: 0;
                    text-align: left;

                    li {
                        display: flex;
                        align-items: flex-start;
                        gap: 0.75rem;
                        padding: 0.75rem 0;
                        border-bottom: 1px solid #f1f5f9;
                        color: #64748b;
                        font-size: 0.9rem;
                        line-height: 1.5;

                        &:last-child {
                            border-bottom: none;
                        }

                        &::before {
                            content: "💡";
                            font-size: 1rem;
                            flex-shrink: 0;
                            margin-top: 0.1rem;
                        }
                    }
                }
            }

            .refresh-btn {
                display: inline-flex;
                align-items: center;
                gap: 0.5rem;
                padding: 0.75rem 1.5rem;
                background: linear-gradient(135deg, #3b82f6, #1d4ed8);
                color: white;
                border: none;
                border-radius: 8px;
                font-weight: 600;
                cursor: pointer;
                transition: all 0.3s ease;
                margin-top: 1rem;

                &:hover {
                    transform: translateY(-2px);
                    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
                }

                svg {
                    font-size: 1.125rem;
                }
            }
        }

        .no-data {
            text-align: center;
            color: #9ca3af;
            font-style: italic;
            padding: 3rem;
        }
    }

    .most-abandoned-tab .no-data {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4rem 2rem;
        text-align: center;
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        border-radius: 12px;
        margin: 2rem 0;
        border: 2px dashed #cbd5e1;
    }

    // Products Tab
    .abandoned-products-section {
        .products-header {
            margin-bottom: 1.5rem;
        }

        .products-header h3 {
            color: #1f2937;
            font-size: 1.25rem;
            margin: 0 0 0.5rem 0;
        }

        .products-header p {
            color: #6b7280;
            margin: 0;
        }

        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }

        .abandoned-product-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 1.5rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            position: relative;
        }

        .product-rank {
            position: absolute;
            top: -0.5rem;
            right: -0.5rem;
            background: #ef4444;
            color: white;
            width: 2rem;
            height: 2rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.875rem;
        }

        .product-info {
            margin-bottom: 1rem;
        }

        .product-name {
            color: #1f2937;
            font-size: 1.125rem;
            margin: 0 0 1rem 0;
            line-height: 1.4;
        }

        .stat {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .stat-label {
            color: #6b7280;
            font-size: 0.875rem;
        }

        .stat-value {
            color: #1f2937;
            font-weight: 600;
        }

        .edit-product-btn {
            display: inline-block;
            padding: 0.5rem 1rem;
            background: #f3f4f6;
            color: #374151;
            text-decoration: none;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            transition: all 0.2s;
        }

        .edit-product-btn:hover {
            background: #e5e7eb;
            color: #1f2937;
        }

        .no-abandoned-products {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 3rem;
            text-align: center;
            grid-column: 1 / -1;
        }

        .no-data-icon {
            font-size: 3rem;
            color: #d1d5db;
            margin-bottom: 1rem;
        }

        .no-abandoned-products h4 {
            color: #6b7280;
            margin: 0 0 0.5rem 0;
        }

        .no-abandoned-products p {
            color: #9ca3af;
            margin: 0;
        }
    }
}

// Responsive Design
@media (max-width: 768px) {
    .incomplete-orders-section {
        .section-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 1rem;
        }

        .section-tabs {
            width: 100%;
        }

        .tab-button {
            flex: 1;
            text-align: center;
        }

        .incomplete-orders-overview .stats-grid {
            grid-template-columns: 1fr;
        }

        .incomplete-orders-overview .charts-grid {
            grid-template-columns: 1fr;
        }

        .chart-content {
            height: 250px;
        }

        .orders-table-container {
            overflow-x: auto;
        }

        .orders-table {
            min-width: 800px;
        }

        .abandoned-products-section .products-grid {
            grid-template-columns: 1fr;
        }
    }
}

// Incomplete Orders Section
.incomplete-orders-section {
  margin-top: 2rem;

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;

    h2 {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 1.5rem;
      font-weight: 700;
      color: $text-dark;
    }

    .section-tabs {
      display: flex;
      gap: 0.5rem;

      .tab-button {
        padding: 0.5rem 1rem;
        border: 1px solid #e5e7eb;
        background: white;
        border-radius: 8px;
        cursor: pointer;
        @include transition;

        &:hover {
          background: #f3f4f6;
        }

        &.active {
          background: $primary-color;
          color: white;
          border-color: $primary-color;
        }
      }
    }
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;

    .stat-card {
      @include card;
      padding: 1.5rem;

      .stat-header {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1rem;

        .stat-icon {
          color: $primary-color;
        }

        h3 {
          font-size: 1rem;
          font-weight: 600;
          color: $text-dark;
        }
      }

      .stat-value {
        font-size: 2rem;
        font-weight: 700;
        color: $text-dark;
        margin-bottom: 0.5rem;
      }

      .stat-subtext {
        color: $text-medium;
        font-size: 0.875rem;
      }
    }
  }

  .no-data {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 4rem 2rem;
      text-align: center;
      background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
      border-radius: 12px;
      margin: 2rem 0;
      border: 2px dashed #cbd5e1;
  }

  .orders-table {
    @include card;
    padding: 0;
    overflow: hidden;

    table {
      width: 100%;
      border-collapse: collapse;

      th, td {
        padding: 1rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
      }

      th {
        background: #f9fafb;
        font-weight: 600;
        color: $text-dark;
      }

      .customer-info {
        .customer-name {
          font-weight: 600;
          color: $text-dark;
        }

        .customer-email {
          color: $text-medium;
          font-size: 0.875rem;
        }
      }

      .status-badge {
        padding: 0.25rem 0.75rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;

        &.incomplete {
          background: #fef3c7;
          color: #92400e;
        }

        &.contacted {
          background: #dbeafe;
          color: #1e40af;
        }

        &.completed {
          background: #d1fae5;
          color: #065f46;
        }
      }
    }
  }

  .most-abandoned-products {
    @include card;
    margin-top: 2rem;

    h3 {
      margin-bottom: 1.5rem;
      color: $text-dark;
    }

    .products-list {
      .product-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 0;
        border-bottom: 1px solid #e5e7eb;

        &:last-child {
          border-bottom: none;
        }

        .product-info {
          .product-name {
            display: block;
            font-weight: 600;
            color: $text-dark;
          }

          .abandonment-count {
            color: $text-medium;
            font-size: 0.875rem;
          }
        }

        .product-value {
          font-weight: 600;
          color: $danger-color;
        }
      }
    }
  }
}

// Cart Interactions Analytics
.cart-interactions-analytics {
  margin-top: 2rem;

  .analytics-header {
    margin-bottom: 2rem;

    h2 {
      font-size: 1.75rem;
      font-weight: 700;
      color: #f3f3f3;
      margin-bottom: 0.5rem;
    }

    p {
      color: #f3f3f3;
    }
  }

  .analytics-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;

    .tab-button {
      padding: 0.75rem 1.5rem;
      border: 1px solid #e5e7eb;
      background: white;
      border-radius: 8px;
      cursor: pointer;
      @include transition;

      &:hover {
        background: #f3f4f6;
      }

      &.active {
        background: $primary-color;
        color: white;
        border-color: $primary-color;
      }
    }
  }

  .insights-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;

    .insight-card {
      @include card;
      padding: 1.5rem;
      text-align: center;

      h3 {
        font-size: 1rem;
        font-weight: 600;
        color: $text-dark;
        margin-bottom: 1rem;
      }

      .insight-value {
        font-size: 2.5rem;
        font-weight: 700;
        color: $primary-color;
        margin-bottom: 0.5rem;
      }

      .insight-value-text {
        font-size: 1.25rem;
        font-weight: 600;
        color: $text-dark;
        margin-bottom: 0.5rem;
      }

      p {
        color: $text-medium;
        font-size: 0.875rem;
      }
    }
  }

  .charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;

    .chart-container {
      @include card;

      .chart-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1.5rem;

        h3 {
          margin: 0;
          color: $text-dark;
        }

        .chart-info-icon {
          color: $text-medium;
          cursor: pointer;
          @include transition;

          &:hover {
            color: $primary-color;
            transform: scale(1.1);
          }
        }
      }

      h3 {
        margin-bottom: 1.5rem;
        color: $text-dark;
      }

      .no-data {
        @include flex-center;
        height: 300px;
        color: $text-medium;
      }

      .chart-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: 1rem;

        .legend-item {
          display: flex;
          align-items: center;
          gap: 0.5rem;

          .legend-color {
            width: 12px;
            height: 12px;
            border-radius: 2px;
          }

          .legend-label {
            color: $text-medium;
            font-size: 0.875rem;
          }

          .legend-value {
            color: $text-dark;
            font-weight: 600;
            font-size: 0.875rem;
          }
        }
      }
    }
  }

  .product-interactions-table {
    @include card;

    .table-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.5rem;

      h3 {
        margin: 0;
        color: $text-dark;
      }

      .table-info-icon {
        color: $text-medium;
        cursor: pointer;
        @include transition;

        &:hover {
          color: $primary-color;
          transform: scale(1.1);
        }
      }
    }

    h3 {
      margin-bottom: 1.5rem;
      color: $text-dark;
    }

    table {
      width: 100%;
      border-collapse: collapse;

      th, td {
        padding: 1rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
      }

      th {
        background: #f9fafb;
        font-weight: 600;
        color: $text-dark;
      }

      .interaction-type {
        padding: 0.25rem 0.75rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;

        &.increase {
          background: #d1fae5;
          color: #065f46;
        }

        &.decrease {
          background: #fef3c7;
          color: #92400e;
        }

        &.remove {
          background: #fee2e2;
          color: #991b1b;
        }

        &.add {
          background: #dbeafe;
          color: #1e40af;
        }

        &.change {
          background: #ede9fe;
          color: #5b21b6;
        }
      }
    }
  }

  .daily-trends-chart {
    @include card;

    .chart-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.5rem;

      h3 {
        margin: 0;
        color: $text-dark;
      }

      .chart-info-icon {
        color: $text-medium;
        cursor: pointer;
        @include transition;

        &:hover {
          color: $primary-color;
          transform: scale(1.1);
        }
      }
    }

    .trends-summary {
      margin-top: 2rem;

      h4 {
        color: $text-dark;
        font-size: 1.125rem;
        margin: 0 0 1rem 0;
      }

      table {
        width: 100%;
        border-collapse: collapse;

        thead {
          background: #f9fafb;

          th {
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            color: $text-dark;
            border-bottom: 1px solid #e5e7eb;
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
          }
        }

        tbody {
          tr {
            border-bottom: 1px solid #f3f4f6;

            &:hover {
              background: #f9fafb;
            }
          }

          td {
            padding: 1rem;
            color: $text-dark;

            .interaction-type {
              padding: 0.25rem 0.75rem;
              border-radius: 9999px;
              font-size: 0.75rem;
              font-weight: 500;
              text-transform: uppercase;
              letter-spacing: 0.05em;
            }

            strong {
              font-weight: 600;
            }
          }
        }
      }
    }
  }

  // Cart Interactions Modal Styles
  .cart-interactions-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
  }

  .cart-interactions-modal {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1.5rem 2rem;
      border-bottom: 1px solid #e5e7eb;

      h3 {
        color: $text-dark;
        font-size: 1.25rem;
        margin: 0;
      }

      .modal-close-btn {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: $text-medium;
        cursor: pointer;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        @include transition;

        &:hover {
          background: #f3f4f6;
          color: $text-dark;
        }
      }
    }

    .modal-content {
      padding: 2rem;
      max-width: 90%;

      .modal-description {
        background: linear-gradient(135deg, $background-light 0%, #e5e7eb 100%);
        border-radius: $border-radius;
        padding: 1.5rem;
        margin-bottom: 2rem;

        p {
          color: $text-medium;
          font-size: 0.95rem;
          line-height: 1.6;
          margin: 0;
        }
      }

      .modal-chart-section {
        margin-bottom: 2rem;

        h4 {
          color: $text-dark;
          font-size: 1.125rem;
          margin: 0 0 1.5rem 0;
          font-weight: 600;
        }

        .modal-chart-container {
          background: #f9fafb;
          border-radius: $border-radius;
          padding: 1rem;
          margin-bottom: 1.5rem;
        }

        .modal-stats-grid {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
          gap: 1rem;

          .modal-stat-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: white;
            border-radius: $border-radius;
            border: 1px solid #e5e7eb;

            .stat-color {
              width: 16px;
              height: 16px;
              border-radius: 50%;
              flex-shrink: 0;
            }

            .stat-info {
              display: flex;
              flex-direction: column;
              gap: 0.25rem;

              .stat-label {
                color: $text-medium;
                font-size: 0.875rem;
                font-weight: 500;
              }

              .stat-value {
                color: $text-dark;
                font-weight: 600;
              }

              .stat-percentage {
                color: $primary-color;
                font-size: 0.875rem;
                font-weight: 600;
              }
            }
          }
        }

        .modal-trends-summary {
          background: #f9fafb;
          border-radius: $border-radius;
          padding: 1.5rem;

          h5 {
            color: $text-dark;
            font-size: 1rem;
            margin: 0 0 1rem 0;
            font-weight: 600;
          }

          .trends-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;

            .trend-stat {
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding: 0.75rem;
              background: white;
              border-radius: $border-radius;
              border: 1px solid #e5e7eb;

              .trend-label {
                color: $text-medium;
                font-size: 0.875rem;
              }

              .trend-value {
                color: $text-dark;
                font-weight: 600;
              }
            }
          }
        }
      }

      .modal-table-section {
        margin-bottom: 2rem;

        h4 {
          color: $text-dark;
          font-size: 1.125rem;
          margin: 0 0 1.5rem 0;
          font-weight: 600;
        }

        .modal-table-container {
          max-height: 400px;
          overflow-y: auto;
          border: 1px solid #e5e7eb;
          border-radius: $border-radius;

          .modal-products-table {
            width: 100%;
            border-collapse: collapse;

            thead {
              background: #f9fafb;
              position: sticky;
              top: 0;
              z-index: 1;

              th {
                padding: 1rem;
                text-align: left;
                font-weight: 600;
                color: $text-dark;
                border-bottom: 1px solid #e5e7eb;
                font-size: 0.875rem;
                text-transform: uppercase;
                letter-spacing: 0.05em;
              }
            }

            tbody {
              tr {
                border-bottom: 1px solid #f3f4f6;
                @include transition;

                &:hover {
                  background: #f9fafb;
                }
              }

              td {
                padding: 1rem;
                vertical-align: middle;

                &.rank-cell {
                  text-align: center;
                  width: 60px;

                  .rank {
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    width: 32px;
                    height: 32px;
                    background: $primary-color;
                    color: white;
                    border-radius: 50%;
                    font-weight: 700;
                    font-size: 0.875rem;
                  }
                }

                &.product-name-cell {
                  max-width: 200px;

                  strong {
                    color: $text-dark;
                  }
                }

                &.count-cell {
                  text-align: center;
                  font-weight: 600;
                  color: $text-dark;
                }

                &.percentage-cell {
                  width: 120px;

                  .percentage-bar {
                    position: relative;
                    height: 20px;
                    background: #e5e7eb;
                    border-radius: 10px;
                    overflow: hidden;

                    .percentage-fill {
                      height: 100%;
                      border-radius: 10px;
                      @include transition;
                    }

                    .percentage-text {
                      position: absolute;
                      top: 50%;
                      left: 50%;
                      transform: translate(-50%, -50%);
                      font-size: 0.75rem;
                      font-weight: 600;
                      color: $text-dark;
                      text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
                    }
                  }
                }

                .interaction-type {
                  padding: 0.25rem 0.75rem;
                  border-radius: 9999px;
                  font-size: 0.75rem;
                  font-weight: 500;
                  text-transform: uppercase;
                  letter-spacing: 0.05em;
                }
              }
            }
          }
        }
      }
    }

    .modal-footer {
      display: flex;
      justify-content: flex-end;
      padding: 1.5rem 2rem;
      border-top: 1px solid #e5e7eb;
      background: #f9fafb;

      .btn {
        padding: 0.75rem 1.5rem;
        border-radius: $border-radius;
        font-weight: 600;
        cursor: pointer;
        @include transition;

        &.btn-default {
          background: #e5e7eb;
          color: $text-dark;
          border: none;

          &:hover {
            background: #d1d5db;
          }
        }
      }
    }
  }
}

// Settings WooCommerce Tab Styles
.analytics-preview {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;

  .preview-info {
    h4 {
      color: $text-dark;
      margin-bottom: 1rem;
      font-size: 1.25rem;
      font-weight: 600;
    }

    .features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1rem;
      margin-bottom: 1.5rem;

      .feature-item {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
        background: white;
        border-radius: 8px;
        border: 1px solid #e2e8f0;

        .feature-icon {
          font-size: 1.5rem;
          flex-shrink: 0;
        }

        .feature-content {
          strong {
            display: block;
            color: $text-dark;
            margin-bottom: 0.25rem;
          }

          p {
            color: $text-medium;
            font-size: 0.875rem;
            margin: 0;
          }
        }
      }
    }

    .preview-actions {
      text-align: center;

      .btn {
        padding: 0.75rem 2rem;
        font-weight: 600;
        border-radius: 8px;
        @include transition;
      }
    }
  }
}

.woo-status-check {
  .status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;

    &:last-child {
      border-bottom: none;
    }

    .status-icon {
      font-size: 1.5rem;
      flex-shrink: 0;
    }

    .status-content {
      strong {
        display: block;
        color: $text-dark;
        margin-bottom: 0.25rem;
      }

      p {
        color: $text-medium;
        margin: 0;
      }
    }
  }
}

// Responsive Design
@media (max-width: 768px) {
  .woo-analytics-dashboard {
    .analytics-grid {
      grid-template-columns: 1fr;
    }

    .analytics-charts {
      grid-template-columns: 1fr;
    }

    .section-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
    }

    .insights-cards {
      grid-template-columns: 1fr;
    }

    .features-grid {
      grid-template-columns: 1fr !important;
    }
  }
}


/* Order Details Modal Styles */
.order-details-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.order-details-modal {
    background: white;
    border-radius: 12px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-details-modal .modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.order-details-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.order-details-modal .close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.order-details-modal .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.order-details-modal .modal-body {
    padding: 30px;
}

.order-details-modal .detail-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
}

.order-details-modal .detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.order-details-modal .detail-section h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-details-modal .detail-section h4:before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.order-details-modal .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.order-details-modal .detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-details-modal .detail-item .label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-details-modal .detail-item .value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.order-details-modal .detail-item .value a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.order-details-modal .detail-item .value a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.order-details-modal .products-table {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.order-details-modal .products-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.order-details-modal .products-table thead {
    background: #f9fafb;
}

.order-details-modal .products-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.order-details-modal .products-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.order-details-modal .products-table tbody tr:last-child td {
    border-bottom: none;
}

.order-details-modal .products-table tbody tr:hover {
    background: #f9fafb;
}

.order-details-modal .product-id,
.order-details-modal .variation-id {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.order-details-modal .product-link {
    display: inline-block;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.order-details-modal .product-link:hover {
    background: #764ba2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.order-details-modal .cart-summary {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
}

.order-details-modal .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.order-details-modal .summary-row:last-child {
    border-bottom: none;
}

.order-details-modal .summary-row.total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #d1d5db;
}

.order-details-modal .summary-row .label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.order-details-modal .summary-row.total .label {
    font-size: 16px;
    color: #1f2937;
    font-weight: 700;
}

.order-details-modal .summary-row .value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.order-details-modal .summary-row.total .value strong {
    font-size: 18px;
    color: #10b981;
}

.order-details-modal .user-agent-value {
    font-size: 13px;
    color: #4b5563;
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    word-break: break-all;
    margin-top: 8px;
}

.order-details-modal .interactions-data pre {
    background: #1f2937;
    color: #10b981;
    padding: 16px;
    border-radius: 8px;
    font-size: 12px;
    overflow-x: auto;
    margin: 0;
}

.order-details-modal .no-data-text {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
    font-style: italic;
}

.order-details-modal .modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.order-details-modal .modal-footer .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.order-details-modal .modal-footer .btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.order-details-modal .modal-footer .btn-secondary:hover {
    background: #d1d5db;
}

.order-details-modal .modal-footer .btn-primary {
    background: #667eea;
    color: white;
}

.order-details-modal .modal-footer .btn-primary:hover {
    background: #764ba2;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.order-details-modal .modal-footer .btn-success {
    background: #10b981;
    color: white;
}

.order-details-modal .modal-footer .btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* View Details Button in Table */
.incomplete-orders-list .view-details-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
    display: inline-block;
}

.incomplete-orders-list .view-details-btn:hover {
    background: #764ba2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.order-actions .btn-info {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.order-actions .btn-info:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .order-details-modal {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .order-details-modal .modal-header,
    .order-details-modal .modal-body,
    .order-details-modal .modal-footer {
        padding: 20px;
    }
    
    .order-details-modal .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .order-details-modal .modal-footer {
        flex-direction: column;
    }
    
    .order-details-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Incomplete Orders Section Styles */
.incomplete-orders-section {
    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        
        h2 {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
            color: #1f2937;
            font-size: 24px;
            font-weight: 600;
            
            .section-icon {
                color: #3b82f6;
            }
        }
    }

    .section-tabs {
        display: flex;
        gap: 8px;
        
        .tab-button {
            padding: 8px 16px;
            border: 1px solid #d1d5db;
            background: #f9fafb;
            color: #6b7280;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 14px;
            font-weight: 500;
            
            &:hover {
                background: #f3f4f6;
                color: #374151;
            }
            
            &.active {
                background: #3b82f6;
                color: white;
                border-color: #3b82f6;
            }
        }
    }

    .loading-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px 20px;
        
        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f4f6;
            border-top: 4px solid #3b82f6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 16px;
        }
        
        p {
            color: #6b7280;
            margin: 0;
        }
    }

    /* Overview Tab Styles */
    .incomplete-orders-overview {
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 32px;
        }

        .stat-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 24px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            
            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            }

            .stat-header {
                display: flex;
                align-items: center;
                gap: 8px;
                margin-bottom: 12px;
                
                .stat-icon {
                    color: #3b82f6;
                    font-size: 20px;
                }
                
                h3 {
                    margin: 0;
                    font-size: 14px;
                    font-weight: 600;
                    color: #6b7280;
                    text-transform: uppercase;
                    letter-spacing: 0.5px;
                }
            }

            .stat-value {
                font-size: 32px;
                font-weight: 700;
                color: #1f2937;
                margin-bottom: 4px;
                line-height: 1;
            }

            .stat-subtext {
                font-size: 14px;
                color: #6b7280;
                margin: 0;
            }
        }

        .most-abandoned-products {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 24px;
            
            h3 {
                margin: 0 0 20px 0;
                color: #1f2937;
                font-size: 18px;
                font-weight: 600;
            }

            .products-list {
                display: flex;
                flex-direction: column;
                gap: 12px;
            }

            .product-item {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 16px;
                background: #f9fafb;
                border-radius: 6px;
                border: 1px solid #f3f4f6;
                
                .product-info {
                    display: flex;
                    flex-direction: column;
                    gap: 4px;
                    
                    .product-name {
                        font-weight: 600;
                        color: #1f2937;
                    }
                    
                    .abandonment-count {
                        font-size: 12px;
                        color: #6b7280;
                    }
                }
                
                .product-value {
                    font-weight: 600;
                    color: #dc2626;
                    font-size: 16px;
                }
            }
        }
    }

    /* Orders Tab Styles */
    .incomplete-orders-list {
        .orders-table {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            overflow: hidden;
            
            table {
                width: 100%;
                border-collapse: collapse;
                
                thead {
                    background: #f9fafb;
                    
                    th {
                        padding: 16px;
                        text-align: left;
                        font-weight: 600;
                        color: #374151;
                        font-size: 14px;
                        border-bottom: 1px solid #e5e7eb;
                    }
                }
                
                tbody {
                    tr {
                        border-bottom: 1px solid #f3f4f6;
                        transition: background-color 0.2s ease;
                        
                        &:hover {
                            background: #f9fafb;
                        }
                        
                        &:last-child {
                            border-bottom: none;
                        }
                    }
                    
                    td {
                        padding: 16px;
                        vertical-align: top;
                        
                        .customer-info {
                            .customer-name {
                                font-weight: 600;
                                color: #1f2937;
                                margin-bottom: 4px;
                            }
                            
                            .customer-email {
                                font-size: 14px;
                                color: #6b7280;
                            }
                        }
                        
                        .products-info {
                            max-width: 200px;
                            
                            .view-details-btn {
                                background: none;
                                border: none;
                                color: #3b82f6;
                                cursor: pointer;
                                text-decoration: underline;
                                font-size: 12px;
                                padding: 0;
                                margin-left: 4px;
                                
                                &:hover {
                                    color: #2563eb;
                                }
                            }
                        }
                        
                        .status-badge {
                            display: inline-block;
                            padding: 4px 8px;
                            border-radius: 4px;
                            font-size: 12px;
                            font-weight: 600;
                            text-transform: uppercase;
                            
                            &.incomplete {
                                background: #fef3c7;
                                color: #92400e;
                            }
                            
                            &.contacted {
                                background: #dbeafe;
                                color: #1e40af;
                            }
                            
                            &.completed {
                                background: #d1fae5;
                                color: #065f46;
                            }
                        }
                        
                        .order-actions {
                            display: flex;
                            gap: 8px;
                            flex-wrap: wrap;
                            
                            .btn {
                                padding: 6px 12px;
                                border: none;
                                border-radius: 4px;
                                font-size: 12px;
                                font-weight: 500;
                                cursor: pointer;
                                text-decoration: none;
                                display: inline-block;
                                transition: all 0.2s ease;
                                
                                &.btn-sm {
                                    padding: 4px 8px;
                                    font-size: 11px;
                                }
                                
                                &.btn-info {
                                    background: #0ea5e9;
                                    color: white;
                                    
                                    &:hover {
                                        background: #0284c7;
                                    }
                                }
                                
                                &.btn-primary {
                                    background: #3b82f6;
                                    color: white;
                                    
                                    &:hover {
                                        background: #2563eb;
                                    }
                                }
                                
                                &.btn-secondary {
                                    background: #6b7280;
                                    color: white;
                                    
                                    &:hover {
                                        background: #4b5563;
                                    }
                                }
                                
                                &.view-details-btn {
                                    background: #0ea5e9;
                                    color: white;
                                }
                            }
                        }
                    }
                }
            }
        }
        
        .no-orders {
            text-align: center;
            padding: 60px 20px;
            color: #6b7280;
            
            p {
                margin: 0;
                font-size: 16px;
            }
        }
    }

    /* Most Abandoned Tab Styles */
    .most-abandoned-tab {
        .abandoned-products-table {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            padding: 2rem;
            
            table {
                width: 100%;
                border-collapse: collapse;
                
                thead {
                    background: linear-gradient(135deg, #dc2626, #ef4444);
                    
                    th {
                        padding: 16px;
                        text-align: left;
                        font-weight: 600;
                        color: white;
                        font-size: 14px;
                        text-transform: uppercase;
                        letter-spacing: 0.5px;
                        border-bottom: 2px solid #b91c1c;
                        
                        &:first-child {
                            border-top-left-radius: 8px;
                        }
                        
                        &:last-child {
                            border-top-right-radius: 8px;
                        }
                    }
                }
                
                tbody {
                    tr {
                        border-bottom: 1px solid #f3f4f6;
                        transition: all 0.2s ease;
                        
                        &:hover {
                            background: #fef2f2;
                            transform: translateX(2px);
                        }
                        
                        &:last-child {
                            border-bottom: none;
                        }
                        
                        &:nth-child(odd) {
                            background: #fafafa;
                            
                            &:hover {
                                background: #fef2f2;
                            }
                        }
                    }
                    
                    td {
                        padding: 16px;
                        vertical-align: middle;
                        
                        &:first-child {
                            font-weight: 700;
                            color: #dc2626;
                            font-size: 16px;
                            width: 60px;
                            text-align: center;
                            background: #fef2f2;
                            border-right: 2px solid #fecaca;
                        }
                        
                        &:nth-child(2) {
                            font-weight: 600;
                            color: #1f2937;
                            max-width: 200px;
                        }
                        
                        &:nth-child(3) {
                            font-weight: 600;
                            color: #dc2626;
                            text-align: center;
                            background: #fef2f2;
                            border-radius: 4px;
                            margin: 2px;
                        }
                        
                        &:nth-child(4), &:nth-child(5) {
                            font-weight: 600;
                            color: #059669;
                            text-align: right;
                        }
                    }
                }
            }
        }
        
        .no-data {
            text-align: center;
            padding: 60px 20px;
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            
            .no-data-icon {
                font-size: 48px;
                color: #d1d5db;
                margin-bottom: 16px;
            }
            
            p {
                color: #6b7280;
                margin: 8px 0;
                
                &:first-of-type {
                    font-size: 18px;
                    font-weight: 600;
                    color: #374151;
                }
            }
            
            .no-data-subtext {
                font-size: 14px;
                color: #9ca3af;
            }
        }
    }

    /* Order Details Modal Styles */
    .order-details-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        padding: 20px;
    }

    .order-details-modal {
        background: white;
        border-radius: 12px;
        max-width: max-content;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px;
            border-bottom: 1px solid #e5e7eb;
            background: #f9fafb;
            border-radius: 12px 12px 0 0;
            
            h3 {
                margin: 0;
                color: #1f2937;
                font-size: 20px;
                font-weight: 600;
            }
            
            .modal-close-btn {
                background: none;
                border: none;
                font-size: 24px;
                color: #6b7280;
                cursor: pointer;
                padding: 4px;
                border-radius: 4px;
                transition: all 0.2s ease;
                
                &:hover {
                    background: #f3f4f6;
                    color: #374151;
                }
            }
        }
        
        .modal-content {
            padding: 24px;
            
            .order-info-grid {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 32px;
                margin-bottom: 32px;
                
                @media (max-width: 768px) {
                    grid-template-columns: 1fr;
                    gap: 24px;
                }
            }
            
            .info-section {
                h4 {
                    margin: 0 0 16px 0;
                    color: #1f2937;
                    font-size: 16px;
                    font-weight: 600;
                    padding-bottom: 8px;
                    border-bottom: 2px solid #e5e7eb;
                }
                
                .info-item {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    padding: 8px 0;
                    border-bottom: 1px solid #f3f4f6;
                    
                    &:last-child {
                        border-bottom: none;
                    }
                    
                    label {
                        font-weight: 600;
                        color: #374151;
                        min-width: 100px;
                    }
                    
                    span {
                        color: #6b7280;
                        text-align: right;
                        
                        &.total-amount {
                            font-weight: 700;
                            color: #059669;
                            font-size: 18px;
                        }
                        
                        &.technical-data {
                            font-family: monospace;
                            font-size: 12px;
                            background: #f3f4f6;
                            padding: 2px 6px;
                            border-radius: 4px;
                        }
                        
                        &.user-agent {
                            font-size: 12px;
                            max-width: 200px;
                            word-break: break-all;
                        }
                    }
                }
            }
            
            .products-section {
                margin-bottom: 32px;
                
                h4 {
                    margin: 0 0 16px 0;
                    color: #1f2937;
                    font-size: 16px;
                    font-weight: 600;
                    padding-bottom: 8px;
                    border-bottom: 2px solid #e5e7eb;
                }
                
                .products-table {
                    border: 1px solid #e5e7eb;
                    border-radius: 8px;
                    overflow: hidden;
                    
                    table {
                        width: 100%;
                        border-collapse: collapse;
                        
                        thead {
                            background: #f9fafb;
                            
                            th {
                                padding: 12px;
                                text-align: left;
                                font-weight: 600;
                                color: #374151;
                                font-size: 14px;
                                border-bottom: 1px solid #e5e7eb;
                            }
                        }
                        
                        tbody {
                            tr {
                                border-bottom: 1px solid #f3f4f6;
                                
                                &:last-child {
                                    border-bottom: none;
                                }
                                
                                &:hover {
                                    background: #f9fafb;
                                }
                            }
                            
                            td {
                                padding: 12px;
                                
                                .product-link {
                                    color: #ffffff;
                                    text-decoration: none;
                                    font-size: 12px;
                                    
                                    &:hover {
                                        text-decoration: underline;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            
            .technical-info {
                background: #f9fafb;
                padding: 20px;
                border-radius: 8px;
                border: 1px solid #e5e7eb;
                
                h4 {
                    margin: 0 0 16px 0;
                    color: #1f2937;
                    font-size: 16px;
                    font-weight: 600;
                }
                
                .info-grid {
                    display: grid;
                    grid-template-columns: 1fr 1fr;
                    gap: 16px;
                    
                    @media (max-width: 768px) {
                        grid-template-columns: 1fr;
                    }
                }
            }
        }
        
        .modal-footer {
            padding: 20px 24px;
            border-top: 1px solid #e5e7eb;
            background: #f9fafb;
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            border-radius: 0 0 12px 12px;
            
            .btn {
                padding: 8px 16px;
                border: none;
                border-radius: 6px;
                font-size: 14px;
                font-weight: 500;
                cursor: pointer;
                transition: all 0.2s ease;
                
                &.btn-primary {
                    background: #3b82f6;
                    color: white;
                    
                    &:hover {
                        background: #2563eb;
                    }
                }
                
                &.btn-secondary {
                    background: #6b7280;
                    color: white;
                    
                    &:hover {
                        background: #4b5563;
                    }
                }
                
                &.btn-default {
                    background: #f3f4f6;
                    color: #374151;
                    border: 1px solid #d1d5db;
                    
                    &:hover {
                        background: #e5e7eb;
                    }
                }
            }
        }
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}