/* ===== STATISTIC PAGE STYLES ===== */
/* Стили для страницы статистики */

/* ===== CSS VARIABLES ===== */
:root {
  --statistic-border: rgba(255, 255, 255, 0.1);
  --statistic-border-light: rgba(255, 255, 255, 0.15);
  --statistic-bg-overlay: rgba(255, 255, 255, 0.03);
  --statistic-bg-overlay-hover: rgba(255, 255, 255, 0.05);
  --statistic-card-bg: #1a1a2e;
  --statistic-transition: all 0.3s ease;
  --statistic-transition-smooth: all 0.4s ease;
  --statistic-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  --statistic-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --statistic-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.2);
}

/* ===== BASE RESET ===== */
.statistic-container *,
.statistic-container *::before,
.statistic-container *::after {
  box-sizing: border-box;
}

/* ===== MAIN CONTAINER ===== */
.statistic-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* ===== CONTROLS ===== */
.statistic-controls {
  background: var(--statistic-card-bg);
  border: 1px solid var(--statistic-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

.controls-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.control-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-section:first-child {
  flex: 1;
  min-width: 300px;
}

.control-section:last-child {
  min-width: 220px;
  flex-shrink: 0;
}

.controls-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.type-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-type {
  background: var(--statistic-bg-overlay);
  border: 1px solid var(--statistic-border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--statistic-transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 200px;
  justify-content: center;
  text-align: center;
}

.btn-type:hover {
  background: var(--statistic-bg-overlay-hover);
  border-color: var(--statistic-border-light);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-type.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--statistic-shadow-sm);
}

.btn-type.active:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--statistic-shadow);
}

.btn-type i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.btn-type span {
  white-space: nowrap;
}

/* ===== DATE PICKER ===== */
.date-picker-input {
  position: relative;
  display: flex;
  align-items: center;
}

.date-input {
  background: var(--statistic-bg-overlay);
  border: 1px solid var(--statistic-border);
  border-radius: 12px;
  padding: 0.75rem 3rem 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
  transition: var(--statistic-transition);
  cursor: pointer;
}

.date-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-input::placeholder {
  color: var(--text-muted);
}

.date-icon {
  position: absolute;
  right: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  pointer-events: none;
  transition: var(--statistic-transition);
}

.date-input:focus + .date-icon {
  color: var(--primary);
}


/* ===== CONTENT SECTIONS ===== */
.statistic-content {
  min-height: 400px;
  position: relative;
  width: 100%;
}

.statistic-section {
  opacity: 0;
  transform: translateY(20px);
  transition: var(--statistic-transition-smooth);
  width: 100%;
}

.statistic-section.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LOADING STATE ===== */
.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  width: 100%;
}

.loading-spinner {
  text-align: center;
}

.loading-text {
  color: var(--text-secondary);
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* ===== STATISTIC HEADER ===== */
.statistic-header {
  margin-bottom: 2rem;
  width: 100%;
}

.statistic-overview-card {
  background: var(--statistic-card-bg);
  border: 1px solid var(--statistic-border);
  border-radius: 16px;
  padding: 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--statistic-transition);
  width: 100%;
}

.statistic-overview-card:hover {
  border-color: var(--statistic-border-light);
  transform: translateY(-2px);
}

.overview-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.overview-content {
  flex: 1;
  min-width: 0;
}

.overview-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.overview-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.overview-date,
.overview-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* ===== DETAIL CONTAINERS ===== */
.warehouses-container,
.routes-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* ===== WAREHOUSE CARD ===== */
.warehouse-card {
  background: var(--statistic-card-bg);
  border: 1px solid var(--statistic-border);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--statistic-transition);
  width: 100%;
}

.warehouse-card:hover {
  transform: translateY(-2px);
  border-color: var(--statistic-border-light);
  box-shadow: var(--statistic-shadow);
}

