/**
 * Subscription Goals Widget - Minimalist Design
 */

/* Widget Container */
.sub-goals-widget {
  background: linear-gradient(135deg, rgba(96, 150, 186, 0.08) 0%, rgba(39, 76, 119, 0.04) 100%);
  border-radius: var(--border-radius-lg, 16px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(96, 150, 186, 0.2);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

/* Container positioning - inherits from dashboard-widgets-row */
.dashboard-subscription-goals {
  display: flex;
}

@media (max-width: 768px) {
  .sub-goals-widget {
    min-height: auto;
  }
}

/* Header */
.sub-goals-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.25rem);
  border-bottom: 1px solid rgba(96, 150, 186, 0.15);
}

.sub-goals-header-icon {
  width: 28px;
  height: 28px;
  color: #6096ba;
}

.sub-goals-title {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color, #274c77);
  margin: 0;
}

/* Content */
.sub-goals-content {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card-background, #fff);
  border-radius: 0 0 var(--border-radius-lg, 16px) var(--border-radius-lg, 16px);
}

/* KPI Row */
.sub-goals-kpi-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.sub-goals-kpi {
  text-align: center;
  flex: 1;
}

.sub-goals-kpi-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #274c77;
  line-height: 1.2;
}

.sub-goals-kpi-label {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 0.2rem;
}

/* Monthly Progress */
.sub-goals-monthly {
  margin-bottom: 0.5rem;
}

/* Progress Bars */
.sub-goals-bar {
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.sub-goals-bar-large {
  height: 8px;
  border-radius: 4px;
}

.sub-goals-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #274c77, #6096ba);
  border-radius: inherit;
  transition: width 0.5s ease;
}

/* Vertical Tiers */
.sub-goals-tiers {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}

.sub-goals-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.sub-goals-tier-bar {
  width: 24px;
  height: 50px;
  background: #f0f0f0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.sub-goals-tier-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 4px;
  transition: height 0.5s ease;
}

.sub-goals-tier-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sub-goals-tier-count {
  font-size: 0.7rem;
  color: #666;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Loading */
.sub-goals-loading {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.sub-goals-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f0f0f0;
  border-top-color: #274c77;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.sub-goals-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  color: #888;
}

.sub-goals-error svg {
  width: 16px;
  height: 16px;
}

.sub-goals-error button {
  padding: 0.4rem 0.8rem;
  background: #274c77;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.sub-goals-error button:hover {
  background: #1a3a5c;
}

/* Contribute Button - Uses unified button system */
.sub-goals-contribute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: var(--btn-padding-sm, 0.5rem 1rem);
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--btn-radius-sm, 6px);
  font-size: var(--btn-font-size-sm, 0.8125rem);
  font-weight: var(--btn-font-weight, 600);
  text-decoration: none;
  cursor: pointer;
  transition: var(--btn-transition, all 0.2s ease);
}

.sub-goals-contribute-btn:hover {
  transform: var(--btn-hover-lift, translateY(-2px));
  box-shadow: var(--btn-shadow-hover, 0 4px 12px rgba(39, 76, 119, 0.25));
}

.sub-goals-contribute-btn svg {
  width: 14px;
  height: 14px;
}

/* ========================================
   GOAL EXCEEDED STATES
======================================== */

/* Exceeded value text - green color */
.sub-goals-exceeded {
  color: #22c55e !important;
}

/* Monthly progress bar when exceeded */
.sub-goals-bar-exceeded {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.25) 100%);
}

.sub-goals-fill-exceeded {
  background: linear-gradient(90deg, #22c55e, #16a34a) !important;
  position: relative;
  overflow: hidden;
}

/* Shimmer animation for exceeded bar */
.sub-goals-fill-exceeded::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: exceeded-shimmer 2s ease-in-out infinite;
}

@keyframes exceeded-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Tier exceeded state */
.sub-goals-tier-exceeded .sub-goals-tier-bar {
  background: rgba(34, 197, 94, 0.15);
}

.sub-goals-tier-fill-exceeded {
  background: linear-gradient(180deg, #22c55e, #16a34a) !important;
}

/* Responsive */
@media (max-width: 480px) {
  .sub-goals-kpi-value {
    font-size: 1rem;
  }

  .sub-goals-kpi-label {
    font-size: 0.65rem;
  }
}
