/* ============================================================================
   VARIABLES
   Single source of truth for colors and focus ring
   ============================================================================ */
:root {
  --color-primary: #33C3AD;
  --color-secondary: #506680;
  --color-dark: #0E141A;
  --color-card: #18212A;
  --color-accent: #223240;
  --color-light: #F5F8FA;
  --color-purple: #9F7EEB;
  --color-crypto: #D6933C;

  --color-success: #16a34a;
  --color-warning: #eab308;
  --color-danger: #dc2626;
  --color-info: #2563eb;

  --color-primary-rgb: 51, 195, 173;
  --color-secondary-rgb: 80, 102, 128;

  --focus-ring: 0 0 0 3px rgba(var(--color-primary-rgb), 0.25);
}

/* ============================================================================
   TOAST / NOTIFICATIONS
   ============================================================================ */
#toast-root .toast,
#toast-root .toast.info,
#toast-root .toast.success,
#toast-root .toast.error,
#toast-root .toast.toast-info,
#toast-root .toast.toast-success,
#toast-root .toast.toast-error {
  background: var(--color-primary) !important;
  background-image: none !important;
  border-color: var(--color-primary) !important;
  color: #062e27 !important;
  box-shadow: 0 6px 26px -4px rgba(0, 0, 0, .35);
}

#toast-root .toast i,
#toast-root .toast .close {
  color: #062e27 !important;
}

#toast-root .toast .close:hover {
  background: rgba(0, 0, 0, 0.12);
}

#toast-root .toast .toast-progress {
  background: rgba(0, 0, 0, .35) !important;
  background-image: none !important;
}

/* ============================================================================
   TYPOGRAPHY & BASE
   ============================================================================ */
* {
  font-family: 'Inter', sans-serif;
}

body {
  background: linear-gradient(140deg, #0B0F13 0%, var(--color-dark) 100%);
  color: var(--color-light);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--color-light);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--color-secondary);
}

/* ============================================================================
   HEADER & PRELOADER
   (topbars, preloader visuals, logo)
   ============================================================================ */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0D1115;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity .5s, visibility .5s;
}

.preloader-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.preloader-logo i {
  font-size: 40px;
  color: var(--color-primary);
}

.preloader-logo span {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

/* ============================================================================
   BUTTONS (Additive system + variants)
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.75rem 1.4rem;
  font-size: .95rem;
  line-height: 1.2;
  border: 1px solid transparent;
  background: var(--color-primary);
  color: #0c1f1c;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .18s;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.07);
}

.btn-primary {
  background: var(--color-primary);
  color: #09201c;
}

.btn-primary:hover {
  filter: brightness(1.1);
  color: #09201c;
}

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
}

.btn-secondary:hover {
  filter: brightness(1.1);
  color: #fff;
}

.btn-success {
  background: var(--color-success);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(1.08);
}

.btn-warning {
  background: var(--color-warning);
  color: #1e1e1e;
}

.btn-warning:hover {
  filter: brightness(1.06);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.08);
}

.btn-info {
  background: var(--color-info);
  color: #fff;
}

.btn-info:hover {
  filter: brightness(1.08);
}

.btn-outline,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-info {
  background: transparent;
  border-width: 1px;
  color: inherit;
}

.btn-outline-primary {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline-primary:hover {
  background: var(--color-primary);
  color: #082e28;
}

.btn-outline-secondary {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.btn-outline-secondary:hover {
  background: var(--color-secondary);
  color: #fff;
}

.btn-outline-success {
  border-color: var(--color-success);
  color: var(--color-success);
}

.btn-outline-success:hover {
  background: var(--color-success);
  color: #fff;
}

.btn-outline-warning {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.btn-outline-warning:hover {
  background: var(--color-warning);
  color: #1e1e1e;
}

.btn-outline-danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-outline-danger:hover {
  background: var(--color-danger);
  color: #fff;
}

.btn-outline-info {
  border-color: var(--color-info);
  color: var(--color-info);
}

.btn-outline-info:hover {
  background: var(--color-info);
  color: #fff;
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-control,
.input-group-text {
  background: var(--color-card);
  border: none;
  border-radius: 0.75rem;
  color: var(--color-light);
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  transition: background .2s;
}

.form-control:focus,
.input-group-text:focus {
  background: var(--color-accent);
  outline: none;
  box-shadow: var(--focus-ring);
}

.input-group-text-secondary {
  background: var(--color-secondary);
  color: #fff;
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card-header {
  background: var(--color-card);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--color-card);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: transform .3s, box-shadow .3s;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ============================================================================
   DASHBOARD GRID & LAYOUT
   ============================================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width:1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid .lg-span-2 {
    grid-column: span 1;
  }
}

.lg-span-2 {
  grid-column: span 2;
}

/* ============================================================================
   HOVERABLES (nav-item, quick-action-item, transaction-item)
   ============================================================================ */
.quick-action-item,
.nav-item,
.transaction-item {
  transition: all .2s ease;
}

.quick-action-item:hover,
.nav-item:hover {
  color: var(--color-primary);
  font-weight: 600;
  filter: drop-shadow(0 0 2.5em rgba(var(--color-primary-rgb), 0.3));
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-radius: .75rem;
}

/* ============================================================================
   SIDEBAR
   (centralized sidebar rules — the area you asked to find easily)
   ============================================================================ */

/* NOTE: nav-item.active rules are below in "SIDEBAR - ACTIVE / OVERRIDES" */

/* Dropdown content used for top-right dropdowns (profile/notifications) */
.dropdown-content {
  position: absolute;
  background: var(--color-accent);
  min-width: 220px;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 100;
  padding: 10px 0;
  right: 0;
  top: 50px;
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
  transition: all .3s;
}

.dropdown-content.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.dropdown-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-light);
  transition: .2s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-primary);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 8px 0;
}

