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

:root {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: dark light;

  /* Theme variables - Sleek Dark Mode by default */
  --bg-app: #090b11;
  --bg-panel: rgba(18, 22, 33, 0.7);
  --bg-card: rgba(26, 32, 48, 0.4);
  --bg-card-hover: rgba(33, 41, 61, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.15);
  --color-text-primary: #f3f4f6;
  --color-text-secondary: #9ca3af;
  --color-text-muted: #6b7280;

  /* Accent Colors */
  --accent-primary: #8b5cf6;     /* Vivid Violet */
  --accent-primary-rgb: 139, 92, 246;
  --accent-secondary: #3b82f6;   /* Royal Blue */
  --accent-success: #10b981;     /* Emerald Green */
  --accent-success-rgb: 16, 185, 129;
  --accent-warning: #f59e0b;     /* Warm Amber */
  --accent-error: #ef4444;       /* Ruby Red */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.15);

  background-color: var(--bg-app);
  color: var(--color-text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

[data-theme="light"] {
  --bg-app: #f4f6fa;
  --bg-panel: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.6);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.12);
  --color-text-primary: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #9ca3af;
  --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.08);
}

/* Custom Reset and Utilities */

* {
  box-sizing: border-box;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body {
  margin: 0;
  padding: 0;
}

/* Premium Gradients */

.gradient-bg {
  background: radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.12) 0%, transparent 50%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
}

/* Glassmorphism Classes */

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* Scrollbar Customization */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* Inputs and Buttons */

select, input, button {
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 8px;
  outline: none;
}

select, input[type="text"] {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--color-text-primary);
  padding: 0.625rem 1rem;
}

select:focus, input[type="text"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

button {
  cursor: pointer;
  border: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  padding: 0.625rem 1.25rem;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(139, 92, 246, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.1) inset;
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--color-text-primary);
  border: 1px solid var(--border-color);
  padding: 0.625rem 1.25rem;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

/* Layout structure */

.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background-color: var(--bg-app);
}

.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.main-content {
  padding: 2rem;
  overflow-y: auto;
  min-height: 100vh;
  width: 100%;
}

.logo-title {
  font-size: 1.5rem !important;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .logo-title {
  background: linear-gradient(to right, #111827, #4b5563);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
  margin-top: 0.15rem;
}

/* Nav Menu Styling */

.nav-menu {
  display: flex;
  flex-direction: column;
}

.nav-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  justify-content: flex-start;
}

.nav-item:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.nav-item.active {
  background: var(--bg-card-hover);
  color: var(--color-text-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

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

/* Sidebar Footer Controls */

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.sync-btn-sidebar {
  font-size: 0.85rem;
  padding: 0.625rem 1rem;
  height: 40px;
  border-radius: 8px;
}

/* Main Content Header styling */

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.main-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

/* App container compatibility */

.app-container {
  display: contents; /* Ensure app-container doesn't interfere */
}

/* Responsive sidebar layouts */

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
  }

  .main-content {
    padding: 1.25rem;
    min-height: auto;
  }

  .sidebar-footer {
    width: 100%;
    margin-top: 0;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
  }
}

/* Header & Tabs */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

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

.logo-section h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .logo-section h1 {
  background: linear-gradient(to right, #111827, #4b5563);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tabs-nav {
  display: flex;
  background: var(--bg-panel);
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.tab-btn:hover {
  color: var(--color-text-primary);
}

.tab-btn.active {
  background: var(--bg-card-hover);
  color: var(--color-text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Dashboard Summary Cards Grid */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.summary-card {
  padding: 1.25rem;
  border-radius: 12px;
}

.summary-card-label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.summary-card-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

/* Dashboard accounts listing */

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.accounts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

/* Account card item styling */

.account-card {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 768px) {
  .account-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.account-name-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.account-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.account-detail {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.account-value {
  font-weight: 700;
  font-size: 1.15rem;
  text-align: right;
}

[data-theme="light"] .account-value {
  color: var(--color-text-primary);
}

@media (max-width: 768px) {
  .account-value {
    text-align: left;
  }
}

.account-progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  grid-column: span 3;
  margin-top: 0.25rem;
}

[data-theme="light"] .account-progress-container {
  background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .account-progress-container {
    grid-column: span 1;
  }
}

.account-progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent-secondary), var(--accent-primary));
  border-radius: 3px;
}

/* Side Drawer (Virtual Account Details) */

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.drawer-content {
  width: 100%;
  max-width: 700px;
  height: 100%;
  background: var(--bg-app);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.drawer-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.drawer-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
  overflow: hidden;
}

/* Remitters Table */

.remitters-table-container {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-app);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] th {
  background: rgba(0, 0, 0, 0.02);
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

.remitter-name-cell {
  font-weight: 600;
}

.remitter-upi-cell {
  font-family: monospace;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* Modals */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  width: 100%;
  max-width: 600px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.close-btn {
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: 50%;
  padding: 0.5rem;
}

.close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--color-text-primary);
}

/* Dropzone Area */

.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.dropzone-icon {
  color: var(--accent-primary);
}

.sync-log-container {
  background: #0d0f14;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

[data-theme="light"] .sync-log-container {
  background: #1e293b;
  color: #38bdf8;
}

/* Historical Analysis Trend chart custom */

.chart-container {
  height: 250px;
  margin-top: 1rem;
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow-x: auto;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 60px;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(to top, var(--accent-secondary), var(--accent-primary));
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  position: relative;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.chart-bar:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.chart-bar-value {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.chart-bar-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* Spinner */

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.pill-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Search bar positioning */

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 350px;
}

.search-input {
  width: 100%;
  padding-left: 2.5rem !important;
}

.search-icon-inside {
  position: absolute;
  left: 0.875rem;
  color: var(--color-text-muted);
  pointer-events: none;
}
