/* ===================================
   DASHBOARD COMPONENT STYLING
   Integrated dashboard for MeterRingAI
   =================================== */

.dashboard-section {
  width: 100%;
  background: transparent;
  color: #e2e8f0;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.dashboard-section * {
  box-sizing: border-box;
}

.dashboard-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(73, 103, 188, 0.2);
  margin-bottom: 30px;
}

.dashboard-logo {
  font-size: 24px;
  font-weight: 700;
  color: #47d5a6;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-search-container {
  position: relative;
  width: 280px;
}

.dashboard-search-container input {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(73, 103, 188, 0.2);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 14px;
  padding-left: 40px;
  transition: all 0.3s ease;
}

.dashboard-search-container input::placeholder {
  color: #94a3b8;
}

.dashboard-search-container input:focus {
  outline: none;
  border-color: #4967bc;
  box-shadow: 0 0 0 2px rgba(73, 103, 188, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-search-container i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* Stats Grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.dashboard-stat-card {
  background: linear-gradient(
    135deg,
    rgba(22, 27, 46, 0.8),
    rgba(22, 27, 46, 0.5)
  );
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(73, 103, 188, 0.15);
}

.dashboard-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(73, 103, 188, 0.3);
}

.dashboard-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, #4967bc, #47d5a6);
}

.dashboard-stat-title {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.dashboard-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #47d5a6;
  margin-bottom: 8px;
  font-family: "Courier New", monospace;
}

.dashboard-stat-change {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
}

.dashboard-change-up {
  color: #10b981;
}

.dashboard-change-down {
  color: #ef4444;
}

/* Main Content Grid */
.dashboard-main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

@media (max-width: 1024px) {
  .dashboard-main-content {
    grid-template-columns: 1fr;
  }
}

/* Card Styling */
.dashboard-card {
  background: linear-gradient(
    135deg,
    rgba(22, 27, 46, 0.8),
    rgba(22, 27, 46, 0.5)
  );
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: 1px solid rgba(73, 103, 188, 0.15);
}

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

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(73, 103, 188, 0.15);
}

.dashboard-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.dashboard-view-all {
  color: #4967bc;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s ease;
  cursor: pointer;
}

.dashboard-view-all:hover {
  color: #47d5a6;
}

/* Table Styling */
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dashboard-table th {
  text-align: left;
  padding: 12px 10px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(73, 103, 188, 0.1);
  color: #e2e8f0;
}

.dashboard-table tr:last-child td {
  border-bottom: none;
}

.dashboard-table tr {
  transition: background 0.3s ease;
  cursor: pointer;
}

.dashboard-table tr:hover {
  background: rgba(73, 103, 188, 0.05);
}

.dashboard-crypto-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 10px;
  background: linear-gradient(135deg, #4967bc, #47d5a6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  color: white;
}

.dashboard-crypto-name {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #e2e8f0;
}

.dashboard-crypto-symbol {
  color: #94a3b8;
  font-size: 11px;
  margin-left: 6px;
  font-weight: 500;
}

.dashboard-price-change {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
  gap: 3px;
}

.dashboard-price-change.up {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.dashboard-price-change.down {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* Chart */
.dashboard-chart-container {
  position: relative;
  height: 280px;
  width: 100%;
  margin-top: 10px;
}

.dashboard-timeframe-select {
  background: rgba(22, 27, 46, 0.6);
  color: #e2e8f0;
  border: 1px solid rgba(73, 103, 188, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.dashboard-timeframe-select:hover {
  border-color: #4967bc;
  background: rgba(22, 27, 46, 0.8);
}

.dashboard-timeframe-select:focus {
  outline: none;
  border-color: #4967bc;
  box-shadow: 0 0 0 2px rgba(73, 103, 188, 0.2);
}

/* Footer */
.dashboard-footer {
  text-align: center;
  padding: 15px 0;
  color: #94a3b8;
  font-size: 12px;
  border-top: 1px solid rgba(73, 103, 188, 0.1);
  margin-top: 20px;
}

.dashboard-footer p {
  margin: 4px 0;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .dashboard-search-container {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .dashboard-stat-card {
    padding: 14px;
  }

  .dashboard-stat-title {
    font-size: 11px;
  }

  .dashboard-stat-value {
    font-size: 20px;
  }

  .dashboard-card {
    padding: 16px;
  }

  .dashboard-card-title {
    font-size: 15px;
  }

  .dashboard-table {
    font-size: 12px;
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: 10px 8px;
  }

  .dashboard-chart-container {
    height: 240px;
  }

  .dashboard-crypto-icon {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .dashboard-table th:nth-child(3),
  .dashboard-table td:nth-child(3) {
    display: none;
  }
}

/* Responsive - Mobile */
@media (max-width: 576px) {
  .dashboard-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 0;
  }

  .dashboard-header {
    padding: 15px 0;
    margin-bottom: 20px;
    gap: 12px;
  }

  .dashboard-logo {
    font-size: 20px;
  }

  .dashboard-search-container {
    width: 100%;
    max-width: 100%;
  }

  .dashboard-search-container input {
    padding: 10px 16px;
    padding-left: 36px;
    font-size: 13px;
    border-radius: 16px;
  }

  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }

  .dashboard-stat-card {
    padding: 12px;
    border-radius: 10px;
  }

  .dashboard-stat-card::before {
    height: 2px;
  }

  .dashboard-stat-title {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .dashboard-stat-value {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .dashboard-stat-change {
    font-size: 12px;
  }

  .dashboard-main-content {
    gap: 12px;
    margin-bottom: 18px;
    grid-template-columns: 1fr; /* Ensure single column on mobile */
  }

  .dashboard-card {
    padding: 12px;
    border-radius: 10px;
    width: 100%; /* Match the stat card width */
  }

  .dashboard-card-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .dashboard-card-title {
    font-size: 14px;
  }

  .dashboard-table {
    font-size: 11px;
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: 8px 6px;
  }

  .dashboard-table th {
    font-size: 10px;
  }

  .dashboard-chart-container {
    height: 200px;
    margin-top: 8px;
  }

  .dashboard-crypto-icon {
    width: 22px;
    height: 22px;
    font-size: 10px;
    margin-right: 8px;
  }

  .dashboard-crypto-name {
    font-size: 13px;
  }

  .dashboard-crypto-symbol {
    font-size: 10px;
    margin-left: 4px;
  }

  .dashboard-price-change {
    padding: 3px 6px;
    font-size: 11px;
    border-radius: 10px;
  }

  .dashboard-table th:nth-child(3),
  .dashboard-table td:nth-child(3) {
    display: none;
  }

  .dashboard-timeframe-select {
    padding: 5px 10px;
    font-size: 11px;
  }

  .dashboard-footer {
    padding: 12px 0;
    font-size: 11px;
    margin-top: 15px;
  }

  .dashboard-footer p {
    margin: 3px 0;
  }
}

/* Extra small mobile devices */
@media (max-width: 380px) {
  .dashboard-stat-value {
    font-size: 16px;
  }

  .dashboard-card-title {
    font-size: 13px;
  }

  .dashboard-table {
    font-size: 10px;
  }

  .dashboard-chart-container {
    height: 180px;
  }

  .dashboard-crypto-name {
    font-size: 12px;
  }
}