/* ==========================================================================
   IDFC FIRST BANK VIRTUAL PASSBOOK - CORE STYLESHEET
   ========================================================================== */

:root {
  --idfc-red: #9E001A;
  --idfc-red-dark: #7A0014;
  --idfc-red-light: #C52233;
  --idfc-red-subtle: #FFF0F2;
  --idfc-gold: #D4AF37;
  --idfc-navy: #0F172A;
  
  --bg-app: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-paper: #FDFBF7;
  
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-dark: #000000;
  
  --border-light: #E2E8F0;
  --border-dark: #334155;
  --border-sheet: #CBD5E1;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -5px rgba(158,0,26,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --font-serif: 'Cinzel', serif;
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   App Navigation Bar
   -------------------------------------------------------------------------- */
.app-nav {
  background: linear-gradient(135deg, var(--idfc-red-dark) 0%, var(--idfc-red) 100%);
  color: #FFFFFF;
  padding: 0.8rem 1.5rem;
  box-shadow: 0 4px 15px rgba(158, 0, 26, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.bank-logo-mini {
  width: 38px;
  height: 38px;
}

.logo-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.bank-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: #FFFFFF;
  line-height: 1.1;
}

.portal-tag {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 400;
  color: #FFE6E9;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-action {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-action.primary-tint {
  background: rgba(255, 255, 255, 0.9);
  color: var(--idfc-red);
  border-color: #FFFFFF;
  font-weight: 600;
}

.btn-action.primary-tint:hover {
  background: #FFFFFF;
}

.btn-accent {
  background: var(--idfc-gold);
  color: #1E1E1E;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
  transition: all 0.2s ease;
}

.btn-accent:hover {
  background: #E5BE3E;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.main-content {
  max-width: 1100px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* Quick Pill Strip */
.quick-pill-strip {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.pill-group {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--idfc-red);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.pill-label {
  color: var(--text-secondary);
}

.pill-value {
  color: var(--idfc-navy);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.btn-copy {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.3rem;
  border-radius: 3px;
  transition: color 0.2s ease;
}

.btn-copy:hover {
  color: var(--idfc-red);
  background: var(--idfc-red-subtle);
}

/* View Switcher Tabs */
.view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--idfc-red);
}

.tab-btn.active {
  color: var(--idfc-red);
  border-bottom-color: var(--idfc-red);
  background: #FFFFFF;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

/* --------------------------------------------------------------------------
   PASSBOOK DOCUMENT CONTAINER & SHEETS
   -------------------------------------------------------------------------- */
.passbook-document-wrapper {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  position: relative;
}

.passbook-sheet {
  display: none;
  background-color: var(--bg-paper);
  padding: 2.2rem 2.5rem;
  position: relative;
  min-height: 580px;
}

.passbook-sheet.active-view {
  display: block;
}

/* Watermark Background */
.watermark-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
  height: 450px;
  pointer-events: none;
  z-index: 0;
}

.watermark-bg svg {
  width: 100%;
  height: 100%;
}

/* Sheet Header */
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  margin-bottom: 0.8rem;
}

.header-left .passbook-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--idfc-navy);
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}

.header-left .passbook-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.official-logo-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #FFFFFF;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(158, 0, 26, 0.15);
  box-shadow: var(--shadow-sm);
}

.logo-icon-wrap {
  width: 34px;
  height: 34px;
}

.header-logo-svg {
  width: 100%;
  height: 100%;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
}

.idfc-brand-name {
  font-weight: 800;
  color: var(--idfc-red);
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: -0.2px;
}

.slogan-text {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.divider-line {
  height: 3px;
  background: linear-gradient(90deg, var(--idfc-red) 0%, var(--idfc-red-light) 50%, var(--idfc-red) 100%);
  margin-bottom: 1.5rem;
  border-radius: 2px;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   DETAILS GRID (Exact match to sample statement structure)
   -------------------------------------------------------------------------- */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.details-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail-row {
  display: flex;
  align-items: baseline;
  font-size: 0.84rem;
  line-height: 1.4;
}

.detail-label {
  width: 140px;
  flex-shrink: 0;
  font-weight: 700;
  color: #334155;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
}

.colon {
  width: 15px;
  color: #64748B;
  font-weight: 600;
}

.detail-val {
  color: var(--text-dark);
  font-weight: 500;
  flex: 1;
  word-break: break-word;
}

.detail-val.multiline {
  line-height: 1.35;
}

.highlight-row .detail-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--idfc-red-dark);
  letter-spacing: 0.5px;
}

.bold-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #000000;
  letter-spacing: 0.3px;
}

.bold-branch {
  font-weight: 700;
  color: var(--idfc-navy);
}

.code-text {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #0F172A;
  background: rgba(0,0,0,0.03);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  display: inline-block;
}

.spacer-row {
  height: 0.6rem;
}

.badge-registered {
  display: inline-block;
  background: #DEF7EC;
  color: #03543F;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-active {
  color: #047857;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Masking class */
.blurred-content {
  filter: blur(4px);
  user-select: none;
  transition: filter 0.2s ease;
}

/* --------------------------------------------------------------------------
   SHEET FOOTER (Stamp, QR & Signature)
   -------------------------------------------------------------------------- */
.sheet-footer {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--border-sheet);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.footer-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

#qrcode img, #qrcode canvas {
  width: 85px !important;
  height: 85px !important;
  border: 1px solid var(--border-light);
  padding: 4px;
  background: #FFFFFF;
  border-radius: 4px;
}

