/* ============================================
   IBAN.com.au - Modern Redesign
   BSB Number Search for Australian Banks
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a5f;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --accent: #0d9488;
  --accent-light: #14b8a6;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 1140px;
  --header-h: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --transition: 200ms ease;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
p { margin-bottom: 1rem; }
strong { font-weight: 600; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header / Navbar --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand:hover { color: var(--primary-dark); }

.nav-brand svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--primary);
  background: var(--primary-50);
}

.nav-links li.active a {
  color: var(--primary);
  background: var(--primary-50);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.nav-toggle svg { width: 24px; height: 24px; }

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 3.5rem 0 3rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  border-radius: 50%;
}

.hero h1 {
  color: #ffffff;
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
}

/* --- Search Form --- */
.search-form {
  display: flex;
  gap: 0.75rem;
  max-width: 600px;
  position: relative;
  z-index: 1;
}

.search-form input[type="text"] {
  flex: 1;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  outline: none;
  transition: all var(--transition);
}

.search-form input[type="text"]::placeholder {
  color: rgba(255,255,255,0.6);
}

.search-form input[type="text"]:focus {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.2);
}

.search-form .btn-search {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  background: #ffffff;
  color: var(--primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.search-form .btn-search:hover {
  background: var(--primary-50);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* --- Content Area --- */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

.content-section {
  margin-bottom: 2.5rem;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

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

.card-body { padding: 1.5rem; }

/* --- Info Box --- */
.info-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.info-box p:last-child { margin-bottom: 0; }

/* --- Bank Grid --- */
.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.bank-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  font-size: 0.925rem;
  text-decoration: none;
  transition: all var(--transition);
}

.bank-item:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-50);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.bank-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.bank-item:hover::before { opacity: 1; }

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  background: var(--surface);
}

thead {
  background: var(--primary-50);
}

thead th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-100);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
}

thead th:hover { background: var(--primary-100); }

thead th.sort-asc::after,
thead th.sort-desc::after {
  position: absolute;
  right: 0.5rem;
  font-size: 0.7rem;
}

thead th.sort-asc::after { content: '\25B2'; }
thead th.sort-desc::after { content: '\25BC'; }

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--primary-50); }

tbody td {
  padding: 0.75rem 1rem;
  color: var(--text);
}

tbody td a {
  color: var(--primary-light);
  font-weight: 500;
}

tbody td a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* --- Detail Table --- */
.detail-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.detail-card .bsb-highlight {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 2rem;
  color: #ffffff;
  text-align: center;
}

.detail-card .bsb-number {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detail-card .bsb-bank {
  font-size: 1.1rem;
  opacity: 0.85;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table tr {
  border-bottom: 1px solid var(--border-light);
}

.detail-table tr:last-child { border-bottom: none; }

.detail-table td {
  padding: 0.875rem 1.25rem;
  vertical-align: middle;
}

.detail-table td:first-child {
  width: 200px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.detail-table td:last-child {
  font-weight: 600;
  color: var(--text);
}

.detail-table .status-active {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--success);
  font-weight: 600;
}

.detail-table .status-active::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.detail-table .status-inactive {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--error);
  font-weight: 600;
}

.detail-table .status-inactive::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
}

/* --- Payment System Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-paper { background: #fef3c7; color: #92400e; }
.badge-electronic { background: #d1fae5; color: #065f46; }
.badge-high { background: #dbeafe; color: #1e40af; }

/* --- Map --- */
.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

.map-container #osm-map {
  height: 320px;
  width: 100%;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 1rem 0;
  font-size: 0.875rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 0.25rem;
}

.breadcrumbs li { display: flex; align-items: center; gap: 0.25rem; }

.breadcrumbs li + li::before {
  content: '/';
  color: var(--text-light);
  margin-right: 0.25rem;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumbs a:hover { color: var(--primary); }

.breadcrumbs .current {
  color: var(--text);
  font-weight: 500;
}

/* --- Pagination --- */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination li {}

.pagination li a,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--transition);
}

.pagination li a:hover,
.pagination a:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--primary-50);
}

.pagination li.active a,
.pagination a.selected {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  pointer-events: none;
}

/* --- Alert / Info Banner --- */
.alert {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  font-size: 0.925rem;
  line-height: 1.7;
}

.alert-info {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  color: var(--primary-dark);
}

.alert-info a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alert-info a:hover { color: var(--primary-dark); }

/* --- Wise Promo Box --- */
.promo-card {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
}

.promo-card h3 {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.promo-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.promo-card p:last-of-type { margin-bottom: 1.25rem; }

.promo-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background: #0f766e;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #ffffff;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #ffffff;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 { margin-bottom: 0.25rem; }

.page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0;
}

/* --- Section Heading --- */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.section-heading h2 { margin-bottom: 0; }

.section-heading .count {
  background: var(--primary-50);
  color: var(--primary);
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- Content Sections --- */
.content-block {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  margin-bottom: 2rem;
}

.content-block h3 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.content-block p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.content-block p:last-child { margin-bottom: 0; }

/* --- BSB Format --- */
.bsb-format {
  display: flex;
  gap: 1rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.bsb-format-item {
  flex: 1;
  min-width: 150px;
  padding: 1rem;
  background: var(--primary-50);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary-light);
}

.bsb-format-item .code {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.bsb-format-item .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.bsb-format-item .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Payment Info --- */
.payment-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.payment-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.payment-info-item .code {
  font-weight: 700;
  color: var(--primary);
}

/* --- AdSense Container --- */
.ad-container {
  margin: 1.5rem 0;
  text-align: center;
}

/* --- Error Message --- */
.error-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--error);
  font-weight: 600;
  font-size: 1.1rem;
}

/* --- Footer --- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-content p { margin-bottom: 0; font-size: 0.875rem; }

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover { color: #ffffff; }

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.back-to-top svg { width: 20px; height: 20px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .hero { padding: 2.5rem 0 2rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }

  .search-form {
    flex-direction: column;
    max-width: 100%;
  }

  .search-form .btn-search { width: 100%; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .nav-toggle { display: flex; }

  .bank-grid {
    grid-template-columns: 1fr;
  }

  .detail-card .bsb-number { font-size: 2rem; }

  .detail-table td:first-child {
    width: auto;
    display: block;
    padding-bottom: 0;
    font-size: 0.8rem;
  }

  .detail-table td:last-child {
    display: block;
    padding-top: 0.25rem;
  }

  .detail-table tr {
    display: block;
    padding: 0.5rem 0;
  }

  .bsb-format { flex-direction: column; }

  .payment-info {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links { justify-content: center; }

  .content-block { padding: 1.25rem; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }

  .container { padding: 0 1rem; }

  .bank-item { padding: 0.75rem 1rem; font-size: 0.875rem; }

  .card-body { padding: 1rem; }
}

/* --- Print Styles --- */
@media print {
  .site-header,
  .site-footer,
  .back-to-top,
  .ad-container,
  .promo-card,
  .nav-toggle,
  .search-form { display: none !important; }

  body { background: #fff; color: #000; font-size: 12pt; }

  .hero { background: none; color: #000; padding: 1rem 0; }
  .hero h1 { color: #000; }

  a { color: #000; text-decoration: underline; }

  .detail-card .bsb-highlight {
    background: none;
    color: #000;
    border: 2px solid #000;
  }
}
