/*
Theme name: NJAPM Child Theme
Template: blocksy
Version: 1.0.0
Text Domain: njapm-child
*/

/* ========================================
   NJAPM Custom Checkout Styles
   ======================================== */

/* Import Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Checkout Wrapper */
.njapm-checkout-wrapper {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* Section Box */
.njapm-section-box {
  border: 1.7px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

/* Section Title */
.njapm-section-title {
  color: #7A2236;
  font-weight: 700;
  border-bottom: 2px solid #7A2236;
  padding-bottom: 6px;
  margin-bottom: 15px;
  font-size: 18px;
}

/* Grid Layout */
.njapm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .njapm-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .njapm-grid {
    grid-template-columns: 1fr;
  }
}

/* Input Fields */
.njapm-input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

.njapm-input:focus {
  outline: none;
  border-color: #7A2236;
  background: white;
}

/* Button Styles */
.njapm-pay-btn {
  width: 100%;
  background: #7A2236;
  color: white;
  padding: 12px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.njapm-pay-btn:hover {
  background: #C6A664;
  color: #2C3E50;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.njapm-pay-btn:active {
  transform: translateY(0);
}

.njapm-pay-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.njapm-pay-btn.stm_lms_disabled_button {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Course Item Card */
.njapm-course-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: #f7f7f7;
  border-radius: 8px;
  margin-bottom: 10px;
  align-items: start;
}

.njapm-course-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.njapm-course-details {
  flex: 1;
}

.njapm-course-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  font-size: 15px;
}

.njapm-course-price {
  color: #7A2236;
  font-weight: 700;
  font-size: 18px;
}

/* Form Row */
.njapm-form-row {
  display: flex;
  gap: 10px;
}

.njapm-form-row > div {
  flex: 1;
}

/* Messages */
.njapm-message {
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  animation: slideDown 0.3s ease;
}

.njapm-message.success,
.njapm-message.stm-lms-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.njapm-message.error,
.njapm-message.stm-lms-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Vue Transitions */
.slide-fade-enter-active,
.slide-fade-leave-active {
  transition: all 0.3s ease;
}

.slide-fade-enter,
.slide-fade-leave-to {
  transform: translateY(-10px);
  opacity: 0;
}

/* Hide MasterStudy Default Styles on Checkout */
body.single-stm-courses .masterstudy-checkout-container {
  max-width: none !important;
}

/* Override MasterStudy Personal Info Form */
.masterstudy-personal-info__row {
  margin-bottom: 15px;
}

.masterstudy-personal-info__label {
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
  font-size: 14px;
}

.masterstudy-personal-info__field input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  box-sizing: border-box;
}

.masterstudy-personal-info__field input:focus {
  outline: none;
  border-color: #7A2236;
  background: white;
}

/* Delete Course Icon */
.stmlms-trash1 {
  cursor: pointer;
  font-size: 18px;
  color: #999;
  transition: color 0.2s ease;
}

.stmlms-trash1:hover {
  color: #d32f2f;
}

/* GDPR Checkbox */
.masterstudy-gdpr-checkbox {
  margin: 15px 0;
}

.masterstudy-gdpr-checkbox label {
  display: flex;
  align-items: start;
  gap: 10px;
  cursor: pointer;
}

.masterstudy-gdpr-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Empty Cart */
.masterstudy-empty-cart {
  text-align: center;
  padding: 60px 20px;
}

.masterstudy-empty-cart h3 {
  color: #7A2236;
  font-size: 24px;
  margin-bottom: 15px;
}

.masterstudy-empty-cart a {
  display: inline-block;
  background: #7A2236;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 15px;
}

.masterstudy-empty-cart a:hover {
  background: #C6A664;
  color: #2C3E50;
}

/* Loading State */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading span::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  margin-left: 8px;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  .njapm-course-item {
    flex-direction: column;
  }
  
  .njapm-course-item img {
    width: 100%;
    height: 200px;
  }
  
  .njapm-section-box {
    padding: 15px;
  }
  
  .njapm-checkout-wrapper {
    padding: 0 10px;
  }
}