/* ----------------------------------------
   Card Container
---------------------------------------- */
.wc-card {
  max-width: 860px;
  margin: 20px auto 40px auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: 'Roboto', sans-serif;
}

/* ----------------------------------------
   Card Header (Title + Subtitle)
---------------------------------------- */
.wc-card-header {
  background: #f4f6f8;
  padding: 20px;
  text-align: center;
}
.wc-card-header h2 {
  margin: 0;
  font-size: 1.5em;
  color: #333;
}
.wc-card-header p {
  margin-top: 4px;
  color: #555;
  font-size: 0.95em;
}

/* ----------------------------------------
   Input Form Area
---------------------------------------- */
.wc-warranty-form {
  padding: 20px;
}
.wc-input-group {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wc-form-help {
  font-size: 13px;
  color: #666;
  margin-top: 5px;
}
/* Fixed width for the label so input lines up nicely */
.wc-input-group label {
  flex: 0 0 120px;
  font-weight: 500;
  font-size: 1em;
}
#wc_address {
  flex: 1;
  padding: 12px 14px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.wc-btn {
  flex: 0 0 auto;
  padding: 10px 20px;
  background: #0073aa;
  color: #fff;
  font-size: 1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.wc-btn:hover {
  background: #006799;
  transform: translateY(-1px);
}

/* ----------------------------------------
   “File a Claim” Button
---------------------------------------- */
.wc-claim-btn {
  display: block;
  margin: 20px auto;
  padding: 14px 28px;
  background: #0073aa;
  color: #fff;
  font-size: 1.15em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  font-weight: 600;
  text-align: center;
}
.wc-claim-btn i {
  margin-right: 8px;
}
.wc-claim-btn:hover {
  background: #005f8d;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* ----------------------------------------
   Claim Form Container (once button is clicked)
---------------------------------------- */
.wc-claim-form-wrap {
  margin-top: 15px;
}
.wc-claim-form {
  /* no extra styling; inherits from parent */
  padding: 10px 0;
}

/* ----------------------------------------
   Result Container
---------------------------------------- */
#wc-result-container {
  display: block; /* always shown; AJAX injects the result */
  padding: 20px;
  border-top: 1px solid #e2e2e2;
  background: #fafafa;
}
.wc-warranty-result {
  font-family: Arial, sans-serif;
}

/* ----------------------------------------
   Warranty Detail Card
---------------------------------------- */
.wc-detail-card {
  max-width: 680px;
  margin: 20px auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  padding: 24px;
  border: 1px solid #e0e0e0;
  font-family: Arial, sans-serif;
  position: relative;
}

/* ----------------------------------------
   Detail Header (Address + Date)
---------------------------------------- */
.wc-detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.wc-detail-item {
  display: flex;
  align-items: center;
  min-width: 50%;
}
.wc-detail-item i {
  font-size: 1.2em;
  color: #0073aa;
  margin-right: 10px;
}
.wc-detail-text {
  display: flex;
  flex-direction: column;
}
.wc-detail-label {
  font-size: 0.9em;
  color: #777;
}
.wc-detail-value {
  font-size: 1.1em;
  color: #333;
  margin-top: 2px;
}

/* ----------------------------------------
   Status Badge + Expiry
---------------------------------------- */
.wc-detail-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.wc-detail-expiry {
  font-size: 0.95em;
  color: #555;
}
.wc-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 14px;
  font-weight: 600;
  color: #fff;
  font-size: 1em;
}
.wc-status-1 { background: #28a745; }   /* green for 1-year */
.wc-status-2 { background: #ffc107; }   /* amber for 2-year */
.wc-status-6 { background: #fd7e14; }   /* orange for structural */
.wc-status-0 { background: #6c757d; }   /* gray for out-of-warranty */

/* ----------------------------------------
   Detail Body (Sections)
---------------------------------------- */
.wc-detail-body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.wc-detail-section {
  flex: 1;
  min-width: 280px;
}
.wc-detail-heading {
  font-size: 1.1em;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wc-detail-heading i {
  color: #0073aa;
}
.wc-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.wc-detail-list li {
  font-size: 1em;
  color: #333;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wc-detail-list li i {
  color: #0073aa;
}

/* ----------------------------------------
   “Not Found” / “Error” Box
---------------------------------------- */
.wc-detail-error {
  max-width: 680px;
  margin: 20px auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  padding: 24px;
  border: 1px solid #e0e0e0;
  font-family: Arial, sans-serif;
  text-align: center;
}
.wc-detail-error p {
  margin-top: 12px;
  font-size: 1.05em;
  color: #c00;
  text-align: left;
}

/* ----------------------------------------
   “Out of Warranty” Message
---------------------------------------- */
.wc-out-of-warranty {
  font-family: Arial, sans-serif;
  border: 1px solid #f1c40f;
  background: #fcf8e3;
  color: #856404;
  padding: 14px;
  border-radius: 6px;
  margin-top: 20px;
  font-size: 1em;
  text-align: left;
}

/* ----------------------------------------
   Loading States & Progress Animation
---------------------------------------- */
.wc-search-progress {
  max-width: 500px;
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
}

.wc-progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 25px;
  position: relative;
}

.wc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0073aa, #005f8d);
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease-in-out;
  position: relative;
}

.wc-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.wc-search-stages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.wc-stage {
  display: flex;
  align-items: center;
  font-size: 1em;
  color: #6c757d;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  position: relative;
}

.wc-stage.active {
  color: #0073aa;
  background: #f0f8ff;
  transform: translateX(4px);
}

.wc-stage.completed {
  color: #28a745;
  background: #f8fff9;
}

.wc-stage.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: #0073aa;
  border-radius: 2px;
}

.wc-stage.completed::before {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #28a745;
  font-weight: bold;
}

/* Spinner for button */
.wc-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

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

/* Skeleton Loading States */
.wc-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.wc-skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.wc-skeleton-text.wide { width: 100%; }
.wc-skeleton-text.medium { width: 75%; }
.wc-skeleton-text.narrow { width: 50%; }

/* ----------------------------------------
   Enhanced Mobile Optimization
---------------------------------------- */
@media (max-width: 768px) {
  .wc-card {
    margin: 10px;
    border-radius: 6px;
  }
  
  .wc-search-progress {
    padding: 20px 15px;
  }
  
  .wc-progress-bar {
    height: 6px;
    margin-bottom: 20px;
  }
  
  .wc-search-stages {
    gap: 10px;
  }
  
  .wc-stage {
    font-size: 0.9em;
    padding: 6px 10px;
  }
  
  .wc-stage.active {
    transform: translateX(2px);
  }
}

@media (max-width: 600px) {
  .wc-input-group {
    flex-direction: column;
    gap: 8px;
  }
  .wc-input-group label,
  #wc_address,
  .wc-btn {
    width: 100%;
    flex: none;
  }
  .wc-claim-btn {
    width: 100%;
    font-size: 1em;
    padding: 12px 0;
  }
  .wc-detail-card,
  .wc-detail-error {
    padding: 18px;
  }
  .wc-detail-header {
    flex-direction: column;
    gap: 12px;
  }
  .wc-detail-item {
    min-width: 100%;
  }
  .wc-detail-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .wc-detail-body {
    flex-direction: column;
    gap: 16px;
  }
  .wc-detail-list li {
    font-size: 0.95em;
  }
  
  /* Mobile-specific progress adjustments */
  .wc-search-stages {
    align-items: stretch;
  }
  
  .wc-stage {
    text-align: center;
    justify-content: center;
  }
  
  .wc-stage.completed::before {
    right: 8px;
  }
}

/* ----------------------------------------
   Create Ticket Button & Forms
---------------------------------------- */
.wc-create-ticket-btn {
  display: inline-block;
  background-color: #0073aa;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-align: center;
  width: 100%;
  margin-top: 15px;
}

.wc-create-ticket-btn:hover {
  background-color: #005a87;
}

.wc-create-ticket-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.wc-ticket-success {
  text-align: center;
  padding: 40px;
}

.wc-ticket-success h3 {
  color: #4caf50;
  margin-bottom: 15px;
}

.wc-ticket-success p {
  font-size: 16px;
  line-height: 1.6;
}

/* ----------------------------------------
   Warranty Claim Buttons Container
---------------------------------------- */
.wc-claim-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.wc-claim-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: #0073aa;
  color: #fff;
  font-size: 1em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

.wc-claim-btn i {
  margin-right: 8px;
  font-size: 1.1em;
}

/* Color-coded by warranty type */
.wc-claim-btn[data-warranty-type="1"] {
  background: #28a745;
}

.wc-claim-btn[data-warranty-type="1"]:hover {
  background: #218838;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.wc-claim-btn[data-warranty-type="2"] {
  background: #ffc107;
  color: #212529;
}

.wc-claim-btn[data-warranty-type="2"]:hover {
  background: #e0a800;
  box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

.wc-claim-btn[data-warranty-type="6"] {
  background: #fd7e14;
}

.wc-claim-btn[data-warranty-type="6"]:hover {
  background: #dc6502;
  box-shadow: 0 4px 10px rgba(253, 126, 20, 0.3);
}

.wc-claim-btn:hover {
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .wc-claim-buttons {
    gap: 8px;
  }
  
  .wc-claim-btn {
    padding: 12px 16px;
    font-size: 0.95em;
  }
}

/* ----------------------------------------
   File Warranty Claim Button
---------------------------------------- */
.wc-file-claim-btn {
  display: inline-block;
  padding: 16px 32px;
  background: linear-gradient(135deg, #0073aa, #005a87);
  color: #fff;
  font-size: 1.2em;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
  text-align: center;
}

.wc-file-claim-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
  background: linear-gradient(135deg, #005a87, #004a6f);
}

.wc-file-claim-btn i {
  margin-right: 10px;
  font-size: 1.1em;
}

/* Modal CSS removed - no longer needed */

/* ----------------------------------------
   Timeline Progress Indicator
---------------------------------------- */
.wc-search-progress {
  padding: 30px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 20px auto;
  max-width: 600px;
}

.wc-timeline-container {
  position: relative;
  margin-bottom: 20px;
  margin-left: auto;
  margin-right: auto;
}

.wc-timeline-track {
  position: absolute;
  top: 20px;
  left: 10%;
  right: 10%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  z-index: 1;
}

.wc-timeline-track::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: #0073aa;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.wc-timeline-steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.wc-timeline-step {
  flex: 1;
  text-align: center;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.wc-timeline-step.active {
  opacity: 1;
}

.wc-timeline-step.completed {
  opacity: 1;
}

.wc-step-circle {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  background: #fff;
  border: 3px solid #e0e0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

.wc-timeline-step.active .wc-step-circle {
  border-color: #0073aa;
  background: #0073aa;
  transform: scale(1.1);
}

.wc-timeline-step.completed .wc-step-circle {
  border-color: #4caf50;
  background: #4caf50;
}

.wc-step-number {
  font-weight: 600;
  font-size: 16px;
  color: #666;
  transition: color 0.3s ease;
}

.wc-timeline-step.active .wc-step-number,
.wc-timeline-step.completed .wc-step-number {
  color: #fff;
}

.wc-step-spinner {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wc-timeline-step.active .wc-step-spinner {
  opacity: 1;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.wc-step-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  max-width: 120px;
  margin: 0 auto;
  line-height: 1.3;
}

.wc-timeline-step.active .wc-step-label {
  color: #0073aa;
  font-weight: 600;
}

.wc-timeline-step.completed .wc-step-label {
  color: #4caf50;
}

.wc-progress-message {
  text-align: center;
  font-size: 16px;
  color: #333;
  margin-top: 10px;
  font-weight: 500;
}

/* Completed checkmark animation */
.wc-timeline-step.completed .wc-step-number {
  font-size: 0;
}

.wc-timeline-step.completed .wc-step-circle::after {
  content: '\2713';
  font-size: 20px;
  color: #fff;
  position: absolute;
  animation: checkmark 0.3s ease-out;
}

@keyframes checkmark {
  0% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(45deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .wc-timeline-steps {
    flex-wrap: wrap;
  }
  
  .wc-timeline-step {
    flex: 0 0 50%;
    margin-bottom: 20px;
  }
  
  .wc-timeline-track {
    display: none;
  }
  
  .wc-step-label {
    font-size: 12px;
  }
}

/* ----------------------------------------
   Form Loading State
---------------------------------------- */
.wc-form-loading {
  text-align: center;
  padding: 60px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 20px auto;
  max-width: 400px;
}

.wc-loading-spinner {
  margin: 0 auto 20px;
  width: 50px;
  height: 50px;
  position: relative;
}

.wc-spinner-circle {
  width: 100%;
  height: 100%;
  border: 4px solid #e0e0e0;
  border-top-color: #0073aa;
  border-radius: 50%;
  animation: formSpin 1s linear infinite;
}

@keyframes formSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.wc-loading-text {
  font-size: 18px;
  color: #333;
  font-weight: 600;
  margin-bottom: 8px;
}

.wc-loading-subtext {
  font-size: 14px;
  color: #666;
  font-weight: 400;
}

/* Add pulse animation for the loading container */
.wc-form-loading {
  animation: fadeInPulse 0.5s ease-out;
}

@keyframes fadeInPulse {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Additional loading dots animation */
.wc-loading-text::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}
