/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* CSS Variables for theming */
:root {
  --invoice-primary: #f60606;
  --primary-dark: #059669;
  --secondary: #f60606;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9fbcef;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
  --radius: 8px;
  --radius-lg: 6px;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Roboto", sans-serif;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh; */
}

.rl-payment-success-page {
  background-color: #f9f9f9;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

@keyframes checkmarkDraw {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes float {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Success Overlay Animation */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.5s ease-out;
}

.success-animation {
  text-align: center;
  color: white;
}

.checkmark-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--success);
  margin: 0 auto 2rem;
  position: relative;
  animation: scaleIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
}

.checkmark::before {
  content: '✓';
  font-size: 3rem;
  font-weight: bold;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: checkmarkDraw 0.5s ease-out 0.3s both;
}

.success-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  animation: slideUp 0.6s ease-out 0.5s both;
}

.success-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  animation: slideUp 0.6s ease-out 0.7s both;
}

/* Main container */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  /* box-shadow: var(--shadow-xl); */
}

/* Header */
.topbar {
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
  color: white;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* 
.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  opacity: 0.1;
} */

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--invoice-primary), var(--success));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: pulse 2s infinite;
}

.brand h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.brand .muted {
  color: var(--gray-300);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn.ghost {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--invoice-primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn.secondary {
  background: var(--secondary);
  color: white;
}

.btn.secondary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Success Banner */
.success-banner {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  padding: 2rem;
  /* margin: 2rem; */
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: slideInDown 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  animation: float 20s infinite linear;
}

.success-icon {
  font-size: 3rem;
  position: relative;
  z-index: 1;
  /* animation: bounce 2s infinite; */
}

.success-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

.success-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.success-content p {
  opacity: 0.9;
  font-size: 1rem;
}

.success-amount {
  text-align: center;
  position: relative;
  z-index: 1;
}

.amount-label {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.amount-value {
  font-size: 2rem;
  font-weight: 700;
}

/* Invoice Card */
.invoice-card {
  /* margin: 2rem; 
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);*/
  padding: 2rem 0;
  animation: fadeInUp 0.8s ease-out;
}

/* Invoice Head */
.invoice-head {
  padding: 2rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  background: white;
  border-radius: 6px;
  margin-top: 24px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.invoice-head h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.invoice-head h2 i {
  color: var(--invoice-primary);
}

.invoice-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.meta-item i {
  color: var(--gray-400);
  width: 16px;
}

.status {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-paid,
.status-collected {
  background: #dcfce7;
  color: #166534;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

/* Total Card */
.total-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--invoice-primary), #bc0909);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.total-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: rotate 10s linear infinite;
}

.total-icon {
  font-size: 2rem;
  position: relative;
  z-index: 1;
}

.total-content {
  position: relative;
  z-index: 1;
}

.total-label {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.total-balance {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Address Cards */
.addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  /* padding: 2rem;
  background: var(--gray-50); */
  margin-top: 34px;
  margin-bottom: 34px;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  border: 1px solid var(--gray-200);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.info-card:nth-child(1) {
  animation-delay: 0.1s;
}

.info-card:nth-child(2) {
  animation-delay: 0.2s;
}

.info-card:nth-child(3) {
  animation-delay: 0.3s;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-100);
}

.card-header i {
  color: var(--invoice-primary);
  font-size: 1.25rem;
}

.card-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.info-row i {
  color: var(--gray-400);
  width: 16px;
  text-align: center;
}

.info-row.small {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Items Section */
.items {
  /* padding: 2rem; */
  margin-bottom: 34px;
}

.items-header h4,
.transactions-section h4,
.notes-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* margin-bottom: 1.5rem; */
}

/* .items-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
} */

.items-header i {
  color: var(--invoice-primary);
}

.table-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--invoice-primary);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #fff;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--gray-200);
}

th i {
  color: #fff;
  margin-right: 0.5rem;
}

th.center {
  text-align: center;
}

th.right {
  text-align: right;
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: var(--gray-50);
}

.item-row {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

td {
  padding: 1rem;
  font-size: 0.875rem;
}

td.center {
  text-align: center;
}

td.right {
  text-align: right;
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.item-title {
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-title i {
  color: var(--invoice-primary);
  font-size: 0.875rem;
}

.item-subtitle {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.quantity-badge {
  background: var(--invoice-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.price,
.amount {
  font-weight: 600;
  color: var(--gray-900);
}

.empty-state {
  text-align: center;
  color: var(--gray-500);
  padding: 1.5rem 1.2rem;
  box-shadow: var(--shadow-lg);
  background-color: var(--white);
  border-radius: var(--radius-lg);
  max-width: 650px;
  margin: 0 auto;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--invoice-primary);
  display: block;
}

/* Table Footer */
tfoot {
  background: var(--gray-50);
}

tfoot tr {
  border-top: 1px solid var(--gray-200);
}

tfoot td {
  padding: 0.75rem 1rem;
  font-weight: 500;
}

.subtotal-row,
.tax-row {
  color: var(--gray-600);
}

.total-row {
  background: var(--gray-100);
  font-size: 1.125rem;
}

.total-row .total-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}

.paid-row {
  background: #dcfce7;
  color: #166534;
}

.paid-row .paid-amount {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Meta Section */
.meta {
  margin-bottom: 34px;
  background: var(--gray-50);
  /* display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem; */
}

/* .transactions-section h4,
.notes-section h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
} */

.transactions-section i,
.notes-section i {
  color: var(--invoice-primary);
}

.transaction-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.tx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.tx-id {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--gray-900);
}

.tx-id i {
  color: var(--gray-400);
}

.tx-status {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tx-status.status-successful,
.tx-status.status-success {
  background: #dcfce7;
  color: #166534;
}

.tx-status.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.tx-status.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.tx-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tx-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.tx-detail i {
  color: var(--gray-400);
  width: 16px;
}

.empty-transactions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-500);
  font-size: 0.875rem;
}

.note-card {
  display: flex;
  gap: 1rem;
  font-size: 12px;
  padding-bottom: 34px;
}

.note-icon {
  font-size: 1.5rem;
  color: var(--warning);
  flex-shrink: 0;
}

.note-content p {
  margin-bottom: 0.75rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.note-content p:last-child {
  margin-bottom: 0;
}

.note-content a {
  color: var(--invoice-primary);
  text-decoration: none;
  font-weight: 500;
}

.note-content a:hover {
  text-decoration: underline;
}

/* Footer */
.foot {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 2rem;
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-brand,
.footer-powered {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand i,
.footer-powered i {
  color: var(--invoice-primary);
}

/* Animation classes for intersection observer */
.animate-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .success-banner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .invoice-head {
    flex-direction: column;
    gap: 1rem;
  }

  .addresses {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .items {
    padding: 1rem;
  }

  .table-container {
    overflow-x: auto;
  }

  table {
    min-width: 600px;
  }

  .meta {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .footer-content {
    flex-direction: column;
  }

  .invoice-card {
    margin: 1rem;
  }

  .success-banner {
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .success-title {
    font-size: 1.5rem;
  }

  .success-subtitle {
    font-size: 1rem;
  }

  .amount-value {
    font-size: 1.5rem;
  }

  .invoice-head h2 {
    font-size: 1.5rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
  }

  .success-overlay,
  .topbar,
  .foot,
  .btn {
    display: none !important;
  }

  .wrap {
    box-shadow: none;
    max-width: none;
  }

  .invoice-card {
    margin: 0;
    box-shadow: none;
  }

  .success-banner {
    background: #f3f4f6 !important;
    color: black !important;
    margin: 0 0 1rem 0;
  }

  .info-card,
  .transaction-card,
  .note-card {
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
  }
}