/* Sidebar submenu animation (collapsible submenus) */
.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease-in-out;
}

.sidebar-submenu.show {
  max-height: 500px;
}

/* Submenu link hover */
.sidebar-submenu a:hover {
  color: var(--color-primary);
  border-radius: .5rem;
}

/* ============================================================================
   SIDEBAR - ACTIVE / OVERRIDES
   (ensures parent toggles show active visuals, and overrides utility classes)
   ============================================================================ */

/* Active Nav visual (base) */
.nav-item.active {
  background: rgba(var(--color-primary-rgb), 0.09);
  color: var(--color-primary);
  border-left: 3px solid var(--color-primary);
  font-weight: 600;
  border-radius: 0.75rem;
  filter: drop-shadow(0 0 2.5em rgba(var(--color-primary-rgb), 0.3));
}

/* Sidebar-specific overrides to ensure parent toggle visually matches children.
   These are placed with higher specificity and limited use of !important. */

/* 1) Force active color on parent and descendants */
#sidebar .nav-item.active,
#sidebar .nav-item.active * {
  color: var(--color-primary) !important;
}

/* 2) Re-apply active visual with higher specificity */
#sidebar .nav-item.active {
  background: rgba(var(--color-primary-rgb), 0.09) !important;
  border-left: 3px solid var(--color-primary) !important;
  font-weight: 600 !important;
  border-radius: 0.75rem !important;
  filter: drop-shadow(0 0 2.5em rgba(var(--color-primary-rgb), 0.3)) !important;
}

/* 3) Ensure icons in active toggles also color primary */
#sidebar .nav-item.active i,
#sidebar .nav-item.active svg {
  color: var(--color-primary) !important;
}

/* 4) Chevron rotation fallback */
#sidebar .nav-item .fa-chevron-down.rotate-180 {
  transform: rotate(180deg);
  transition: transform .2s ease;
}

/* 5) Make sure show state is visible */
#sidebar .sidebar-submenu.show {
  max-height: 500px;
  z-index: 5;
}

/* 6) Rotate chevron when aria-expanded="true" or when toggle has .active */
#sidebar [aria-controls][aria-expanded="true"] .fa-chevron-down,
#sidebar [aria-controls].active .fa-chevron-down {
  transform: rotate(180deg);
  transition: transform .2s ease;
}

/* 7) Ensure children inherit color when toggle is a button */
#sidebar .nav-item.active>* {
  color: inherit !important;
}

/* 8) Hover/Focus with higher specificity than generic utilities */
#sidebar .nav-item:hover,
#sidebar .nav-item:focus,
#sidebar .nav-item:active {
  background: rgba(var(--color-primary-rgb), 0.06) !important;
  color: var(--color-primary) !important;
  border-left-color: var(--color-primary) !important;
}

/* 9) Ensure submenu child anchors keep their active style */
#sidebar .sidebar-submenu a.text-bank-primary,
#sidebar .sidebar-submenu a.font-semibold,
#sidebar .sidebar-submenu a.text-bank-primary.font-semibold {
  color: var(--color-primary) !important;
  font-weight: 600 !important;
}

/* 10) Accessibility focus-visible on nav-item */
#sidebar .nav-item:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring) !important;
}

/* ============================================================================
   ACCOUNT / WALLET CARD STYLES
   ============================================================================ */
.account-card {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.5rem;
  overflow: hidden;
  padding: 1.5rem;
  position: relative;
}

