@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --royal-blue: #4169e1;
  --royal-blue-dark: #1e3a8a; /* Richer navy */
  --royal-blue-light: #60a5fa;
  --black: #0f172a;
  --black-secondary: #1e293b;
  --white: #ffffff;
  --white-secondary: #f8fafc;

  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-bg-dark: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.15);
}

body {
  font-family: "Public Sans", sans-serif !important;
  color: var(--black);
  /* Clean, modern SaaS light background for the dashboard */
  background-color: #F4F7FE !important;
  min-height: 100vh;
}

/* Ensure layout containers have transparent backgrounds so body gradient shows */
html,
body,
.layout-wrapper,
.layout-container,
.layout-page,
.content-wrapper {
  background-color: transparent !important;
}

/* The Animated Mesh Gradient */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Auth Background (Keep consistent with global) */
.auth-bg {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Premium Clean Dashboard Cards */
.glass-card,
.card {
  background: #ffffff !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
  color: var(--black) !important;
  overflow: hidden; /* For inner elements */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

.card-header,
.card-footer {
  background-color: transparent !important;
  border-color: rgba(0, 0, 0, 0.05) !important;
}

/* Sidebar styling */
#layout-menu,
.menu,
.bg-menu-theme {
  background: #0f172a !important; /* Solid dark premium blue */
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: var(--white) !important;
}

/* Sidebar Logo Fix */
.app-brand-link img {
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.1); /* Subtle background instead of stark white */
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.menu-inner,
.menu-item {
  background: transparent !important;
}
.menu-link {
  color: rgba(255, 255, 255, 0.7) !important;
  transition: all 0.3s ease !important;
}
.menu-link:hover {
  color: var(--white) !important;
  background: rgba(65, 105, 225, 0.1) !important; /* Soft Royal Blue tint */
  border-radius: 10px;
}
/* Aggressive override for Sneat active states */
.layout-menu .menu-vertical .menu-item.active > .menu-link,
.menu-item.active > .menu-link {
  color: var(--white) !important;
  background: rgba(65, 105, 225, 0.25) !important; /* Royal Blue tint */
  border-left: 4px solid var(--royal-blue) !important; /* Royal Blue border instead of green */
  border-radius: 0 10px 10px 0 !important;
}
.menu-item.active::before,
.menu-vertical .menu-item.active::before,
.menu-vertical .menu-item.active::after {
  display: none !important; /* Hide any default template colored pseudo-elements */
}
.app-brand-text {
  color: var(--white) !important;
}

/* Navbar styling */
#layout-navbar {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
  margin: 15px !important;
  width: auto !important; /* To fit within margins */
}

/* Buttons */
.btn-royal {
  background: linear-gradient(
    135deg,
    var(--royal-blue-light),
    var(--royal-blue)
  ) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 0.6rem 1.5rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(65, 105, 225, 0.4) !important;
}

.btn-royal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(65, 105, 225, 0.6) !important;
}

.btn-outline-royal {
  background: transparent !important;
  color: var(--royal-blue) !important;
  border: 2px solid var(--royal-blue) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}
.btn-outline-royal:hover {
  background: var(--royal-blue) !important;
  color: var(--white) !important;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: "Public Sans", sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px !important;
}

.text-royal {
  color: var(--royal-blue) !important;
}

/* Premium Form Inputs */
.form-control,
.form-select {
  border-radius: 12px !important;
  border: 1.5px solid rgba(65, 105, 225, 0.2) !important;
  background-color: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  color: var(--black) !important;
  padding: 0.75rem 1.25rem !important;
  font-weight: 500 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--royal-blue) !important;
  background-color: var(--white) !important;
  box-shadow: 0 0 0 4px rgba(65, 105, 225, 0.15) !important;
  outline: none !important;
}

