/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  --primary-color: #19a340;
  --primary-bg: #f6fff8;
  --primary-shadow: 0 4px 12px rgba(25, 163, 64, 0.2);

  --secondary-color: #007bff;
  --secondary-bg: #f0f8ff;
  --secondary-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);

  --border-radius: 8px;
  --transition-speed: 0.3s;
  --text-color: #333;
  --muted-color: #999;
  --border-color-default: #ddd;
  --border-color-light: #ccc;
}

/* ==========================================================================
   Base Container & Input Styling
   ========================================================================== */
.pricing-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  transition: all var(--transition-speed) ease;
}

.pricing-container input[type='radio'] {
  display: none;
}

/* ==========================================================================
   Label (Card) Styling
   ========================================================================== */
.pricetype-label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 2px solid var(--border-color-default);
  border-radius: var(--border-radius);
  padding: 20px;
  transition: all var(--transition-speed) ease;
}

/* ==========================================================================
   Card Content Layout
   ========================================================================== */
.pricetype-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pricetype-title-wrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start; /* Align items to the start for better radio alignment */
  gap: 10px;
}

/* Custom Radio Button Appearance */
.radio__container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color-light);
  border-radius: 50%;
  transition: all var(--transition-speed) ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.radio__container circle.radio {
  fill: transparent;
  transition: fill var(--transition-speed) ease;
}

/* Text Elements */
.pricetype-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-color);
  transition: color var(--transition-speed) ease;
}

.pricetype-subtitle {
  font-size: 1.22rem;
  color: var(--muted-color);
  margin-top: 4px;
  transition: color var(--transition-speed) ease,
    opacity var(--transition-speed) ease;
}

.pricetype-topline-icon {
  width: 32px;
  height: 32px;
  margin-top: -10px;
  fill: var(--muted-color);
  stroke: var(--muted-color);
}

.pricetype-content {
  color: var(--muted-color);
  margin-top: 15px; /* Added some space above content */
  transition: color var(--transition-speed) ease,
    opacity var(--transition-speed) ease;
}

/* Price Display */
.price-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.price {
  font-size: 1.65rem !important; /* Consider removing !important if possible by increasing specificity elsewhere */
  font-weight: bold;
  color: var(
    --text-color
  ); /* Default to text-color, will be overridden by primary/secondary on selection */
  transition: color var(--transition-speed) ease;
}

.compare-price {
  text-decoration: line-through;
  color: var(--muted-color);
  transition: color var(--transition-speed) ease,
    opacity var(--transition-speed) ease;
}

/* ==========================================================================
   Selected States Styling
   ========================================================================== */

/* --- Subscription Selected State --- */
#subscriptionForm input[type='radio']:checked + .pricetype-label {
  border-color: var(--primary-color);
  background-color: var(--primary-bg);
  box-shadow: var(--primary-shadow);
}

#subscriptionForm input[type='radio']:checked + .pricetype-label .pricetype-title {
  color: var(--primary-color);
}

#subscriptionForm input[type='radio']:checked + .pricetype-label .price {
  color: var(--primary-color);
  font-size: 2.32rem !important;
  font-weight: bold;
}

#subscriptionForm input[type='radio']:checked + .pricetype-label .radio__container {
  border-color: var(--primary-color);
}

#subscriptionForm input[type='radio']:checked + .pricetype-label circle.radio {
  fill: var(--primary-color);
}

#subscriptionForm input[type='radio']:checked + .pricetype-label .compare-price {
  color: var(--primary-color);
  opacity: 0.7;
}

#subscriptionForm input[type='radio']:checked + .pricetype-label .pricetype-subtitle,
#subscriptionForm input[type='radio']:checked + .pricetype-label .pricetype-content,
#subscriptionForm input[type='radio']:checked + .pricetype-label .pricetype-topline-icon {
  color: var(--primary-color);
  fill: var(--primary-color);
  stroke: var(--primary-color);
  opacity: 0.9;
}

