/**
 * Urdu Bills Portal - Modern Stylesheet & Duplicate Bill Renderer
 * Version: 2.0.0
 */

:root {
  --ubp-primary: #0284c7;
  --ubp-primary-dark: #0369a1;
  --ubp-navy: #1e3a8a;
  --ubp-emerald: #059669;
  --ubp-amber: #d97706;
  --ubp-rose: #e11d48;
  --ubp-bg-light: #f8fafc;
  --ubp-border: #e2e8f0;
  --ubp-text-dark: #0f172a;
  --ubp-text-muted: #64748b;
  --ubp-radius: 16px;
  --ubp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.ubp-portal-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ubp-text-dark);
}

/* ==========================================================================
   1. HERO BANNER & SEARCH SECTION
   ========================================================================== */
.ubp-hero-wrapper {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #1e3a8a 100%);
  border-radius: 24px;
  padding: 3rem 2rem;
  color: #ffffff;
  box-shadow: 0 20px 40px -15px rgba(2, 132, 199, 0.35);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.ubp-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.ubp-hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e0f2fe;
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 1rem;
}

.ubp-hero-title {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 2;
  margin: 0 0 10px;
  color: #ffffff;
}

.ubp-hero-subtitle {
  font-size: 1.05rem;
  color: #bae6fd;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* Company Tabs */
.ubp-company-tabs-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.ubp-company-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ubp-comp-tab {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ubp-comp-tab:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.ubp-comp-tab.active {
  background: #ffffff;
  color: var(--ubp-navy);
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Search Card */
.ubp-search-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
  color: var(--ubp-text-dark);
}

.ubp-form-inputs-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ubp-input-col {
  flex: 1;
  text-align: right;
}

.ubp-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.ubp-input-with-icon {
  position: relative;
}

.ubp-main-input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 48px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ubp-main-input:focus {
  border-color: var(--ubp-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.ubp-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  pointer-events: none;
}

.ubp-submit-btn {
  height: 52px;
  padding: 0 28px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.ubp-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.35);
}

.ubp-search-hint {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #64748b;
  text-align: right;
}

/* ==========================================================================
   2. STICKY NAV PILLS
   ========================================================================== */
.ubp-nav-sticky-wrap {
  position: sticky;
  top: 10px;
  z-index: 40;
  margin-bottom: 2.5rem;
}

.ubp-nav-pills-bar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ubp-border);
  padding: 8px 12px;
  border-radius: 50px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.ubp-nav-pill {
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.ubp-nav-pill:hover,
.ubp-nav-pill.active {
  background: var(--ubp-primary);
  color: #ffffff;
}

/* ==========================================================================
   3. SECTION COMMON STYLES
   ========================================================================== */
.ubp-section-block {
  margin-bottom: 3.5rem;
}

.ubp-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.ubp-block-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ubp-block-dot {
  width: 10px;
  height: 24px;
  border-radius: 4px;
  display: inline-block;
}

.ubp-block-title {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.8;
}

.ubp-badge-pill {
  font-size: 0.82rem;
  font-weight: 600;
  background: #dcfce7;
  color: #065f46;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ==========================================================================
   4. TARIFF CALCULATOR BENTO
   ========================================================================== */
.ubp-calc-bento-card {
  background: #ffffff;
  border: 1px solid var(--ubp-border);
  border-radius: var(--ubp-radius);
  padding: 2rem;
  box-shadow: var(--ubp-shadow);
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
  align-items: center;
}

.ubp-calc-input-group {
  margin-bottom: 1.5rem;
}

.ubp-calc-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.ubp-units-slider-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ubp-slider {
  flex: 1;
  height: 8px;
  border-radius: 5px;
  background: #cbd5e1;
  accent-color: var(--ubp-emerald);
  cursor: pointer;
}

.ubp-units-number-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 4px 12px;
}

.ubp-units-num-input {
  width: 70px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  outline: none;
}

.ubp-category-radios {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ubp-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
}

.ubp-calc-breakdown-display {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #86efac;
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
}

.ubp-total-sublabel {
  font-size: 0.85rem;
  font-weight: 600;
  color: #15803d;
}

.ubp-total-amount {
  font-size: 2.3rem;
  font-weight: 800;
  color: #065f46;
  margin: 4px 0;
}

.ubp-slab-tag {
  display: inline-block;
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  color: #047857;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.ubp-taxes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid #bbf7d0;
  padding-top: 10px;
  font-size: 0.82rem;
  text-align: right;
}

.ubp-tax-item {
  display: flex;
  justify-content: space-between;
  color: #166534;
}

/* ==========================================================================
   5. SOLAR SAVINGS GRID
   ========================================================================== */
.ubp-solar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.ubp-solar-card {
  background: #ffffff;
  border: 1px solid var(--ubp-border);
  border-radius: var(--ubp-radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--ubp-shadow);
  transition: transform 0.2s;
}

.ubp-solar-card:hover {
  transform: translateY(-4px);
}

.ubp-solar-card.featured {
  border: 2px solid #ea580c;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.ubp-solar-icon {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ea580c;
  margin-bottom: 8px;
}

.ubp-solar-card h3 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.ubp-solar-card p {
  font-size: 0.9rem;
  color: var(--ubp-text-muted);
  margin: 0 0 12px;
}

.ubp-solar-saving-tag {
  background: #ea580c;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ==========================================================================
   6. ALL DISCOs GRID
   ========================================================================== */
.ubp-companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}

.ubp-company-card {
  background: #ffffff;
  border: 1px solid var(--ubp-border);
  border-radius: var(--ubp-radius);
  padding: 1.5rem;
  box-shadow: var(--ubp-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ubp-comp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ubp-comp-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.ubp-comp-helpline {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

.ubp-comp-name {
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 1.3rem;
  color: var(--ubp-text-dark);
  margin: 0 0 2px;
}

.ubp-comp-en {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 8px;
}

.ubp-comp-region {
  font-size: 0.82rem;
  color: #334155;
  margin: 0 0 14px;
  line-height: 1.5;
}

.ubp-quick-check-btn {
  width: 100%;
  padding: 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s;
}

.ubp-quick-check-btn:hover {
  background: var(--ubp-primary);
  color: #ffffff;
  border-color: var(--ubp-primary);
}

/* ==========================================================================
   7. PAYMENT METHODS GRID
   ========================================================================== */
.ubp-payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.ubp-pay-method-card {
  background: #ffffff;
  border: 1px solid var(--ubp-border);
  border-radius: var(--ubp-radius);
  padding: 1.5rem;
  box-shadow: var(--ubp-shadow);
}

.ubp-pay-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.ubp-pay-method-card h3 {
  font-size: 1.1rem;
  color: #0f172a;
  margin: 0 0 8px;
}

.ubp-pay-method-card p {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   8. PRINT DUPLICATE BILL FORMAT & PRINT MEDIA
   ========================================================================== */
.ubp-bill-sheet {
  background: #ffffff;
  border: 3px solid #059669;
  border-radius: 14px;
  padding: 2rem;
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

@media print {
  body * {
    visibility: hidden;
  }
  .ubp-bill-sheet, .ubp-bill-sheet * {
    visibility: visible;
  }
  .ubp-bill-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
    padding: 15px !important;
  }
  .ubp-bill-sheet button, .ubp-bill-sheet a {
    display: none !important;
  }
}

/* ==========================================================================
   9. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 850px) {
  .ubp-calc-bento-card {
    grid-template-columns: 1fr;
  }
  .ubp-form-inputs-wrap {
    flex-direction: column;
  }
  .ubp-submit-btn {
    width: 100%;
  }
  .ubp-hero-title {
    font-size: 1.85rem;
    line-height: 2.1;
  }
}
