// Dashboard SCSS Styles

.dashboard {
  min-height: 100vh;

  // Header Section
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    margin-bottom: 2rem;

    .header-content {
      h1 {
        font-size: 1.875rem;
        font-weight: 700;
        color: #111827;
        margin-bottom: 0.25rem;
      }

      p {
        color: #6B7280;
        font-size: 0.875rem;
      }
    }

    .header-actions {
      display: flex;
      align-items: center;

      button {
        padding: 0.625rem;
        border-radius: 0.75rem;
        transition: all 0.2s;
        background: transparent;
        border: none;
        cursor: pointer;

        &:hover {
          background-color: #F3F4F6;
        }

        &.notification-btn {
          position: relative;

          .notification-dot {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            width: 0.5rem;
            height: 0.5rem;
            background-color: #FF6B00;
            border-radius: 50%;
          }
        }

        &.profile-btn {
          display: flex;
          align-items: center;
          gap: 0.625rem;
          padding: 0.5rem 0.75rem;

          .avatar {
            width: 2.25rem;
            height: 2.25rem;
            background: linear-gradient(to bottom right, #FF6B00, #FF8534);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.875rem;
            font-weight: 600;
            box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
          }

          span {
            font-size: 0.875rem;
            font-weight: 500;
            color: #111827;
          }
        }

        svg {
          width: 1.25rem;
          height: 1.25rem;
          color: #4B5563;
        }
      }
    }
  }

  // Transaction Summary Section
  .transaction-summary {
    margin-bottom: 2rem;

    h2 {
      font-size: 1.25rem;
      font-weight: 700;
      color: #111827;
      margin-bottom: 1.25rem;
    }

    .status-cards-grid {
      // display: grid;
      // grid-template-columns: repeat(5, 1fr);
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 1.25rem;
      margin-bottom: 2rem;

      .status-card {
        border-radius: 1rem;
        padding: 1.5rem;
        border: 1px solid;
        cursor: pointer;
        transition: all 0.2s;
        flex-grow: 1;

        &:hover {
          box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
        }

        .card-header {
          display: flex;
          align-items: start;
          justify-content: space-between;
          margin-bottom: 0.5rem;

          .icon-wrapper {
            width: 3rem;
            height: 3rem;
            border-radius: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: center;

            svg {
              width: 1.5rem;
              height: 1.5rem;
              stroke-width: 2.5;
            }
          }
        }

        .card-label {
          font-size: 0.875rem;
          font-weight: 500;
          color: #4B5563;
          margin-bottom: 0.5rem;
        }

        .card-content {
          display: flex;
          align-items: center;
          justify-content: space-between;

          .count {
            font-size: 1.75rem;
            font-weight: 700;
            color: #111827;
          }

          .trend {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.875rem;
            font-weight: 600;

            &.positive {
              color: #059669;
            }

            &.negative {
              color: #DC2626;
            }

            svg {
              width: 1rem;
              height: 1rem;
              stroke-width: 2.5;
            }
          }
        }

        .download-link {
          display: flex;
          align-items: center;
          gap: 0.375rem;
          font-size: 0.75rem;
          font-weight: 500;
          color: #6B7280;
          background: none;
          border: none;
          cursor: pointer;
          transition: color 0.2s;

          &:hover {
            color: #FF6B00;
          }

          svg {
            width: 0.875rem;
            height: 0.875rem;
          }
        }
      }
    }
  }

  // Financial Overview Section
  .financial-overview {
    background: white;
    border-radius: 1rem;
    padding: 1.75rem;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    transition: box-shadow 0.2s;

    &:hover {
      box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    .chart-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
      gap: 10px;

      .chart-title {
        h2 {
          font-size: 1.25rem;
          font-weight: 700;
          color: #111827;
          margin-bottom: 0.25rem;
        }

        p {
          font-size: 0.875rem;
          color: #6B7280;
        }
      }

      .chart-legend {
        display: flex;
        align-items: center;
        gap: 1.5rem;

        .legend-item {
          display: flex;
          align-items: center;
          gap: 0.5rem;

          .legend-dot {
            width: 0.75rem;
            height: 0.75rem;
            border-radius: 50%;

            &.income {
              background-color: #27AE60;
            }

            &.expense {
              background-color: #EB5757;
            }
          }

          .legend-text {
            .label {
              font-size: 0.75rem;
              font-weight: 500;
              color: #6B7280;
            }

            .value {
              font-size: 1.125rem;
              font-weight: 700;

              &.income {
                color: #27AE60;
              }

              &.expense {
                color: #EB5757;
              }
            }
          }
        }
      }
    }
  }

  // Quick Stats Section
  .quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;

    .stat-card {
      background: white;
      border-radius: 1rem;
      padding: 1.5rem;
      border: 1px solid #E5E7EB;
      box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
      transition: all 0.2s;

      &:hover {
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
      }

      .stat-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        // margin-bottom: 1rem;

        .label {
          font-size: 0.875rem;
          font-weight: 500;
          color: #6B7280;
        }

        .icon-wrapper {
          width: 2.5rem;
          height: 2.5rem;
          border-radius: 0.75rem;
          display: flex;
          align-items: center;
          justify-content: center;

          &.purple {
            background-color: #FAF5FF;

            svg {
              width: 1.25rem;
              height: 1.25rem;
              color: #9333EA;
            }
          }

          &.blue {
            background-color: #EFF6FF;

            svg {
              width: 1.25rem;
              height: 1.25rem;
              color: #2563EB;
            }
          }

          &.green {
            background-color: #F0FDF4;

            svg {
              width: 1.25rem;
              height: 1.25rem;
              color: #16A34A;
            }
          }
        }
      }

      .stat-value {
        font-size: 1.875rem;
        font-weight: 700;
        color: #111827;
        margin-bottom: 0.5rem;
      }

      .stat-change {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.75rem;
        font-weight: 600;

        &.positive {
          color: #059669;
        }

        &.info {
          color: #2563EB;
        }

        svg {
          width: 0.875rem;
          height: 0.875rem;
        }
      }
    }
  }

  // Mobile Responsive Styles
  @media (max-width: 1024px) {
    .dashboard-grid {
      grid-template-columns: 1fr;
    }

    .summary-cards-grid,
    .status-cards-grid {
      //   grid-template-columns: repeat(2, 1fr) !important;
      gap: 1rem;
    }

    .balance-cards {
      grid-template-columns: 1fr !important;
    }
  }

  @media (max-width: 768px) {
    .header {
      padding: 0;
      margin-bottom: 1.5rem;

      .header-content {
        h1 {
          font-size: 1.5rem;
        }

        p {
          font-size: 0.875rem;
        }
      }
    }

    .transaction-summary {
      h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
      }
    }

    .summary-cards-grid,
    .status-cards-grid {
      // grid-template-columns: 1fr !important;
      gap: 0.875rem;
    }

    .status-card,
    .balance-card {
      padding: 1rem !important;

      .count,
      .balance-amount {
        font-size: 1.75rem;
      }
    }

    .khata-section,
    .transaction-section {
      padding: 1rem;
      margin-bottom: 1rem;
    }

    .khata-header,
    .transaction-header {
      flex-direction: column;
      align-items: flex-start !important;
      gap: 1rem;

      h2 {
        font-size: 1.125rem;
      }

      .header-actions {
        width: 100%;
        flex-direction: column;

        .tabs {
          width: 100%;
        }

        .add-btn {
          width: 100%;
          justify-content: center;
        }
      }
    }

    .chart-section {
      padding: 1rem;
    }

    .status-cards-grid .status-card .card-header .icon-wrapper {
      width: 2rem !important;
      height: 2rem !important;

      svg {
        width: 1rem !important;
        height: 1rem !important;
      }
    }
  }

  @media (max-width: 576px) {
    .status-cards-grid {
      .status-card {
        width: 100% !important;
      }
    }

    .quick-stats {
      .stat-card {
        padding: 1rem !important;
      }
    }

  }

  @media (max-width: 480px) {
    .header {
      .header-content h1 {
        font-size: 1.25rem;
      }
    }

    .transaction-summary h2 {
      font-size: 1.125rem;
    }

    .status-card,
    .balance-card {
      padding: 1rem;

      .count,
      .balance-amount {
        font-size: 1.5rem;
      }

      .card-label {
        font-size: 0.8125rem;
      }
    }
  }

  @media (max-width: 400px) {

    .header {
      flex-direction: column !important;
      // align-items: center !important;
    }

    .chart-legend {
      flex-direction: column !important;
    }

  }
}