#subscriptionForm input[type='radio']:checked + .pricetype-label .pricetype-content {
  opacity: 0.7;
}

/* --- One-Time Purchase Selected State --- */
#oneTime input[type='radio']:checked + .pricetype-label {
  border-color: var(--secondary-color);
  background-color: var(--secondary-bg);
  box-shadow: var(--secondary-shadow);
}

#oneTime input[type='radio']:checked + .pricetype-label .pricetype-title,
#oneTime input[type='radio']:checked + .pricetype-label .price #currentPrice,
#oneTime input[type='radio']:checked + .pricetype-label .price {
  color: var(--secondary-color);
}

#oneTime input[type='radio']:checked + .pricetype-label .price #currentPrice {
  font-size: 2.32rem !important;
  font-weight: bold;
}


#oneTime input[type='radio']:checked + .pricetype-label .radio__container {
  border-color: var(--secondary-color);
}

#oneTime input[type='radio']:checked + .pricetype-label circle.radio {
  fill: var(--secondary-color);
}

#oneTime input[type='radio']:checked + .pricetype-label .pricetype-subtitle,
#oneTime input[type='radio']:checked + .pricetype-label .pricetype-content {
  color: var(--secondary-color);
  opacity: 0.8;
}

/* ==========================================================================
   Frequency Dropdown Styling
   ========================================================================== */
.frequency-wrapper {
  position: relative;
  margin-top: 10px;
}

.frequency-pricetype label {
  font-size: 11px;
  letter-spacing: 2px;
  padding: 0 5px;
  text-transform: uppercase;
  position: absolute;
  top: -7px;
  left: 10px;
  white-space: nowrap;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    var(--primary-bg) 50%,
    var(--primary-bg) 50%
  );

  color: var(--muted-color);
  font-weight: 100;
}
/* label background when subscription is selected */
#subscriptionForm input[type='radio']:checked + .pricetype-label .frequency-pricetype label {
  background: var(--primary-bg);
  color: var(--primary-color);
  font-weight: bold;
}

/* Handle platform stupid & annoying global select overide! */
.frequency-pricetype > .select {
  width: 100%;
  height: 4.5rem;
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  border: 0;
}

.frequency-pricetype > .select > .frequency-select {
  /* Remove any conflicting properties from the global .select select rule if necessary */
  outline: initial;
  position: relative;
  height: 4.5rem;
  padding-right: 0;
  display: block;
  appearance: none;
  margin: 0;
  background-color: transparent;
  /* -- */

  width: 100%;
  padding: 0px 10px;
  border: 1px solid var(--border-color-light);
  border-radius: 2px;
  color: var(--text-color);
  font-weight: 400;
}
#subscriptionForm input[type='radio']:checked + .pricetype-label .frequency-pricetype
  > .select
  > .frequency-select {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

#subscriptionForm
  input[type='radio']:checked + .pricetype-label .frequency-pricetype .frequency-select {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.hidden {
  display: none;
}

/* ==========================================================================
   Customer subscription data table
   ========================================================================== */


.my-subscriptions {
    margin-bottom: 30px;
}
.subscription-table {
    width: 100%;
    border-collapse: collapse;
}
.subscription-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
}
.subscription-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.accountEven {
    background-color: #f9f9f9;
}
.subscription-product {
    margin-bottom: 3px;
    font-size: 0.9em;
    color: #666;
}
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 500;
}
.status-active {
    background-color: #e6f7ee;
    color: #0a6634;
}
.status-paused {
    background-color: #fff4e5;
    color: #b45309;
}
.status-cancelled {
    background-color: #fee2e2;
    color: #b91c1c;
}
.quantity {
    margin-left: 5px;
    color: #666;
}
.subscription-interval {
    margin-top: 3px;
}
.product-divider {
    margin: 0;
    border: 0;
    border-top: 1px dashed #eee;
}
.btn-small {
    display: inline-block;
    padding: 5px 10px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.9em;
}
.btn-small:hover {
    background-color: #e0e0e0;
}
.no-subscriptions {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: center;
    color: #666;
}
