/*
 * Report Dashboard Styles
 * Path: public/themes/frontend/css/report.css
 * 
 * Main stylesheet for the report feature dashboard.
 * Contains styles for: wrapper, topbar, tabs, KPIs, charts, cards, and responsive design.
 */

/* ===== Main Wrapper ===== */
#rpt-wrapper {
  background: #FFF8EC;
  min-height: 100vh;
  padding: 0 0 40px;
  font-family: 'Open Sans', sans-serif;
}

/* ===== Topbar & Navigation ===== */
.rpt-topbar {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.rpt-topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 3s infinite;
  pointer-events: none;
}

/* ===== Tabs Container ===== */
.rpt-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #C07B2A #f5f5f5;
}

.rpt-tabs::-webkit-scrollbar {
  height: 6px;
}

.rpt-tabs::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 10px;
}

.rpt-tabs::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #C07B2A 0%, #F5A623 100%);
  border-radius: 10px;
}

.rpt-tabs::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #A66820 0%, #E89A1C 100%);
}

/* ===== Tab Buttons ===== */
.rpt-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  color: #5a5a5a;
  white-space: nowrap;
  text-decoration: none;
  border: 1.5px solid transparent;
  background: transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  letter-spacing: 0.3px;
}

.rpt-tab::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, #C07B2A 0%, #F5A623 100%);
  border-radius: 3px 3px 0 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rpt-tab:hover {
  background: linear-gradient(135deg, rgba(192, 123, 42, 0.08) 0%, rgba(245, 166, 35, 0.08) 100%);
  color: #C07B2A;
  border-color: rgba(192, 123, 42, 0.2);
  transform: translateY(-1px);
}

.rpt-tab:hover::before {
  transform: translateX(-50%) scaleX(1);
}

.rpt-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #C07B2A 0%, #F5A623 100%);
  border-color: #C07B2A;
  box-shadow: 0 4px 12px rgba(192, 123, 42, 0.3);
  transform: translateY(-2px);
}

.rpt-tab.active::before {
  display: none;
}

.rpt-tab.active::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  animation: pulse 2s infinite;
}

.rpt-tab:active {
  transform: translateY(0);
}

.rpt-tab:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(192, 123, 42, 0.3);
}

.rpt-tab:focus:not(:focus-visible) {
  box-shadow: none;
}

/* Tab Icons */
.rpt-tab svg {
  transition: transform 0.3s ease;
}

.rpt-tab:hover svg {
  transform: scale(1.1) rotate(5deg);
}

.rpt-tab.active svg {
  animation: iconPulse 1s ease-in-out infinite alternate;
}

/* Tab Separator */
.rpt-tab-separator {
  width: 1px;
  height: 32px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    #d0d0d0 20%,
    #d0d0d0 80%,
    transparent 100%
  );
  margin: 0 8px;
  flex-shrink: 0;
}

/* ===== Logo Container ===== */
.rpt-logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  margin-left: 16px;
  border-left: 2px solid #e0e0e0;
}

.rpt-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.rpt-logo:hover {
  transform: scale(1.05) rotate(2deg);
}

