/* customer-style.css - Premium Mobile-First PWA Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  
  --primary-color: #6366f1;
  --secondary-color: #a855f7;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #f1f5f9;
  --border-focus: #c7d2fe;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 10px 25px -5px rgba(99, 102, 241, 0.05), 0 8px 16px -6px rgba(99, 102, 241, 0.05);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
  
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* BASE RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px; /* Space for bottom nav */
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

/* SPLASH SCREEN */
.splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  color: white;
}

.splash-logo {
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  animation: bounce 2s infinite;
  overflow: hidden;
}

.splash-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.splash-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(255, 255, 255, 0.25);
  border-top: 3.5px solid white;
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* APP STICKY HEADER */
.app-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 20px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header .user-badge {
  background: var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CONTENT CONTAINER */
.container {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

/* STATS GRID */
.stats-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card .icon {
  font-size: 20px;
  margin-bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

.stat-card.blue .icon { color: #6366f1; background: #e0e7ff; }
.stat-card.green .icon { color: #10b981; background: #d1fae5; }
.stat-card.orange .icon { color: #f59e0b; background: #fef3c7; }
.stat-card.purple .icon { color: #a855f7; background: #f3e8ff; }

.stat-card .value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.stat-card .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* SECTION HEADERS */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  margin-top: 10px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.section-header a {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 600;
}

/* GENERAL CARDS */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:active {
  transform: scale(0.98);
}

/* INVOICE CARD LIST */
.invoice-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-card .row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.invoice-card .inv-id {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
}

.invoice-card .row-mid {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.invoice-card .row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.invoice-card .amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

/* BADGES */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-paid {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-unpaid {
  background-color: #fee2e2;
  color: #991b1b;
}

/* FORM CONTROLS */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-container {
  position: relative;
}

.input-container .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  background-color: var(--card-bg);
  transition: all 0.2s ease;
  min-height: 48px;
}

.input-container .form-control {
  padding-left: 44px;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background-color: #fafbff;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 46px;
  text-align: center;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-main);
}

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

.btn-success {
  background: var(--success-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-block {
  width: 100%;
}

/* FILTERS ACCORDION / TOGGLE */
.filters-container {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px;
  margin-bottom: 16px;
}

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* BOTTOM NAVIGATION */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 16px;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.03);
  z-index: 999;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  flex: 1;
}

.nav-item .icon {
  font-size: 20px;
  margin-bottom: 4px;
  transition: transform 0.2s ease;
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item.active .icon {
  transform: translateY(-2px);
}

/* Navigation Badge Counter */
.nav-badge {
  position: absolute;
  top: -2px;
  right: calc(50% - 18px);
  background: var(--danger-gradient);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* NOTIFICATION ITEM */
.notification-item {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.notification-item.unread {
  border-left: 4px solid var(--primary-color);
  background: #fafbff;
}

.notification-item .unread-dot {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-color);
}

.notification-item .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.notification-item .date {
  color: var(--text-muted);
}

.notification-item .type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.type-general { background: #e2e8f0; color: #475569; }
.type-offer { background: #fef3c7; color: #b45309; }
.type-update { background: #dbeafe; color: #1d4ed8; }
.type-reminder { background: #fee2e2; color: #b91c1c; }

.notification-item .title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
}

.notification-item .desc {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* OFFER CARD EXTRAS */
.offer-banner {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  margin-bottom: 4px;
}

.notification-item.type-offer-card {
  background: linear-gradient(to bottom, #ffffff, #faf5ff);
  border: 1.5px solid #ebd5ff;
}

.cta-btn {
  margin-top: 8px;
  align-self: flex-start;
}

.mark-read-action {
  font-size: 12px;
  color: var(--primary-color);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  align-self: flex-end;
}

/* PROFILE PAGE STYLES */
.profile-card {
  text-align: center;
  padding: 24px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  background: var(--primary-gradient);
  border-radius: 50%;
  color: white;
  font-size: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.profile-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.profile-phone {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.menu-list {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 20px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  background: white;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:active {
  background-color: #fafbff;
}

.menu-item .left-sec {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-item .menu-icon {
  font-size: 18px;
  color: var(--primary-color);
}

.menu-item .arrow {
  color: var(--text-muted);
  font-size: 12px;
}

/* Toggle Switch Control */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary-gradient);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ERROR MESSAGE */
.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* NO INVOICES PLACEHOLDER */
.empty-placeholder {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-placeholder .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-placeholder p {
  font-size: 14px;
}

/* DETAIL INVOICE (MOBILE REDESIGN COVER) */
.invoice-wrapper {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.invoice-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.invoice-wrapper table th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding: 10px;
  text-transform: uppercase;
}

.invoice-wrapper table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
}

.invoice-wrapper .totals-table td {
  border-bottom: 1px solid var(--border-color);
}

.invoice-wrapper .totals-table tr:last-child td {
  border-bottom: none;
  font-weight: 800;
  font-size: 15px;
}

/* PWA Install Banner styling */
.install-banner {
  background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-banner h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1e1b4b;
}

.install-banner p {
  font-size: 12px;
  color: #4338ca;
}

/* PRINT MEDIA */
@media print {
  .bottom-nav, .app-header, .print-btn {
    display: none !important;
  }
  body {
    background: white !important;
    padding-bottom: 0 !important;
  }
}