/* Reports Main Styles */
.reports-main {
  padding: 24px;
  background: #f8fafc;
  min-height: 100vh;
}

/* Header */
.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.reports-title {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.export-buttons {
  display: flex;
  gap: 8px;
}

.export-btn {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.export-icon {
  font-size: 16px;
}

/* Filters */
.reports-filters {
  display: flex;
  gap: 16px;
  align-items: end;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 21%;
}

.filter-group label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.filter-select,
.filter-date {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  background: white;
  transition: border-color 0.2s ease;
}

.filter-select:focus,
.filter-date:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.find-btn {
  background: #93c5fd;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  height: fit-content;
}

.find-btn:hover {
  background: #3b82f6;
}

/* Charts Section */
.reports-charts {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  margin-top: 24px;
}

.chart-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

/* Pie Chart Styles */
.reports-pie-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pie-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
  width: 100%;
}

.pie-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-text {
  font-size: 11px;
  line-height: 1.2;
}

/* Line Chart Styles */
.reports-chart {
  position: relative;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.chart-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Tooltip Styles */
.reports-tooltip,
.pie-tooltip {
  background: rgba(0, 0, 0, 0.8);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reports-tooltip .tooltip-label,
.pie-tooltip .tooltip-label {
  color: white;
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 4px 0;
}

.reports-tooltip .tooltip-value,
.pie-tooltip .tooltip-value {
  font-size: 12px;
  margin: 2px 0;
}

.pie-tooltip .tooltip-value {
  color: #93c5fd;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .reports-charts {
    grid-template-columns: 1fr;
  }

  .reports-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    min-width: auto;
  }

  .find-btn {
    align-self: flex-start;
  }
}

@media (max-width: 768px) {
  .reports-main {
    padding: 16px;
  }

  .reports-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .export-buttons {
    align-self: flex-end;
  }

  .pie-legend {
    grid-template-columns: 1fr;
  }

  .chart-legend {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .reports-filters {
    padding: 16px;
  }

  .chart-container {
    padding: 16px;
  }

  .filter-group {
    min-width: 100%;
  }
}

/* RTL Support */
.rtl .reports-filters {
  direction: rtl;
}

.rtl .export-buttons {
  order: -1;
}

.rtl .legend-item {
  flex-direction: row-reverse;
}

/* Print Styles */
@media print {

  .export-buttons,
  .reports-filters {
    display: none;
  }

  .reports-charts {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .chart-container {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
}


/* Application Chart Styles */
.application-chart {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

/* Custom Tooltip Styles */
.chart-tooltip {
  background: rgba(0, 0, 0, 0.8);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip-label {
  color: white;
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 4px 0;
}

.tooltip-value {
  color: #93c5fd;
  font-size: 12px;
  margin: 0;
}

/* Recharts overrides */
.recharts-wrapper {
  font-family: inherit;
}

.recharts-cartesian-axis-tick-value {
  font-family: inherit;
}

.recharts-tooltip-wrapper {
  z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .application-chart {
    padding: 16px;
  }

  .tooltip-label {
    font-size: 12px;
  }

  .tooltip-value {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .application-chart {
    padding: 12px;
  }
}

/* RTL Support for Chart */
.rtl .application-chart {
  direction: ltr;
  /* Keep chart direction LTR for proper rendering */
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .chart-tooltip {
    background: rgba(255, 255, 255, 0.9);
  }

  .tooltip-label {
    color: #1f2937;
  }

  .tooltip-value {
    color: #3b82f6;
  }
}

/* Calendar Widget Custom Styles */
.calendar-widget {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 16px;
}

/* Override react-calendar default styles */
.calendar-widget .react-calendar {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
}

.calendar-widget .react-calendar__navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  height: auto;
}

.calendar-widget .react-calendar__navigation button {
  background: transparent;
  border: none;
  color: #374151;
  font-size: 18px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-widget .react-calendar__navigation button:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.calendar-widget .react-calendar__navigation button:disabled {
  background-color: transparent;
  color: #9ca3af;
  cursor: not-allowed;
}

.calendar-widget .react-calendar__navigation__label {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.calendar-widget .react-calendar__month-view__weekdays {
  text-align: center;
  margin-bottom: 8px;
}

.calendar-widget .react-calendar__month-view__weekdays__weekday {
  padding: 8px 4px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-widget .react-calendar__month-view__weekdays__weekday abbr {
  text-decoration: none;
}

.calendar-widget .react-calendar__tile {
  background: transparent;
  border: none;
  color: #374151;
  font-size: 14px;
  font-weight: 400;
  padding: 12px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1px;
}

.calendar-widget .react-calendar__tile:hover {
  background-color: #9fa9b3;
  color: #000;
  border-radius: 50%;
}

.calendar-widget .react-calendar__tile--active,
.calendar-widget .react-calendar__tile--hasActive {
  background-color: #9fa9b3;
  color: #000;
  border-radius: 50%;
}

.calendar-widget .react-calendar__tile--active:hover,
.calendar-widget .react-calendar__tile--hasActive:hover,
.react-calendar__tile--active:enabled:hover,
.react-calendar__tile--active:enabled:focus {
  background-color: #9fa9b3;
  color: #000;
  border-radius: 50%;
}

.calendar-widget .react-calendar__tile--now {
  background-color: #a5c5e5;
  color: #000;
  font-weight: 600;
  border-radius: 50%;
}

.calendar-widget .react-calendar__tile--now:hover {
  background-color: #a5c5e5;
  color: #000;
}

.calendar-widget .react-calendar__month-view__days__day--neighboringMonth {
  color: #9ca3af;
}

.calendar-widget .react-calendar__month-view__days__day--weekend {
  color: #374151;
}

/* RTL Support */
.calendar-widget.rtl {
  direction: rtl;
}

.calendar-widget.rtl .react-calendar__navigation {
  direction: rtl;
}

.calendar-widget.rtl .react-calendar__navigation button:first-child {
  order: 3;
}

.calendar-widget.rtl .react-calendar__navigation button:last-child {
  order: 1;
}

.calendar-widget.rtl .react-calendar__navigation__label {
  order: 2;
}

.calendar-widget.rtl .react-calendar__month-view__weekdays__weekday {
  text-align: center;
}

.calendar-widget.rtl .react-calendar__tile {
  text-align: center;
}

/* LTR Support */
.calendar-widget.ltr {
  direction: ltr;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calendar-widget {
    padding: 12px;
  }

  .calendar-widget .react-calendar__tile {
    padding: 8px 4px;
    font-size: 13px;
  }

  .calendar-widget .react-calendar__navigation__label {
    font-size: 15px;
  }
}