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

:root {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-panel: #ffffff;
  --border-gold: rgba(4, 159, 233, 0.15);
  --border-gold-hover: rgba(4, 159, 233, 0.4);

  --gold-primary: #049fe9;
  --gold-secondary: #0284c7;
  --gold-light: #bae6fd;
  --gold-glow: rgba(4, 159, 233, 0.25);
  --gold-gradient: linear-gradient(135deg, #049fe9 0%, #38bdf8 50%, #0284c7 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(4, 159, 233, 0.05) 0%, rgba(56, 189, 248, 0.05) 50%, rgba(2, 132, 199, 0.05) 100%);

  --text-light: #0f172a;
  --text-grey: #475569;
  --text-muted: #64748b;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);

  --font-sans: 'Outfit', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* App Layout */
#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Luxury Header / Portal Switcher */
.luxury-header {
  background: rgba(19, 19, 17, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-glow {
  width: 40px;
  height: 40px;
  background: var(--gold-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--gold-glow);
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
  /* background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); */
  text-decoration: none;
}

.profileData {
  font-weight: 500;
  /* color: var(--text-light); */
}

.portal-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.25rem;
  border-radius: 50px;
  border: 1px solid var(--border-gold);
  gap: 0.25rem;
}

.portal-tab {
  background: transparent;
  border: none;
  color: var(--text-grey);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.portal-tab:hover {
  color: var(--gold-light);
}

.portal-tab.active {
  background: var(--gold-gradient);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(4, 159, 233, 0.3);
}

/* Main Workspace */
.app-container {
  display: flex;
  flex: 1;
  position: relative;
  min-height: calc(100vh - 73px);
}

.portal-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* Dashboard / Layouts */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(212, 175, 55, 0.05);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold-gradient);
}

.stat-card-title {
  color: var(--gold-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* font-size: 0.9rem;
  margin-bottom: 0.5rem; */
}

.menutab {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  grid-template-columns: repeat(4, 1fr);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-light);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Standard Inputs & Controls */
.luxury-form {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(5, 1fr);
}

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

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-grey);
}

.luxury-input,
.luxury-select,
.luxury-textarea {
  /* background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  font-family: var(--font-sans);
  width: 100%; */
  border: 1px solid var(--border-gold);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: var(--transition);
}

.luxury-input:focus,
.luxury-select:focus,
.luxury-textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.file-upload-box {
  border: 2px dashed var(--border-gold);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(0, 0, 0, 0.1);
  position: relative;
}

.file-upload-box:hover {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.03);
}

.file-upload-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Buttons */
.gold-button {
  background: var(--gold-gradient);
  border: none;
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  /* font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none; */
}

.gold-button:hover {
  box-shadow: 0 4px 15px var(--gold-glow);
  transform: translateY(-1px);
}

.gold-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.outline-button {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold-secondary);
  font-family: var(--font-sans);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  /* cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none; */
}

.outline-button:hover {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.05);
}

.outline-button.active {
  background: var(--gold-gradient-soft);
  border-color: var(--gold-primary);
  /* color: var(--gold-light); */
}

/* Badge styles */
.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

/* Tables */
.luxury-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.luxury-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* border-bottom: 1px solid var(--border-gold); */
  color: var(--gold-secondary);
}

.luxury-table-container {
  overflow-x: auto;
  width: 100%;
}

.luxury-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.luxury-table th {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-gold);
}

.luxury-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.05);
  font-size: 0.95rem;
  color: var(--text-light);
}

.luxury-table td>div {
  width: max-content;
}

.luxury-table tr:hover td {
  background: rgba(212, 175, 55, 0.02);
}

/* Simulated Android Frame */
.android-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.phone-mockup {
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Phone Bezel/Camera Notch */
.phone-mockup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 24px;
  background: #292524;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 100;
}

/* Phone Status Bar */
.phone-status-bar {
  height: 28px;
  background: #121210;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  font-size: 0.75rem;
  color: var(--text-grey);
  font-weight: 500;
  z-index: 99;
}

.phone-status-right {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Phone Screen Area */
.phone-screen {
  flex: 1;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Custom styles for customer flow inside phone */
.phone-screen h3 {
  color: var(--gold-primary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.customer-mobile-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.gold-rate-bubble {
  background: var(--gold-gradient-soft);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.payment-history-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.05);
  font-size: 0.85rem;
}

/* Login views overlay inside panel */
.panel-login-wrapper {
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border: 2px solid var(--gold-primary);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: 0 4px 20px rgba(4, 159, 233, 0.1);
  margin-top: 5vh;
  /* max-width: 400px;
  margin: 4rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); */
}

/* Charts representation */
.sim-chart-bar-container {
  display: flex;
  align-items: flex-end;
  height: 150px;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-gold);
}

.sim-chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.sim-chart-bar {
  width: 100%;
  background: var(--gold-gradient);
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
  transition: height 0.6s ease;
}

.sim-chart-label {
  font-size: 0.75rem;
  color: var(--text-grey);
  margin-top: 0.5rem;
  text-align: center;
}

/* Document Thumbnail mock styling */
.doc-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-gold);
  background: rgba(0, 0, 0, 0.3);
}

.doc-upload-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  border: 1px solid var(--border-gold);
}

/* Modal styling */
.luxury-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  /* display: flex; */
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.luxury-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  /* max-height: 90vh; */
  overflow-y: auto;
}

.luxury-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-grey);
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--gold-light);
}

.receipt-modal-content {
  text-align: center;
}

