/**
 * BENTO CSS - Hệ thống lưới Bento 3D Nổi Bóng
 * Thiết kế cho Dashboard Công ty CP Giám định - Vinacomin
 */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 1.35rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Base Bento Card - 3D Floating Shadow & Glossy Elevation */
.bento-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: var(--shadow-3d);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

/* Hiệu ứng phản chiếu ánh sáng bề mặt 3D */
.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

/* Hover 3D Lift */
.bento-card:hover {
  transform: translateY(-5px) scale(1.006);
  box-shadow: var(--shadow-3d-hover);
  border-color: rgba(191, 219, 254, 0.9);
}

/* Bento Card Grid Spans */
.bento-card.span-1x1 {
  grid-column: span 1;
  grid-row: span 1;
}

.bento-card.span-2x1 {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-card.span-1x2 {
  grid-column: span 1;
  grid-row: span 2;
}

.bento-card.span-2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-card.span-3x1 {
  grid-column: span 3;
  grid-row: span 1;
}

.bento-card.span-4x1 {
  grid-column: span 4;
  grid-row: span 1;
}

/* Card Header */
.bento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.bento-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.35rem;
  box-shadow: 0 4px 8px rgba(26, 86, 219, 0.12);
  transition: transform 0.25s ease;
}

.bento-card:hover .bento-icon-box {
  transform: scale(1.08) rotate(2deg);
}

.bento-icon-box.icon-amber {
  background: var(--warning-light);
  color: var(--warning);
  box-shadow: 0 4px 8px rgba(217, 119, 6, 0.15);
}

.bento-icon-box.icon-emerald {
  background: var(--success-light);
  color: var(--success);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.15);
}

.bento-icon-box.icon-purple {
  background: #f3e8ff;
  color: #7e22ce;
  box-shadow: 0 4px 8px rgba(126, 34, 206, 0.15);
}

.bento-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* Card Body */
.bento-body {
  flex: 1;
}

.bento-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.3px;
}

.bento-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Stat Numbers & Metrics */
.bento-metric-large {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 0.5rem 0;
}

.bento-metric-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Progress bar inside Bento card */
.bento-progress-container {
  margin-top: 0.85rem;
}

.bento-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.bento-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.bento-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #0284c7 100%);
  border-radius: 9999px;
  transition: width 0.8s ease;
}

/* Card Footer / Action Link */
.bento-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.bento-arrow-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-light);
  transition: transform 0.25s ease;
}

.bento-card:hover .bento-arrow-icon {
  transform: translateX(4px);
}

/* Bento Hero Card */
.bento-hero {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  color: white;
  border: none;
  box-shadow: 0 14px 28px rgba(30, 64, 175, 0.25);
}

.bento-hero::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
}

.bento-hero .bento-title,
.bento-hero .bento-metric-large {
  color: white;
}

.bento-hero .bento-desc {
  color: #bfdbfe;
}

.bento-hero .bento-footer {
  border-top-color: rgba(255, 255, 255, 0.15);
  color: #93c5fd;
}

.bento-hero .bento-arrow-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
