/**
 * Habibur Analytics - Premium Glassmorphism Styles
 * 
 * Design System: 
 * - Background: Translucent Glass with Backdrop Blur
 * - Palette: Indigo Primary, Purple Secondary, Slate Text
 * - Accents: Soft Shadows, Glow Effects
 */

:root {
  --hr-primary: #6366f1;
  --hr-primary-light: #818cf8;
  --hr-secondary: #a855f7;
  --hr-text-main: #1e293b;
  --hr-text-muted: #64748b;
  --hr-glass-bg: rgba(255, 255, 255, 0.75);
  --hr-glass-border: rgba(255, 255, 255, 0.45);
  --hr-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  --hr-shadow-hover: 0 8px 32px 0 rgba(99, 102, 241, 0.15);
  --hr-radius: 14px;
  --hr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Utility & Helper Classes (To Eliminate Inline Styles) --- */

/* Margins */
.hr-mt-5 {
  margin-top: 5px;
}

.hr-mt-10 {
  margin-top: 10px;
}

.hr-mt-15 {
  margin-top: 15px;
}

.hr-mt-20 {
  margin-top: 20px;
}

.hr-mt-25 {
  margin-top: 25px;
}

.hr-mt-30 {
  margin-top: 30px;
}

.hr-mr-5 {
  margin-right: 5px;
}

.hr-mr-10 {
  margin-right: 10px;
}

.hr-ml-10 {
  margin-left: 10px;
}

/* Flex & Grid */
.hr-flex {
  display: flex;
}

.hr-flex-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hr-flex-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hr-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Text & Links */
.hr-font-600 {
  font-weight: 600;
}

.hr-text-primary {
  color: var(--hr-primary) !important;
}

.hr-text-danger {
  color: #ef4444 !important;
}

.hr-text-success {
  color: #10b981 !important;
}

.hr-text-warning {
  color: #facc15 !important;
}

.hr-no-deco {
  text-decoration: none;
}

/* Component Specific Refinements */
.hr-notice-accent {
  border-left: 4px solid var(--hr-primary) !important;
}

.hr-icon-small {
  font-size: 14px !important;
  width: 14px !important;
  height: 14px !important;
}

.hr-icon-medium {
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
}

.hr-btn-submit {
  background: var(--hr-primary) !important;
  border-color: var(--hr-primary) !important;
  border-radius: 8px !important;
  padding: 8px 30px !important;
  height: auto !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
  transition: all 0.3s ease !important;
}

.hr-btn-submit:hover {
  background: var(--hr-primary-light) !important;
  border-color: var(--hr-primary-light) !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
  transform: translateY(-2px);
}

.hr-btn-danger {
  border-radius: 8px !important;
  color: #ef4444 !important;
  border-color: #ef4444 !important;
}

/* General Wrapper Overlay for background elements if needed */

.hr-header-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hr-analytics-admin,
.hr-analytics-settings {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.hr-settings-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--hr-text-main);
  letter-spacing: -0.02em;
}

.hr-settings-header p {
  margin: 0px;
  font-size: 16px;
}

/* Custom Notice Styling */
.hr-notice {
  background: var(--hr-glass-bg) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--hr-glass-border) !important;
  border-left: 4px solid #10b981 !important;
  box-shadow: var(--hr-shadow) !important;
  border-radius: var(--hr-radius) !important;
  padding: 2px 20px !important;
  margin: 15px 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hr-notice p {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--hr-text-main) !important;
}

.notice-dismiss, .notice-dismiss:focus {
    position: inherit;
    padding: 0;
    outline: none;
    box-shadow: none;
}

.notice-dismiss:before {
    font: normal 20px/20px dashicons;
}

/* Glass Container Base */
.hr-container,
.hr-stat-box,
.hr-top-post-info {
  background: var(--hr-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hr-glass-border);
  box-shadow: var(--hr-shadow);
  border-radius: var(--hr-radius);
  transition: var(--hr-transition);
}

/* Stats Grid */
.hr-stats-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 30px;
}

.hr-analytics-admin .hr-stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.hr-analytics-widget .hr-stats-grid {
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

/* Stat Box Enhancements */
.hr-stat-box {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.hr-stat-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--hr-shadow-hover);
  border-color: var(--hr-primary-light);
}