.receipt-logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.receipt-details {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  text-align: left;
  border: 1px solid var(--border-gold);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.receipt-row.total {
  border-top: 1px dashed var(--border-gold);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  font-weight: bold;
  /* color: var(--gold-primary); */
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.4s ease forwards;
}

/* ==========================================================================
   RESPONSIVE DESIGN RULES (MOBILE & TABLET SUPPORT)
   ========================================================================== */

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .customer-login-wrapper {
    margin-top: 40%;
  }

  .luxury-card {
    width: 90vw;
  }

  .menutab {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card-value {
    font-size: 1.8rem;
  }
}

@media (max-width: 768px) {
  .luxury-header {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    align-items: center;
    text-align: center;
  }

  .portal-switcher {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 20px;
    padding: 0.5rem;
  }

  .portal-tab {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .app-container {
    flex-direction: column;
    min-height: auto;
  }

  .portal-content {
    padding: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Split grids stack */
  div[style*="display: grid; grid-template-columns: 1fr 1fr;"],
  div[style*="display: grid; grid-template-columns: 1fr 2fr;"],
  div[style*="grid-template-columns: 1fr 1fr;"],
  div[style*="grid-template-columns: 1fr 2fr;"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .onboard-form-grid {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }

  .onboard-form-grid .form-group[style*="grid-column: span 2;"] {
    grid-column: span 1 !important;
  }

  form[style*="display: grid; grid-template-columns: 1fr 1fr;"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  form[style*="display: grid; grid-template-columns: 1fr 1fr;"] div[style*="grid-column: span 2;"],
  form[style*="display: grid; grid-template-columns: 1fr 1fr;"] div[style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }
}

/* Responsive mobile simulator view */
@media (max-width: 480px) {
  .android-container {
    padding: 0;
    width: 100%;
  }

  .luxury-form {
    display: block !important;
  }

  .phone-mockup {
    width: 100vw;
    height: calc(100vh - 120px);
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-mockup::before {
    display: none;
  }

  .phone-status-bar {
    padding: 0 1rem;
    height: 24px;
  }

  .luxury-modal {
    padding: 1.25rem;
  }
}

/* ==========================================================================
   PRINT STYLESHEET (PRINTS RECEIPT CONTAINER DATA ONLY)
   ========================================================================== */

@media print {

  /* Hide all elements on the screen */
  body * {
    visibility: hidden;
    background: none !important;
  }

  /* Make only the print area and its children visible */
  #receiptPrintArea,
  #receiptPrintArea * {
    visibility: visible;
  }

  /* Position print area absolute to top-left of page */
  #receiptPrintArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none !important;
    box-shadow: none !important;
    background: white !important;
    color: black !important;
    margin: 0;
    padding: 1.5rem;
  }

  #receiptPrintArea * {
    color: black !important;
  }

  .receipt-logo {
    -webkit-text-fill-color: black !important;
  }

  /* Hide print buttons and cancel close buttons */
  #receiptPrintArea .gold-button,
  #receiptPrintArea .outline-button,
  #receiptPrintArea button,
  #receiptPrintArea .close-btn {
    display: none !important;
    visibility: hidden !important;
  }

  /* Adjust spacing in receipt */
  .receipt-details {
    background: transparent !important;
    border: 1px solid #111 !important;
    padding: 1rem !important;
  }

  /* Force background colors/texts on print preview if browser allows */
  html,
  body {
    background: white !important;
    color: black !important;
  }
}

.customer-login-wrapper {
  padding: 1rem;
  border: 2px solid var(--gold-primary) !important;
  border-radius: 16px;
  /* background: #1a1a1a; */
  box-shadow: 0 25px 50px -12px rgba(50, 50, 200, 0.8), 0 0 20px rgba(212, 175, 55, 0.1);
}

.customer-logo-box {
  text-align: center;
  margin-bottom: 2rem;
}

.customer-logo-image-box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.customer-logo-image {
  width: 180px;
  object-fit: contain;
}

.customer-gold-button {
  padding: 12px;
  border-radius: 10px;
  color: white !important;
  background: #0198e9 !important;
  font-weight: 800;
  letter-spacing: 5px;
  width: 100%;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s;
}

.customer-gold-button:hover {
  background: #049fe9 !important;
  box-shadow: 0 4px 12px rgba(4, 159, 233, 0.4);
}

.customer-top-header {
  background: #181815 !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.customer-header-logo {
  width: 130px;
}

.customer-logout-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: bold;
}

.customer-gold-rate-bubble {
  border: 1px solid rgba(212, 175, 55, 0.2) !important;
  border-radius: 14px;
  padding: 1rem;
  /* background: linear-gradient(135deg, #1d1a10, #26200f) !important;
  color: #ffffff; */
}

.customer-card {
  border: 1px solid blue !important;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 25px;
}

.customer-progress {
  width: 100%;
  height: 6px;
  background: #333 !important;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.customer-progress-bar {
  width: 70%;
  height: 100%;
  background: #049fe9 !important;
}

.customer-payment-card {
  border-radius: 10px;
  border: 1px solid var(--gold-secondary);
  padding: 12px;
  margin-bottom: 10px;
  /* color: #ffffff; */
}

.customer-bottom-nav {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  height: 60px;
  border-top: 1px solid rgba(212, 175, 55, 0.2) !important;
  display: flex;
  background: var(--gold-primary) !important;
}

.customer-bottom-nav a {
  flex: 1;
  border: none;
  background: none;
  color: white !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
}

.customer-bottom-nav a.active {
  color: #049fe9 !important;
  background: white;
}