/* ============================================
   Carbon Footprint Widget — Educational
   Body font only. No Thunder. Fixed kerning.
   ============================================ */

/* --- Container --- */
.carbon-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font2, 'Roboto', sans-serif);
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  animation: carbon-enter 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1s both;
}

@keyframes carbon-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Pill --- */
.carbon-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 243, 235, 0.08);
  border-radius: 100px;
  color: rgba(245, 243, 235, 0.6);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.carbon-pill:hover {
  border-color: rgba(244, 254, 134, 0.25);
  color: rgba(245, 243, 235, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.carbon-pill-icon {
  width: 16px;
  height: 16px;
  color: #4ade80;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.carbon-pill-icon svg {
  width: 16px;
  height: 16px;
}

.carbon-pill-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.625rem;
}

.carbon-pill-divider {
  width: 1px;
  height: 12px;
  background: rgba(245, 243, 235, 0.12);
  flex-shrink: 0;
}

.carbon-pill-value {
  color: #F5F3EB;
  font-weight: 600;
  letter-spacing: normal;
}

.carbon-widget--expanded .carbon-pill {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateY(6px);
}

/* --- Panel --- */
.carbon-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 310px;
  background: rgba(18, 18, 18, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(245, 243, 235, 0.07);
  border-radius: 16px;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  letter-spacing: normal;
}

.carbon-widget--expanded .carbon-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* --- Panel Header --- */
.carbon-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.carbon-panel-title {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(245, 243, 235, 0.35);
  font-weight: 600;
}

.carbon-close {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 243, 235, 0.05);
  border: none;
  border-radius: 50%;
  color: rgba(245, 243, 235, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.carbon-close svg {
  width: 14px;
  height: 14px;
}

.carbon-close:hover {
  background: rgba(245, 243, 235, 0.1);
  color: rgba(245, 243, 235, 0.7);
}

/* --- Hero Number --- */
.carbon-panel-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 20px;
}

.carbon-hero-icon {
  width: 32px;
  height: 32px;
  color: rgba(245, 243, 235, 0.2);
  margin-bottom: 10px;
}

.carbon-hero-icon svg {
  width: 32px;
  height: 32px;
}

.carbon-hero-number {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: #F5F3EB;
  line-height: 1;
  letter-spacing: normal;
  margin-bottom: 4px;
}

.carbon-hero-unit {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.6875rem;
  color: rgba(245, 243, 235, 0.35);
  letter-spacing: normal;
}

/* --- Message --- */
.carbon-panel-message {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #F5F3EB;
  line-height: 1.4;
  margin-bottom: 4px;
  letter-spacing: normal;
}

.carbon-panel-detail {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.75rem;
  color: rgba(245, 243, 235, 0.4);
  line-height: 1.5;
  margin-bottom: 20px;
  letter-spacing: normal;
}

/* --- Stats --- */
.carbon-panel-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(245, 243, 235, 0.06);
  border-bottom: 1px solid rgba(245, 243, 235, 0.06);
  margin-bottom: 16px;
}

.carbon-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carbon-stat-icon {
  width: 20px;
  height: 20px;
  color: rgba(245, 243, 235, 0.3);
  flex-shrink: 0;
}

.carbon-stat-icon svg {
  width: 20px;
  height: 20px;
}

.carbon-stat-content {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.carbon-stat-value {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: #F5F3EB;
  line-height: 1;
  letter-spacing: normal;
}

.carbon-stat-label {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(245, 243, 235, 0.28);
  font-weight: 500;
}

/* --- Site Rating (static) --- */
.carbon-panel-site {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(245, 243, 235, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(245, 243, 235, 0.05);
}

.carbon-site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.carbon-site-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.6875rem;
  color: rgba(245, 243, 235, 0.5);
  letter-spacing: normal;
}

.carbon-site-label svg {
  width: 14px;
  height: 14px;
  color: #4ade80;
}

.carbon-site-grade {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #4ade80;
  line-height: 1;
  letter-spacing: normal;
}

.carbon-site-note {
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.625rem;
  color: rgba(245, 243, 235, 0.3);
  letter-spacing: normal;
  line-height: 1.3;
}

/* --- Learn More --- */
.carbon-learn-more {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font2, 'Roboto', sans-serif);
  font-size: 0.6875rem;
  color: rgba(245, 243, 235, 0.45);
  text-decoration: none;
  letter-spacing: normal;
  font-weight: 500;
  padding-top: 16px;
  border-top: 1px solid rgba(245, 243, 235, 0.06);
  transition: color 0.25s ease;
}

.carbon-learn-more:hover {
  color: #F4FE86;
}

.carbon-arrow {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.carbon-learn-more:hover .carbon-arrow {
  transform: translateX(3px);
}

/* --- Responsive --- */
@media screen and (max-width: 640px) {
  .carbon-widget {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .carbon-panel {
    width: auto;
    right: 0;
    left: 0;
  }

  .carbon-pill {
    padding: 8px 14px 8px 12px;
    font-size: 0.625rem;
  }

  .carbon-pill-icon {
    width: 14px;
    height: 14px;
  }

  .carbon-pill-icon svg {
    width: 14px;
    height: 14px;
  }

  .carbon-hero-number {
    font-size: 1.75rem;
  }
}