.warehouse-header {
  background: var(--statistic-bg-overlay);
  border-bottom: 1px solid var(--statistic-border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.warehouse-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.warehouse-total {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--statistic-bg-overlay-hover);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  white-space: nowrap;
}

.warehouse-body {
  padding: 1.5rem;
}

.package-type-section {
  margin-bottom: 1.5rem;
}

.package-type-section:last-child {
  margin-bottom: 0;
}

.package-type-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.package-type-icon {
  width: 32px;
  height: 32px;
  background: var(--info);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.package-type-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.package-type-total {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.supply-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.supply-item {
  background: var(--statistic-bg-overlay);
  border: 1px solid var(--statistic-border);
  border-radius: 8px;
  padding: 0.75rem;
  transition: var(--statistic-transition);
  min-width: 0;
}

.supply-item:hover {
  background: var(--statistic-bg-overlay-hover);
  border-color: var(--statistic-border-light);
}

.supply-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.supply-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.supply-multiplier {
  background: var(--primary);
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== ROUTE CARD ===== */
.route-card {
  background: var(--statistic-card-bg);
  border: 1px solid var(--statistic-border);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--statistic-transition);
  width: 100%;
}

.route-card:hover {
  transform: translateY(-2px);
  border-color: var(--statistic-border-light);
  box-shadow: var(--statistic-shadow);
}

.route-header {
  background: var(--statistic-bg-overlay);
  border-bottom: 1px solid var(--statistic-border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.route-arrow-icon {
  width: 40px;
  height: 40px;
  background: var(--success);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.route-details {
  flex: 1;
  min-width: 0;
}

.route-path {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  word-break: break-word;
}

.route-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.route-stats span {
  background: var(--statistic-bg-overlay-hover);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  width: 100%;
  padding: 2rem;
}

.empty-state-content {
  text-align: center;
  max-width: 300px;
  margin: 0 auto;
  width: 100%;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--statistic-bg-overlay-hover);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  font-size: 2rem;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
  word-break: break-word;
}

.empty-state-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
  word-break: break-word;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets */
@media (max-width: 992px) {
  .statistic-container {
    padding: 0 0.75rem;
  }
  
  .supply-items {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  .statistic-container {
    padding: 0 0.5rem;
  }

  .statistic-controls {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .controls-header {
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
  }

  .control-section:first-child,
  .control-section:last-child {
    min-width: auto;
    flex: none;
  }

  .type-buttons {
    flex-direction: column;
    gap: 0.75rem;
    min-width: auto;
  }

  .btn-type {
    min-width: auto;
    padding: 1rem;
    justify-content: center;
    width: 100%;
  }

  .date-input {
    width: 100%;
  }

  .statistic-overview-card {
    padding: 1.25rem;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .overview-icon {
    margin: 0 auto;
  }

  .overview-value {
    font-size: 1.75rem;
  }

  .warehouse-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  .warehouse-body {
    padding: 1.25rem;
  }

  .supply-items {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .route-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
  }

  .route-stats {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .package-type-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .package-type-total {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* Small screens */
@media (max-width: 576px) {
  .statistic-container {
    padding: 0 0.25rem;
  }

  .statistic-controls {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .controls-title {
    font-size: 1rem;
  }

  .controls-header {
    gap: 1rem;
  }

  .control-section {
    gap: 0.75rem;
  }

  .btn-type {
    padding: 0.875rem 1rem;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .btn-type i {
    font-size: 1rem;
  }

  .date-input {
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    font-size: 0.85rem;
  }

  .date-icon {
    right: 0.875rem;
    font-size: 0.85rem;
  }

  .warehouse-body,
  .statistic-overview-card {
    padding: 1rem;
  }

  .overview-value {
    font-size: 1.5rem;
  }

  .empty-state {
    padding: 1rem;
  }

  .empty-state-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .empty-state-title {
    font-size: 1.1rem;
  }

  .empty-state-subtitle {
    font-size: 0.85rem;
  }
}



/* Bootstrap gutter overrides */
@media (max-width: 768px) {
  .statistic-header .row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }
}

@media (max-width: 576px) {
  .statistic-header .row {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
  }
}