/* payment-failure.component.scss */
.payment-result-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.failure-card, .loading-card, .error-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  text-align: center;
  border: 1px solid #e0e0e0;
}

.failure-header {
  margin-bottom: 2.5rem;
}

.failure-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin: 0 auto 1.5rem;
  animation: shake 1s ease-in-out;
  
  // Different styles based on failure reason
  &.insufficient-funds {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
  }
  
  &.timeout {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    box-shadow: 0 4px 20px rgba(255, 152, 0, 0.3);
  }
  
  &.cancelled {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    box-shadow: 0 4px 20px rgba(156, 39, 176, 0.3);
  }
  
  &.network {
    background: linear-gradient(135deg, #607d8b, #455a64);
    box-shadow: 0 4px 20px rgba(96, 125, 139, 0.3);
  }
  
  &.authentication {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.3);
  }
  
  &.general-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 1rem;
}

h1 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
  font-weight: 700;
}

h2, h3, h4 {
  color: #34495e;
  font-weight: 600;
}

h2 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

h3 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

h4 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.failure-message {
  color: #7f8c8d;
  font-size: 1.2rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.transaction-details {
  text-align: left;
  margin-bottom: 2.5rem;
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.details-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #e74c3c;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
  
  &.failure-reason-item {
    border-left-color: #e74c3c;
    background: #fdf2f2;
  }
}

.detail-item:hover {
  transform: translateY(-2px);
}

.label {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

.value {
  color: #34495e;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
  max-width: 60%;
}

.amount {
  color: #e74c3c;
  font-weight: 700;
  font-size: 1.2rem;
}

.status-failed {
  color: #e74c3c;
  font-weight: 700;
  text-transform: uppercase;
  background: #ffeaea;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.error-code {
  color: #ff5722;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  background: #fff3e0;
  padding: 4px 8px;
  border-radius: 6px;
}

.failure-reason {
  color: #e74c3c;
  font-weight: 600;
  font-style: italic;
}

.failure-info {
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: left;
  border: 2px solid;
  
  &.insufficient-funds {
    background: linear-gradient(135deg, #fff5f5, #fef5e7);
    border-color: #ff6b35;
    
    h3 { color: #ff6b35; }
  }
  
  &.timeout {
    background: linear-gradient(135deg, #fff8e1, #fef9c3);
    border-color: #ff9800;
    
    h3 { color: #ff9800; }
  }
  
  &.cancelled {
    background: linear-gradient(135deg, #fce4ec, #f3e5f5);
    border-color: #9c27b0;
    
    h3 { color: #9c27b0; }
  }
  
  &.network {
    background: linear-gradient(135deg, #eceff1, #cfd8dc);
    border-color: #607d8b;
    
    h3 { color: #607d8b; }
  }
  
  &.authentication {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    border-color: #e91e63;
    
    h3 { color: #e91e63; }
  }
  
  &.general-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-color: #f44336;
    
    h3 { color: #f44336; }
  }
}

.failure-explanation {
  p {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.05rem;
  }
  
  ul {
    color: #34495e;
    padding-left: 1.5rem;
    line-height: 1.6;
    
    li {
      margin-bottom: 0.5rem;
    }
  }
}

.quick-tips {
  background: linear-gradient(135deg, #e8f5e8, #f0f8ff);
  border: 2px solid #4CAF50;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: left;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tip-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
  color: #2c3e50;
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-tertiary {
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  color: #495057;
  border: 2px solid #dee2e6;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-tertiary {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-tertiary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-icon {
  font-size: 1.1rem;
}

.loading-card {
  padding: 3rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ff6b35;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

// Responsive Design
@media (max-width: 768px) {
  .payment-result-container {
    margin: 1rem;
    padding: 0;
  }
  
  .failure-card, .loading-card, .error-card {
    padding: 1.5rem;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .btn-primary, .btn-secondary, .btn-tertiary {
    min-width: 100%;
  }
  
  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .value {
    text-align: left;
    max-width: 100%;
  }
  
  .tips-grid {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .failure-icon {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }
}

@media print {
  .action-buttons {
    display: none;
  }
  
  .payment-result-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  
  .failure-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}