.qr-subtext {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-center-notice {
  text-align: center;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.security-features {
  display: flex;
  gap: 0.8rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.barcode-display {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 4px;
  font-weight: 700;
  color: #334155;
  margin: 0.2rem 0;
}

.legal-notice {
  font-size: 0.65rem;
  color: #94A3B8;
  line-height: 1.3;
}

/* Realistic Bank Rubber Stamp */
.footer-stamp-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.bank-stamp {
  width: 105px;
  height: 105px;
  border: 3px solid var(--idfc-red);
  border-radius: 50%;
  padding: 3px;
  transform: rotate(-12deg);
  opacity: 0.85;
  margin-bottom: -15px;
  pointer-events: none;
  background: transparent;
  mix-blend-mode: multiply;
}

.stamp-outer-ring {
  width: 100%;
  height: 100%;
  border: 1px dashed var(--idfc-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.stamp-inner-ring {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--idfc-red);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--idfc-red);
  font-weight: 800;
  font-size: 0.55rem;
  line-height: 1.1;
  padding: 2px;
}

.stamp-star {
  font-size: 0.5rem;
  margin: 2px 0;
  color: var(--idfc-red);
}

.signature-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid #334155;
  padding-top: 0.2rem;
  width: 140px;
  margin-top: 1rem;
}

.sig-script {
  font-family: 'Cinzel', cursive, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--idfc-navy);
  font-style: italic;
  line-height: 1;
}

.sig-title {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   PASSBOOK TRANSACTIONS LEDGER SHEET
   -------------------------------------------------------------------------- */
.ledger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--idfc-red);
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ledger-title-wrap h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--idfc-navy);
}

.ledger-title-wrap p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.ledger-balance-box {
  background: var(--idfc-red-subtle);
  border: 1px solid rgba(158, 0, 26, 0.2);
  border-left: 4px solid var(--idfc-red);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ledger-balance-box .lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--idfc-red);
  letter-spacing: 0.5px;
}

.ledger-balance-box .bal-val {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--idfc-navy);
}

.ledger-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-sheet);
  border-radius: 6px;
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.passbook-ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.passbook-ledger-table th {
  background: var(--idfc-red-dark);
  color: #FFFFFF;
  padding: 0.65rem 0.8rem;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.passbook-ledger-table th:last-child {
  border-right: none;
}

.passbook-ledger-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #E2E8F0;
  border-right: 1px stroke #CBD5E1;
  color: #1E293B;
  font-size: 0.82rem;
}

.passbook-ledger-table tbody tr:nth-child(even) {
  background-color: #F8FAFC;
}

.mono {
  font-family: var(--font-mono);
}

.font-credit {
  color: #047857;
  font-weight: 700;
  font-family: var(--font-mono);
}

.font-debit {
  color: #B91C1C;
  font-weight: 700;
  font-family: var(--font-mono);
}

.dr-col, .cr-col, .bal-col {
  text-align: right;
}

.btn-del-row {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  transition: color 0.2s ease;
}

.btn-del-row:hover {
  color: #EF4444;
  background: #FEE2E2;
}

/* Add Transaction Form Bar */
.add-tx-bar {
  margin-top: 1.5rem;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.add-tx-bar h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--idfc-navy);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.add-tx-inputs {
  display: grid;
  grid-template-columns: 130px 1fr 140px 140px 130px auto;
  gap: 0.6rem;
  align-items: center;
}

.add-tx-inputs input, .add-tx-inputs select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
}

.add-tx-inputs input:focus, .add-tx-inputs select:focus {
  outline: none;
  border-color: var(--idfc-red);
  box-shadow: 0 0 0 2px rgba(158, 0, 26, 0.15);
}

/* --------------------------------------------------------------------------
   EDIT DETAILS MODAL
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.edit-modal {
  background: #FFFFFF;
  border-radius: 12px;
  width: 90%;
  max-width: 750px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .edit-modal {
  transform: translateY(0);
}

.modal-header {
  background: var(--idfc-red-dark);
  color: #FFFFFF;
  padding: 1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.btn-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--idfc-red);
  border-bottom: 1px solid var(--idfc-red-subtle);
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-section-title:first-child {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.form-group input, .form-group textarea {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--idfc-red);
  box-shadow: 0 0 0 3px rgba(158, 0, 26, 0.12);
}

.modal-footer {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* --------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--idfc-navy);
  color: #FFFFFF;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.3s ease forwards;
}

.toast i {
  color: var(--idfc-gold);
}

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

/* --------------------------------------------------------------------------
   PRINT OPTIMIZATIONS (@media print)
   -------------------------------------------------------------------------- */
@media print {
  .no-print, .app-nav, .quick-pill-strip, .view-tabs, .add-tx-bar, .modal-overlay, .toast-container {
    display: none !important;
  }
  
  body {
    background: #FFFFFF !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .main-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .passbook-document-wrapper {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .passbook-sheet {
    padding: 1.5cm !important;
    background: #FFFFFF !important;
    min-height: auto !important;
  }

  .blurred-content {
    filter: none !important;
  }

  .passbook-sheet:not(.active-view) {
    display: none !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .details-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  
  .sheet-header {
    flex-direction: column;
    gap: 0.8rem;
  }

  .sheet-footer {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }

  .add-tx-inputs {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
}
