/* Dashboard Layout Refactor - RewardStations */

:root {
  --sidebar-width: 280px;
  --topbar-height: 80px;
  --bottom-nav-height: 70px;
  --bg-sidebar: #ffffff;
  --bg-content: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.05);
  --sidebar-nav-gap: 8px;
  --naira-green: #16a34a;
  --font-heading: "Sora", "Trebuchet MS", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

/* Shell & Reset */
body.dashboard-shell-body {
  background-color: var(--bg-content);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.dashboard-metric-icon-teal {
  background: #f0fdf4;
  color: var(--naira-green);
}

.dashboard-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Sidebar (Desktop Only) */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  z-index: 1000;
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

/* Brand Section */
.sidebar-brand {
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark-square {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 8px 16px rgba(74, 67, 217, 0.2);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-info strong {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.2;
}

.brand-info small {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sidebar-nav-gap);
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: #f1f5f9;
  color: var(--ink);
}

.nav-item.active {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-circle {
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--ink);
}

.profile-info {
  overflow: hidden;
}

.profile-info strong {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-info span {
  font-size: 0.76rem;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
}

.btn-logout-secondary:hover {
  color: var(--warn);
}

/* Main Content Area */
.main-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Fix flex overflow */
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 40px 32px;
  z-index: 900;
}

.top-bar-title {
  display: flex;
  flex-direction: column;
}

.top-bar-title h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.top-bar-title p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Page Container & Cards */
.page-container {
  padding: 0 40px 40px;
  flex: 1;
}

.content-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--ink);
}

.page-action-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.page-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Reward History Item Styling (Row Format) */
.reward-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  margin-bottom: 0;
  transition: transform 0.2s;
}

.reward-history-item:last-child {
  border-bottom: none;
}

.reward-history-item:hover {
  transform: translateX(4px);
  background: transparent;
  box-shadow: none;
}

.history-main-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.1rem;
}

.history-date {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.history-meta-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-points {
  margin: 0;
  font-weight: 800;
  color: var(--naira-green); /* Matching the green points in screenshot */
  font-size: 1.1rem;
}

.history-naira {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

/* Mobile & Tablet Overrides */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
  }
  
  .sidebar {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
  }
  
  .main-body {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0;
  }

  .top-bar {
    padding: 24px 20px;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
  }

  .top-bar-title h1 {
    font-size: 1.4rem;
  }

  .top-bar-title p {
    font-size: 0.8rem;
  }


  /* Mobile Profile Card */
  .mobile-profile-card {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  }

  .mobile-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mobile-profile-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mobile-profile-info strong {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-profile-info span {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-btn-logout-full {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-btn-logout-full:hover,
  .mobile-btn-logout-full:active {
    background: #f8fafc;
    color: var(--warn, #ef4444);
    border-color: rgba(239, 68, 68, 0.2);
  }

  .mobile-header-brand {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 8px;
    overflow: hidden;
  }

  

  .page-container {
    padding: 24px 20px calc(var(--bottom-nav-height) + 40px);
  }

  /* Bottom Navigation - Mobile Only */
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
    z-index: 2000;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    flex: 1;
    padding: 8px 0;
  }

  .mobile-nav-item.active {
    color: var(--accent);
  }

  .mobile-nav-icon {
    width: 24px;
    height: 24px;
  }
}

/* Desktop Hidden Elements */
@media (max-width: 640px) {
  .page-container {
    padding: 20px 16px calc(var(--bottom-nav-height) + 28px);
  }

  .content-card {
    padding: 24px 20px;
  }

  .page-action-row {
    margin-bottom: 20px;
  }

  .page-action-link {
    width: 100%;
  }
}

@media (min-width: 1025px) {
  .mobile-nav, .mobile-header-brand, .mobile-profile-card {
    display: none;
  }
}

/* Empty State Styles */
.dashboard-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.dashboard-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}