.usd-card {
  background: linear-gradient(135deg, #10936c, #052e25);
}

.gbp-card {
  background: linear-gradient(135deg, #2563eb, #07224d);
}

.eur-card {
  background: linear-gradient(135deg, #7c3aed, #2a0c5e);
}

.crypto-card {
  background: linear-gradient(135deg, #d97e0f, #4a2600);
}

/* ADD THIS NEW RULE */
.default-card {
  background: linear-gradient(135deg, #4b5563, #1f2937);
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.account-type,
.account-number {
  font-size: .875rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: .03em;
}

.account-balance {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  margin: .5rem 0;
  color: #fff;
}

.crypto-balance {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-top: .25rem;
}

.account-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  position: relative;
  z-index: 1;
}

.account-name {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.account-swiper-container {
  border-radius: 1.5rem;
  overflow: hidden;
  height: 100%;
}

/* ============================================================================
   MODALS & QUICK ACTIONS
   ============================================================================ */
.modal-content {
  transition: transform .3s ease-in-out;
}

#quick-action-modal.show-modal {
  opacity: 1;
  pointer-events: auto;
}

#quick-action-modal.show-modal .modal-content {
  transform: scale(1);
}

.quick-action-modal-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#quick-action-modal.show-modal .quick-action-modal-item {
  opacity: 1;
  transform: translateY(0);
}

/* Transaction modal */
.loader {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-block;
  border-top: 4px solid var(--color-primary);
  border-right: 4px solid transparent;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  position: relative;
}

.loader::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border-bottom: 4px solid var(--color-purple);
  border-left: 4px solid transparent;
  animation: rotation .5s linear infinite reverse;
}

@keyframes rotation {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   TOAST ANIMATIONS
   ============================================================================ */
.toast.animate-slide-down-fade-in {
  animation: slide-down-fade-in .3s ease-out forwards;
}

.toast.animate-fade-out-up {
  animation: fade-out-up .3s ease-in forwards;
}

/* ============================================================================
   DROPDOWNS (top-right drop menus)
   ============================================================================ */
/* (dropdown-content defined in SIDEBAR section above) */

/* ============================================================================
   SWIPER / PAGINATION
   ============================================================================ */
.swiper-pagination-bullet {
  background-color: rgba(255, 255, 255, 0.3);
  opacity: 1;
  width: 8px;
  height: 8px;
  transition: all .2s;
}

.swiper-pagination-bullet-active {
  background-color: var(--color-primary);
  width: 24px;
  border-radius: 4px;
  filter: drop-shadow(0 0 .8em var(--color-primary));
}

/* ============================================================================
   STATUS BADGES
   ============================================================================ */
.status-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.status-completed,
.status-active {
  background: rgba(34, 197, 94, .12);
  color: #22c55e;
}

.status-pending {
  background: rgba(234, 179, 8, .15);
  color: #eab308;
}

.status-cancelled,
.status-blocked {
  background: rgba(239, 68, 68, .15);
  color: #ef4444;
}

.status-on-hold,
.status-suspended {
  background: rgba(107, 114, 128, .15);
  color: #6b7280;
}

/* ============================================================================
   FLAGS, ICONS, MISC
   ============================================================================ */
.fi {
  font-size: 1.25rem;
  border-radius: .25rem;
}

.crypto-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .25);
  border-radius: 50%;
  margin-right: 8px;
}

/* ============================================================================
   SCROLLBARS
   ============================================================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #161c21;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary), rgba(var(--color-primary-rgb), 0.6));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) #161c21;
}

/* ============================================================================
   LOGOUT / CHECKMARK ANIMATION
   ============================================================================ */
.checkmark-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: var(--color-primary);
  fill: none;
  animation: stroke .6s cubic-bezier(.65, 0, .45, 1) forwards;
}

.logout-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 3;
  stroke: #fff;
  stroke-miterlimit: 10;
  margin: 0 auto 20px;
  box-shadow: inset 0 0 0 var(--color-primary);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.logout-checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke .3s cubic-bezier(.65, 0, .45, 1) .8s forwards;
}

@keyframes stroke {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes fill {
  to {
    box-shadow: inset 0 0 0 40px var(--color-primary);
  }
}

/* ============================================================================
   OTHER / MEDIA QUERIES (small adjustments)
   ============================================================================ */
@media (max-width:768px) {
  .dashboard-grid .lg-span-2 {
    grid-column: span 1;
  }

  .dashboard-grid>div,
  .dashboard-grid>section {
    min-width: 0;
  }
}

/* ============================================================================
   END OF FILE
   ============================================================================ */