/**
 * Frontend Styles for Tutor Premium Certificate
 */

/* Premium Certificate Option Container */
.tpc-premium-certificate-option {
  background: #ffffff;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.tpc-premium-certificate-option:hover {
  border-color: #4caf50;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

/* Option Wrapper */
.tpc-option-wrapper {
  margin-bottom: 20px;
}

/* Checkbox Label */
.tpc-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.tpc-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: #4caf50;
}

.tpc-label-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Price Badge */
.tpc-price-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Description */
.tpc-description {
  margin: 10px 0 0 32px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Info Box */
.tpc-info-box {
  background: #f9f9f9;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.tpc-info-item {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #e5e5e5;
}

.tpc-info-item:last-child {
  border-bottom: none;
}

.tpc-info-item.tpc-premium-item {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.1) 0%,
    rgba(255, 193, 7, 0.1) 100%
  );
  border-radius: 4px;
  padding: 15px 10px;
  margin-top: 10px;
}

.tpc-icon {
  font-size: 24px;
  margin-right: 15px;
  min-width: 30px;
  text-align: center;
}

.tpc-info-content strong {
  display: block;
  color: #333;
  margin-bottom: 5px;
  font-size: 15px;
}

.tpc-info-content p {
  margin: 0;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

/* Certificate Info Banner */
.tpc-certificate-info-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tpc-banner-content {
  display: flex;
  align-items: center;
}

.tpc-banner-icon {
  font-size: 40px;
  margin-right: 20px;
}

.tpc-banner-text strong {
  display: block;
  font-size: 18px;
  margin-bottom: 5px;
}

.tpc-banner-text p {
  margin: 0;
  opacity: 0.95;
  font-size: 14px;
}

/* Dashboard Certificates */
.tpc-dashboard-certificates {
  margin: 30px 0;
}

.tpc-section-title {
  font-size: 24px;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #4caf50;
}

/* Certificates Grid */
.tpc-certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Certificate Card */
.tpc-certificate-card {
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tpc-certificate-card:hover {
  border-color: #4caf50;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15);
  transform: translateY(-2px);
}

/* Premium Badge */
.tpc-certificate-badge {
  position: absolute;
  top: 15px;
  right: 15px;
}

.tpc-premium-label {
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  color: #333;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.4);
}

/* Certificate Content */
.tpc-certificate-content h4 {
  font-size: 18px;
  color: #333;
  margin: 0 0 10px 0;
  padding-right: 80px;
}

.tpc-certificate-date {
  color: #666;
  font-size: 13px;
  margin: 0 0 15px 0;
}

/* Download Button */
.tpc-download-button {
  display: inline-block;
  background: #4caf50;
  color: white !important;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.tpc-download-button:hover {
  background: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Premium Cert in Order */
.tpc-premium-cert-order-item {
  padding: 10px;
  background: #f9f9f9;
  border-left: 3px solid #ffd700;
  margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tpc-certificates-grid {
    grid-template-columns: 1fr;
  }

  .tpc-banner-content {
    flex-direction: column;
    text-align: center;
  }

  .tpc-banner-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .tpc-checkbox-label {
    flex-direction: column;
    align-items: flex-start;
  }

  .tpc-label-text {
    margin-left: 32px;
  }

  .tpc-certificate-content h4 {
    padding-right: 0;
    margin-bottom: 15px;
  }

  .tpc-certificate-badge {
    position: static;
    margin-bottom: 10px;
  }
}

/* Loading State */
.tpc-loading {
  opacity: 0.6;
  pointer-events: none;
}

.tpc-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4caf50;
  border-radius: 50%;
  animation: tpc-spin 1s linear infinite;
}

@keyframes tpc-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Animation for checkbox selection */
.tpc-checkbox-label input[type="checkbox"]:checked + .tpc-label-text {
  color: #4caf50;
}

.tpc-checkbox-label
  input[type="checkbox"]:checked
  + .tpc-label-text
  .tpc-price-badge {
  animation: tpc-pulse 0.5s ease;
}

@keyframes tpc-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Tutor Dashboard Integration */
.tutor-dashboard-content .tpc-dashboard-certificates {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* WooCommerce Cart/Checkout Styling */
.woocommerce-cart .tpc-premium-cert-order-item,
.woocommerce-checkout .tpc-premium-cert-order-item {
  margin: 5px 0;
}
