/* ============================================
   MOHINI CSC — Partner Portal Styles
   ============================================ */

.view { display: none; }
.view.active { display: block; animation: fadeInView 0.4s ease; }

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quick action on dashboard */
.hero {
  background: linear-gradient(135deg, #1e3a8a, #16306b);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  color: #fff;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.hero h1 { font-size: 26px; font-weight: 800; margin: 8px 0 6px; color: #fff; }
.hero p { font-size: 14px; opacity: .85; margin-bottom: 18px; }
.hero .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .12em; opacity: .7; }

.hero .btn { background: #fff; color: var(--primary); }
.hero .btn:hover { background: #f0f4ff; box-shadow: var(--shadow-md); }

/* ========== Wallet Animations ========== */
.wallet-balance {
  background: linear-gradient(135deg, #1e3a8a 0%, #16306b 50%, #16306b 100%);
  background-size: 200% 200%;
  animation: walletGradient 4s ease infinite, slideUp 0.5s ease;
  position: relative;
  overflow: hidden;
}

.wallet-balance > * {
  position: relative;
  z-index: 2;
}

.wallet-balance .wb-bubbles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.wallet-balance .wb-bubbles::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  animation: floatBubble 6s ease-in-out infinite;
}

.wallet-balance .wb-bubbles::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  animation: floatBubble 8s ease-in-out infinite reverse;
}

@keyframes walletGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.wallet-balance .wb-info {
  position: relative;
  z-index: 2;
}

.wallet-balance .wb-info strong {
  font-size: 36px;
  animation: countPulse 2s ease infinite;
}

@keyframes countPulse {
  0%, 100% { text-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { text-shadow: 0 0 20px rgba(255,255,255,0.15); }
}

.wallet-balance .btn {
  animation: slideUp 0.6s ease;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.wallet-balance .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* ========== Stat Cards Animation ========== */
.stats-grid .stat-card {
  animation: cardSlideUp 0.5s ease backwards;
  transition: all 0.3s ease;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.3s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.4s; }

.stats-grid .stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Table Row Animation ========== */
.table-wrap tbody tr {
  animation: rowFadeIn 0.4s ease backwards;
  transition: background 0.2s ease;
}

.table-wrap tbody tr:hover {
  background: var(--primary-light);
}

@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.table-wrap tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table-wrap tbody tr:nth-child(2) { animation-delay: 0.1s; }
.table-wrap tbody tr:nth-child(3) { animation-delay: 0.15s; }
.table-wrap tbody tr:nth-child(4) { animation-delay: 0.2s; }
.table-wrap tbody tr:nth-child(5) { animation-delay: 0.25s; }
.table-wrap tbody tr:nth-child(6) { animation-delay: 0.3s; }

/* ========== Card Hover Effect ========== */
.card {
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* ========== Badge Pulse Animation ========== */
.badge-completed {
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ========== Service Card Hover ========== */
.service-card {
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card:hover .arrow {
  transform: translateX(4px);
  opacity: 1;
}

.service-card .arrow {
  transition: all 0.3s ease;
  opacity: 0.5;
}

/* ========== Page Intro Animation ========== */
.page-intro {
  animation: slideUp 0.4s ease;
}

.page-intro h1,
.page-intro h2 {
  animation: slideUp 0.5s ease 0.1s backwards;
}

.page-intro p {
  animation: slideUp 0.5s ease 0.2s backwards;
}

/* ========== Button Click Effect ========== */
.btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

/* ========== Toast Animation ========== */
.toast {
  animation: toastSlide 0.4s ease;
}

@keyframes toastSlide {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ========== Drawer Animation ========== */
.drawer {
  animation: drawerSlide 0.3s ease;
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ========== Application detail fields ========== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-field span {
  font-size: 13px;
  color: var(--navy);
  font-weight: 600;
}

.detail-field.full { grid-column: 1 / -1; }

.status-timeline {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.status-timeline h4 { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }

.timeline-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}

.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 4px;
  flex-shrink: 0;
}
.timeline-dot.active { background: var(--primary); }
.timeline-dot.done { background: var(--success); }

.timeline-item p { font-size: 12.5px; color: var(--text); }
.timeline-item small { font-size: 11px; color: var(--text-muted); }

/* Support ticket form success state */
.ticket-success {
  text-align: center;
  padding: 24px;
}
.ticket-success .success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 28px;
  margin: 0 auto 12px;
  animation: badgePop 0.5s ease;
}

@media (max-width: 1024px) {
  .hero { flex-direction: column; text-align: center; padding: 28px 20px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ========== Apply wizard (screenshot-style) ========== */
.overlay .drawer.drawer-apply {
  width: min(1100px, 96vw);
  /* Top nav is fixed (76px, z-index 999) — sit the drawer below it so the
     hero header (title + badges + View History) stays fully visible */
  height: calc(100vh - 76px);
  /* Centered modal: auto side-margins override .overlay's justify-content:flex-end
     (which otherwise pins the drawer to the right edge) */
  margin: 76px auto 0;
}

.apply-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 22px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.ah-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e3a8a 0%, #16306b 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.ah-info { flex: 1; min-width: 0; }
.ah-info h2 { font-size: 17px; font-weight: 800; color: #172033; }
.ah-info p { font-size: 12.5px; color: #64748b; margin-top: 3px; line-height: 1.45; }
.ah-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.ah-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
}
.ah-badge b { font-weight: 800; }
.ah-wallet { background: #eef6ff; color: #16306b; border: 1px solid #bfdbfe; }
.ah-price { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.ah-secure { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ah-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ah-history {
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #1e3a8a;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.ah-history:hover { background: #eef2ff; border-color: #a8c0ec; }

.apply-body { background: #f6f8fc; padding: 18px 20px 24px; }
.apply-layout { display: flex; gap: 16px; align-items: flex-start; }

/* Left summary panel */
.apply-summary {
  width: 245px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
  padding: 16px;
  position: sticky;
  top: 0;
}
.apply-summary h3 { font-size: 14px; font-weight: 800; color: #172033; margin-bottom: 12px; }
.sum-balance {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.sum-balance span {
  display: block;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .07em;
  color: #1e3a8a;
}
.sum-balance b { display: block; font-size: 19px; font-weight: 800; color: #172033; margin-top: 2px; }
.sum-balance i { font-style: normal; font-size: 18px; }
.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #e5eaf3;
}
.sum-row span { font-size: 11.5px; color: #94a3b8; }
.sum-row b { font-size: 12px; font-weight: 700; color: #172033; text-align: right; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-row.sum-total { border-bottom: none; padding-top: 10px; }
.sum-row.sum-total span { color: #172033; font-weight: 700; }
.sum-row.sum-total b { color: #16a34a; font-size: 13.5px; }

.sum-steps { margin-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.ss { display: flex; gap: 10px; align-items: flex-start; }
.ss i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e9edf5;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all .2s;
}
.ss b { display: block; font-size: 12.5px; font-weight: 700; color: #172033; }
.ss small { display: block; font-size: 10.5px; color: #94a3b8; line-height: 1.45; margin-top: 1px; }
.ss.active i { background: linear-gradient(135deg, #1e3a8a, #16306b); color: #fff; box-shadow: 0 3px 10px rgba(102, 126, 234, .35); }
.ss.active b { color: #1e3a8a; }
.ss.done i { background: #16a34a; color: #fff; }
.ss.done b { color: #16a34a; }

/* Right main panel */
.apply-main {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
  padding: 18px 20px 22px;
}
.am-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.apply-main .am-head h3 { font-size: 15.5px; font-weight: 800; color: #172033; }
.apply-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 999px;
  flex-wrap: wrap;
}
.at {
  border: none;
  background: transparent;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.at:hover { background: #e2e8f0; color: #334155; }
.at.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #16306b 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, .35);
}
.at.active:hover { background: linear-gradient(135deg, #1e3a8a 0%, #16306b 100%); color: #fff; }

.apply-main .form-actions { justify-content: flex-start; }
.overlay .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* Request type cards */
.req-type-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.rtc {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  border: 1.5px solid #e5eaf3;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  position: relative;
  transition: all .2s;
}
.rtc:hover { border-color: #a8c0ec; box-shadow: 0 8px 20px rgba(102, 126, 234, .16); transform: translateY(-2px); }
.rtc.selected { border-color: #1e3a8a; background: linear-gradient(180deg, #f7f8ff, #f1f4ff); box-shadow: 0 8px 20px rgba(102, 126, 234, .22); }
.rtc-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e3a8a, #16306b);
  box-shadow: 0 4px 10px rgba(102, 126, 234, .3);
}
.rtc-body { flex: 1; min-width: 0; }
.rtc-body b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  color: #172033;
  line-height: 1.35;
}
.rtc-body small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.45;
}
.rtc-meta { text-align: right; flex-shrink: 0; }
.rtc-price {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 800;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.rtc-price s { font-size: 10.5px; color: #94a3b8; font-weight: 600; margin-left: 3px; }
.rtc-meta small { display: block; font-size: 10px; color: #94a3b8; margin-top: 6px; white-space: nowrap; }
.rtc-check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #16306b);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: none;
  place-items: center;
  box-shadow: 0 3px 8px rgba(102, 126, 234, .4);
}
.rtc.selected .rtc-check { display: grid; }

@media (max-width: 900px) {
  .overlay .drawer.drawer-apply { width: 100vw; }
  .apply-layout { flex-direction: column; }
  .apply-summary { width: 100%; position: static; }
  .req-type-cards { grid-template-columns: minmax(0, 1fr); }
  .apply-hero { flex-wrap: wrap; }
  .ah-actions { width: 100%; justify-content: flex-end; }
  .apply-body { padding-bottom: 76px; } /* clear the mobile bottom nav */
}
