/*
 * Membership Levels Styling for Paid Memberships Pro
 * File: membership-levels.css
 */

/* Main Container */
.pmpro_levels {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 20px 0;
  margin: 0 auto;
  max-width: 1400px; /* Allow 4 cards in a row on desktop */
  list-style: none;
}

/* Individual Level Card */
.pmpro_levels li {
  flex: 1;
  min-width: 280px;
  max-width: 320px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 30px 25px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align content to left */
  text-align: left;        /* Left-align text inside cards */
}

/* Hover Effect */
.pmpro_levels li:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Level Title */
.pmpro_levels .pmpro_btn,
.pmpro_levels .pmpro_btn:link,
.pmpro_levels .pmpro_btn:visited {
  display: inline-block;
  background: #5da750;
  color: #fff;
  padding: 10px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 15px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.pmpro_levels .pmpro_btn:hover,
.pmpro_levels .pmpro_btn:focus {
  background: #4c9143;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Level Price */
.pmpro_levels .pmpro_level-cost {
  font-size: 2em;
  font-weight: 700;
  color: #2c3e50;
  margin: 15px 0;
}

/* Level Description */
.pmpro_levels .pmpro_level-desc {
  margin-bottom: 20px;
  color: #6c757d;
  flex-grow: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .pmpro_levels {
    flex-direction: column;
    align-items: center;
  }
  
  .pmpro_levels li {
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
  }
}

/* Current Level Highlight */
.pmpro_levels li.pmpro_level-current {
  border: 2px solid #5da750;
  position: relative;
  overflow: hidden;
}

.pmpro_levels li.pmpro_level-current::before {
  content: 'Current Plan';
  position: absolute;
  top: 10px;
  right: -30px;
  background: #5da750;
  color: #fff;
  padding: 3px 30px;
  transform: rotate(45deg);
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
}

/* Level Features */
.pmpro_levels .pmpro_level-features {
  text-align: left;
  width: 100%;
  margin: 15px 0;
  padding: 0;
  list-style: none;
}

.pmpro_levels .pmpro_level-features li {
  padding: 5px 0;
  position: relative;
  padding-left: 25px;
  margin: 0;
  text-align: left;
  width: 100%;
}

.pmpro_levels .pmpro_level-features li:before {
  content: '✓';
  color: #5da750;
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Level Title */
.pmpro_levels li h3 {
  font-size: 1.5rem;
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-weight: 700;
  width: 100%;
  padding-bottom: 15px;
  border-bottom: 1px solid #eaeaea;
  text-align: center; /* Keep titles centered */
}

/* Price Styling */
.pmpro_levels li .pmpro_level_price {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 10px 0 20px;
  color: #5da750;
  width: 100%;
  text-align: center; /* Price centered, description below left */
}

/* Description */
.pmpro_levels li .pmpro_level_content {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 25px;
  flex-grow: 1;
}

/* Features List */
.pmpro_levels li .pmpro_level_features {
  text-align: left;
  width: 100%;
  margin: 0 0 25px 0;
  padding: 0;
  list-style: none;
}

.pmpro_levels li .pmpro_level_features li {
  padding: 8px 0 8px 30px;
  margin: 0;
  position: relative;
  text-align: left;
  min-height: auto;
  background: none;
  box-shadow: none;
  border-radius: 0;
  width: 100%;
}

.pmpro_levels li .pmpro_level_features li:before {
  content: "✓";
  color: #5da750;
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Select/Register Button */
.pmpro_levels li .pmpro_btn-select {
  display: inline-block;
  width: 100%;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(135deg, #7cc76e, #5da750);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
}

.pmpro_levels li .pmpro_btn-select:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(124, 199, 110, 0.3);
  background: linear-gradient(135deg, #5da750, #3d7d3d);
}

/* Featured Level */
.pmpro_levels li.pmpro_level-featured {
  border: 2px solid #5da750;
  position: relative;
  transform: scale(1.03);
}

.pmpro_levels li.pmpro_level-featured:before {
  content: "MOST POPULAR";
  position: absolute;
  top: -14px;
  right: 20px;
  background: #5da750;
  color: white;
  font-size: 0.91rem; /* +30% */
  font-weight: 700;
  padding: 4px 13px; /* +30% */
  border-radius: 26px; /* +30% */
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .pmpro_levels {
    padding: 20px;
  }
  
  .pmpro_levels li {
    min-width: calc(50% - 30px);
  }
}

/* On desktops use 4-column grid for cards */
@media (min-width: 1024px) {
  .pmpro_levels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    max-width: 1746px; /* +15% more */
    margin: 0 auto;
    justify-items: center;
  }

  .pmpro_levels li {
    flex: none;        /* disable flex behavior for grid */
    min-width: 0;
    max-width: 407px;  /* +15% more */
    width: 100%;
  }

  /* Custom shortcode cards: allow wider cards by reducing columns when needed */
  .pmpro_levels[data-rgo-levels] {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(280px, 390px)) !important;
    justify-content: center !important;
    align-items: stretch;
    gap: 20px !important;
    max-width: 1210px !important;
    width: min(1210px, calc(100vw - 40px)) !important;
    margin: 0 auto !important;
    position: static;
    left: auto;
    right: auto;
    transform: none;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .pmpro_levels[data-rgo-levels] > li {
    flex: none;
    min-width: 280px;
    max-width: 390px !important;
    width: 100%;
    float: none !important;
    justify-self: center;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (min-width: 1024px) and (max-width: 1260px) {
  .pmpro_levels[data-rgo-levels] {
    grid-template-columns: repeat(2, minmax(280px, 390px)) !important;
    max-width: 800px !important;
    width: min(800px, calc(100vw - 40px)) !important;
  }
}

@media (max-width: 768px) {
  .pmpro_levels {
    flex-direction: column;
    align-items: center;
  }
  
  .pmpro_levels li {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }
  
  .pmpro_levels li.pmpro_level-featured {
    transform: none;
  }
}

.rgo-membership-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 10px auto 20px;
  padding: 0 20px;
}

@media (min-width: 1025px) {
  .rgo-membership-controls {
    flex-wrap: nowrap;
  }
}

.rgo-membership-controls .rgo-membership-toggle,
.rgo-membership-controls .rgo-membership-currency {
  margin: 0;
}

.rgo-membership-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: -moz-fit-content;
  width: fit-content;
  margin: 10px auto 20px;
  max-width: calc(100% - 40px);
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 15px rgba(0,0,0,0.10);
  border: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(4px);
}

.rgo-membership-currency {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: -moz-fit-content;
  width: fit-content;
  margin: 10px auto 20px;
  max-width: calc(100% - 40px);
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f9fbf7 0%, #eef6ea 100%);
  box-shadow: 0 8px 22px rgba(34, 90, 40, 0.12);
  border: 1px solid rgba(93, 167, 80, 0.28);
  backdrop-filter: blur(4px) saturate(1.05);
}

.rgo-membership-currency__label {
  font-weight: 700;
  color: #26452a;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  user-select: none;
  padding-right: 2px;
}

.rgo-membership-currency__btn {
  appearance: none;
  border: 1px solid rgba(68, 102, 76, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #2c3e50;
  font-weight: 800;
  font-size: 12px;
  min-width: 58px;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.rgo-membership-currency__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(34, 90, 40, 0.14);
}

.rgo-membership-currency__btn.is-active {
  background: linear-gradient(135deg, #6ab45e 0%, #4f9744 100%);
  border-color: #4f9744;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(79, 151, 68, 0.28);
}

.rgo-membership-currency__note {
  flex-basis: 100%;
  text-align: center;
  margin-left: 0;
  margin-top: 2px;
  font-size: 11px;
  color: #38533b;
  opacity: 0.92;
}

@media (max-width: 1024px) {
  .rgo-membership-controls {
    flex-direction: column;
    align-items: center;
  }

  .rgo-membership-controls .rgo-membership-toggle,
  .rgo-membership-controls .rgo-membership-currency {
    margin: 6px auto;
  }
}

.rgo-membership-toggle__label {
  font-weight: 700;
  color: #2c3e50;
  user-select: none;
}

.rgo-membership-toggle__switch {
  width: 56px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: #f3f5f7;
  position: relative;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.rgo-membership-toggle__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #5da750;
  transition: transform 0.2s ease;
}

.rgo-membership-toggle__switch[aria-pressed="true"]::after {
  transform: translateX(26px);
}

.pmpro_levels[data-rgo-period="monthly"] li[data-rgo-period="Yearly"],
.pmpro_levels[data-rgo-period="yearly"] li[data-rgo-period="Monthly"] {
  display: none;
}

.pmpro_levels:not([data-rgo-show-all="1"]) li[data-rgo-group="extra"] {
  display: none;
}

.rgo-membership-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 10px auto 0;
  max-width: 1200px;
  padding: 0 20px;
}

.rgo-membership-more__btn {
  appearance: none;
  border: none;
  background: #ffffff;
  color: #2c3e50;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rgo-membership-more__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.14);
}

.pmpro_levels li .rgo-level-heading {
  font-weight: 900;
  color: #2c3e50;
  margin: 0 0 12px;
}

.pmpro_levels li .rgo-membership-period {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(93, 167, 80, 0.12);
  color: #3d7d3d;
  border: 1px solid rgba(93, 167, 80, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  margin: -6px 0 12px;
}