.hr-stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--hr-primary), var(--hr-secondary));
  opacity: 0.8;
}

.hr-stat-icon-wrapper {
  margin-bottom: 12px;
}

.hr-stat-icon-wrapper .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: var(--hr-primary);
}

.hr-stat-value {
  font-weight: 700;
  color: var(--hr-text-main);
  line-height: 1.2;
  margin-bottom: 4px;
}

.hr-analytics-admin .hr-stat-value {
  font-size: 34px;
}

.hr-analytics-widget .hr-stat-value {
  font-size: 26px;
}

.hr-stat-label {
  font-size: 14px;
  color: var(--hr-text-muted);
  font-weight: 500;
}

/* Layout Rows */
.hr-layout-row {
  display: grid;
  gap: 25px;
  margin-bottom: 30px;
}

.hr-layout-row .hr-container {
  margin-bottom: 0 !important;
}

.hr-layout-2-1 {
  grid-template-columns: 2fr 1fr;
}

.hr-layout-1-2 {
  grid-template-columns: 1fr 2fr;
}

.hr-layout-1-1 {
  grid-template-columns: 1fr 1fr;
}

.hr-chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Components */
.hr-container {
  padding: 25px;
}

.hr-container h2 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--hr-text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hr-period-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hr-inline-form select {
  border-radius: 8px;
  padding: 4px 12px;
  border: 1px solid #ddd;
  box-shadow: none;
  height: 35px;
  min-width: 160px;
}

.hr-inline-form button.button {
  height: 35px;
  border-radius: 8px;
  padding: 0 15px;
}

/* Top Content Table */
.hr-container table.widefat {
  border: none;
  box-shadow: none;
  background: transparent;
}

.hr-container table.widefat thead th {
  background: transparent;
  border-bottom: 2px solid #f1f5f9;
  padding: 12px 10px;
  color: var(--hr-text-muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hr-container table.widefat tbody td {
  padding: 15px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--hr-text-main);
}

.hr-container table.widefat tbody tr:last-child td {
  border-bottom: none;
}

/* Widgets & Dashboard Integration */
.hr-analytics-widget .hr-stat-box {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: none;
  text-align: center;
}

.hr-top-post-info {
  padding: 15px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.hr-widget-footer {
  margin-top: 20px;
  text-align: center;
}

.hr-widget-footer .button-primary {
  background: var(--hr-primary) !important;
  border-color: var(--hr-primary) !important;
  border-radius: 8px !important;
  padding: 6px 20px !important;
  font-weight: 600 !important;
  height: auto !important;
}

/* Settings Specific */
.hr-analytics-settings .hr-container {
  margin-bottom: 25px;
}

.hr-analytics-settings .form-table th {
  width: 200px;
  padding: 20px 10px 20px 0;
  color: var(--hr-text-main);
  font-weight: 600;
}

.hr-analytics-settings .form-table td {
  padding: 15px 10px;
}

.hr-analytics-settings label {
  cursor: pointer;
  font-size: 14px;
  color: var(--hr-text-main);
  transition: var(--hr-transition);
  margin-right: 10px;
}

.hr-analytics-settings label:hover {
  color: var(--hr-primary);
}

.hr-analytics-settings input[type="checkbox"] {
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  width: 18px;
  height: 18px;
  margin-top: 0;
  box-shadow: none;
}

.hr-analytics-settings input[type="checkbox"]:checked {
  border-color: var(--hr-primary);
  position: relative;
}

.hr-analytics-settings input[type="checkbox"]:checked::before {
  margin: -2px 0 0 -3px;
}

.hr-analytics-settings .description {
  font-style: normal;
  color: var(--hr-text-muted);
  font-size: 13px;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 960px) {

  .hr-analytics-admin .hr-stats-grid,
  .hr-layout-row,
  .hr-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 782px) {

  .hr-analytics-settings .form-table th {
    padding: 20px 0px 0px 0;
  }

  .hr-analytics-settings .form-table td {
    padding: 7px 0 0;
  }

  .hr-analytics-settings input[type="checkbox"]:checked::before {
    margin: -2px 0 0 -4px;
    width: 22px;
    height: 22px;
  }

  .hr-inline-form button.button {
    margin-bottom: 0;
  }

}