/* Premium Dashboard Additions */
.welcome-banner {
  background: linear-gradient(135deg, var(--royal-blue-dark), var(--royal-blue));
  border-radius: 20px;
  color: #fff;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(65, 105, 225, 0.3);
  position: relative;
  overflow: hidden;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: url('../img/illustrations/man-with-laptop-light.png') no-repeat right bottom;
  background-size: contain;
  opacity: 0.15;
  pointer-events: none;
}
.kpi-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kpi-card .icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(65, 105, 225, 0.1);
  color: var(--royal-blue);
  font-size: 1.5rem;
}
.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.2rem;
}
.kpi-label {
  font-size: 0.9rem;
  color: #64748B;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label {
  font-weight: 600;
  color: var(--black-secondary);
  margin-bottom: 0.5rem;
}

/* Data Tables */
.table {
  color: var(--black-secondary) !important;
}
.table-primary th {
  background-color: rgba(65, 105, 225, 0.1) !important;
  color: var(--royal-blue) !important;
  font-weight: 700 !important;
  border-bottom: 2px solid rgba(65, 105, 225, 0.2) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.4) !important; /* Subtle zebra */
}
.table > tbody > tr:hover > * {
  background-color: rgba(65, 105, 225, 0.05) !important;
}

/* Badges */
.badge {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.5em 0.8em;
}
.badge.bg-success {
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
}
.badge.bg-warning {
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.2) !important;
}
.badge.bg-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

/* Dashboard Cards Enhancements */
.card .fa-2x {
  background: linear-gradient(
    135deg,
    var(--royal-blue-light),
    var(--royal-blue)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0px 4px 6px rgba(65, 105, 225, 0.4));
}

/* Utility to ensure text inside dark cards (like deposit) stays visible */
.dark-card {
  background: var(--glass-bg-dark) !important;
  color: var(--white) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(24px) !important;
}
.dark-card .form-control,
.dark-card .form-select {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--white) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
.dark-card .form-control:focus,
.dark-card .form-select:focus {
  background-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}
.dark-card .form-label {
  color: rgba(255, 255, 255, 0.8);
}
.dark-card option {
  color: var(--black) !important;
}

/* --- True Full-Screen Sleek Auth Layout --- */
.auth-wrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  overflow: hidden;
}

.auth-image-side {
  flex: 1.8;
  height: 100vh;
  position: relative;
  background-image: url("../images/auth-sleek-image.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.auth-image-overlay {
  width: 100%;
  padding: 4rem 4rem 3rem 4rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  color: #ffffff;
  display: flex;
  align-items: flex-end;
}

.hero-text-panel {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-form-side {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 3rem 10%;
  background-color: #ffffff;
  overflow-y: auto;
}

/* Minimalist Inputs */
.form-control-minimal {
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
  padding: 0.5rem 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--black) !important;
  font-size: 0.95rem !important;
}

.form-control-minimal:focus {
  border-bottom: 2px solid #4169e1 !important; /* Royal Blue */
  outline: none !important;
}

.input-icon-wrapper {
  position: relative;
  width: 100%;
}
.input-icon-wrapper i.left-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 1.2rem;
}
.input-icon-wrapper i.right-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 1.2rem;
  cursor: pointer;
}
.input-icon-wrapper .form-control-minimal {
  padding-left: 2rem !important;
}
.input-icon-wrapper .form-control-minimal.has-right-icon {
  padding-right: 2rem !important;
}

.form-label-minimal {
  font-size: 15px;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 0.2rem;
  display: block;
}

.btn-sleek {
  background-color: #4169e1 !important; /* Royal Blue */
  color: #ffffff !important;
  font-weight: 600 !important;
  border: none !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}
.btn-sleek:hover {
  background-color: #27408b !important;
}

.btn-outline-sleek {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}
.btn-outline-sleek:hover {
  background-color: #f8fafc !important;
}

@media (max-width: 992px) {
  .auth-image-side {
    display: none !important;
  }
  .auth-form-side {
    width: 100%;
    padding: 3rem 8%;
  }
}