/* ===== Page Container ===== */
.rpt-page {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.rpt-page.active {
  display: block;
}

.rpt-page::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.rpt-page::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.rpt-page::-webkit-scrollbar-thumb {
  background: #C07B2A;
  border-radius: 4px;
}

.rpt-page::-webkit-scrollbar-thumb:hover {
  background: #A66820;
}

/* ===== Typography ===== */
.rpt-title {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

/* ===== Filters ===== */
.rpt-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rpt-filters select {
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  border: 1.5px solid #d0b98a;
  border-radius: 20px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center;
  appearance: none;
  color: #333;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  transition: all 0.2s ease;
}

.rpt-filters select:focus {
  outline: none;
  border-color: #185FA5;
}

.rpt-filters select:hover {
  border-color: #C07B2A;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ===== KPI Cards ===== */
.rpt-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.rpt-kpi {
  background: #FFF3D6;
  border: 1.5px solid #E8D9C0;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rpt-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rpt-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.rpt-kpi-icon svg {
  width: 24px;
  height: 24px;
}

.rpt-kpi-icon.gold {
  background: linear-gradient(135deg, #F5A623 0%, #E89A1C 100%);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
  color: #fff;
}

.rpt-kpi-icon.blue {
  background: linear-gradient(135deg, #185FA5 0%, #134A87 100%);
  box-shadow: 0 4px 12px rgba(24, 95, 165, 0.3);
  color: #fff;
}

.rpt-kpi-icon.green {
  background: linear-gradient(135deg, #27A060 0%, #1F8A4F 100%);
  box-shadow: 0 4px 12px rgba(39, 160, 96, 0.3);
  color: #fff;
}

.rpt-kpi-content {
  flex: 1;
  min-width: 0;
}

.rpt-kpi-label {
  font-size: 11px;
  color: #777;
  margin-bottom: 2px;
}

.rpt-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.1;
}

.rpt-kpi-badge {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  display: inline-block;
  font-weight: 500;
}

.rpt-kpi-badge.badge-success {
  background: rgba(39, 160, 96, 0.15);
  color: #27A060;
  font-weight: 600;
}

.rpt-kpi-animated {
  animation: slideInUp 0.4s ease-out;
  animation-fill-mode: both;
}

.rpt-kpi-animated:nth-child(1) {
  animation-delay: 0.1s;
}

.rpt-kpi-animated:nth-child(2) {
  animation-delay: 0.2s;
}

.rpt-kpi-animated:nth-child(3) {
  animation-delay: 0.3s;
}

/* ===== Grid Rows ===== */
.rpt-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.rpt-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.rpt-row.cols-3 {
  grid-template-columns: 2fr 1fr 1fr;
}

/* ===== Cards ===== */
.rpt-card {
  background: #FFF3D6;
  border: 1.5px solid #E8D9C0;
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow 0.2s ease;
}

.rpt-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rpt-card-enhanced {
  position: relative;
  overflow: hidden;
}

.rpt-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F5A623, #185FA5, #27A060);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rpt-card-enhanced:hover::before {
  opacity: 1;
}

.rpt-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.rpt-card-icon {
  width: 32px;
  height: 32px;
  background: rgba(24, 95, 165, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #185FA5;
}

.rpt-card-icon svg {
  width: 18px;
  height: 18px;
}

.rpt-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 0 0 14px 0;
  line-height: 1.4;
}

/* ===== Charts ===== */
.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap.h240 {
  height: 240px;
}

.chart-wrap.h300 {
  height: 300px;
}

.chart-dynamic-height {
  position: relative;
  width: 100%;
}

/* ===== Legend ===== */
.rpt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 11px;
  color: #555;
}

.rpt-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rpt-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rpt-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rpt-legend-text {
  font-size: 11px;
  color: #555;
}

/* ===== Color Utility Classes ===== */
.bg-blue-primary {
  background-color: #2196F3;
}

.bg-blue-light {
  background-color: #00BCD4;
}

.bg-pink-primary {
  background-color: #E91E8C;
}

.bg-pink-light {
  background-color: #F8BBD0;
}

.bg-green-primary {
  background-color: #8BC34A;
}

.bg-green-light {
  background-color: #DCEDC8;
}

/* ===== Header Layout ===== */
.rpt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* ===== Animations ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iconPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
  .rpt-tab {
    padding: 9px 16px;
    font-size: 12px;
  }
  
  .rpt-tab svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
  }
}

@media (max-width: 768px) {
  .rpt-kpis {
    grid-template-columns: 1fr;
  }
  
  .rpt-row.cols-2,
  .rpt-row.cols-3 {
    grid-template-columns: 1fr;
  }
  
  .rpt-title {
    font-size: 24px;
  }
  
  .rpt-topbar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    position: relative;
  }
  
  .rpt-tabs {
    width: 100%;
    justify-content: flex-start;
  }
  
  .rpt-tab-separator {
    display: none;
  }
  
  .rpt-logo-container {
    border-left: none;
    border-top: 2px solid #e0e0e0;
    padding-left: 0;
    padding-top: 12px;
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    justify-content: center;
  }
  
  .rpt-tab {
    padding: 8px 14px;
    font-size: 11px;
  }
  
  .rpt-tab svg {
    display: none;
  }
}

@media (max-width: 480px) {
  .rpt-tab {
    padding: 7px 12px;
    font-size: 10px;
  }
}
