@import url('/css/theme.css');

/* Custom Agent Portal Styles */

body.dashboard-body-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar-navigation {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  padding: 24px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 30px;
  padding-left: 12px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.section-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  padding-left: 12px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

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

.nav-item.active {
  background-color: rgba(14, 211, 198, 0.08);
  color: #0ed3c6;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 4px;
  background-color: #0ed3c6;
  border-radius: 0 4px 4px 0;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.05);
  border: 1px dashed rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f43f5e;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Layout Wrapper */
.main-layout-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: 80px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.ping-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.ping-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #10b981;
  border-radius: 50%;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  left: 0;
  top: 0;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.action-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.action-icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Content Container */
.content-container {
  padding: 32px;
  flex-grow: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Stats Row and Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.stat-card-premium {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 8px;
}

.stat-number {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-trend {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend-up {
  color: #10b981;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-teal {
  background: rgba(14, 211, 198, 0.1);
  color: #0ed3c6;
}

.icon-yellow {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

.icon-orange {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

/* UPI Handles List */
.handles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.handle-item-card {
  padding: 16px;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.handle-vpa {
  font-family: monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.handle-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
  background-color: rgba(14, 211, 198, 0.1);
  color: #0ed3c6;
  border: 1px solid rgba(14, 211, 198, 0.2);
}

/* Login Page Styles */
.login-body-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-primary);
  font-family: var(--font-main);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 40px;
}

.brand-header {
  text-align: center;
  margin-bottom: 25px;
}

.brand-icon {
  font-size: 36px;
  color: #0ed3c6;
  margin-bottom: 12px;
}

.brand-text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.portal-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  display: block;
}

.divider {
  height: 1px;
  background-color: var(--border-color);
  width: 100%;
  margin: 20px 0;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
}

.input-wrapper input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.input-wrapper input:focus {
  outline: none;
  border-color: #0ed3c6;
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(14, 211, 198, 0.15);
}

.eye-toggle-btn {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-block {
  width: 100%;
}

.btn-login {
  background-color: #0ed3c6;
  color: #0a0b10;
  font-weight: 600;
  gap: 10px;
  margin-top: 15px;
  height: 46px;
}

.btn-login:hover {
  background-color: #0bbfb3;
  transform: translateY(-1px);
}

.login-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 30px;
}

.alert-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
}

.alert-box.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-box.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Light Theme Overrides */
body.light-theme .sidebar-navigation {
  background-color: #ffffff;
}

body.light-theme .nav-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

body.light-theme .avatar-placeholder {
  background-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .logout-btn {
  background: rgba(239, 68, 68, 0.03);
}

body.light-theme .logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
}

body.light-theme .action-icon-btn {
  background-color: #ffffff;
}

body.light-theme .input-wrapper input {
  background-color: #ffffff;
}

body.light-theme .input-wrapper input:focus {
  background-color: #ffffff;
}

body.light-theme .handle-item-card {
  background-color: #ffffff;
}

/* Modal overlay and animations */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-modal {
  width: 90%;
  max-width: 500px;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Scrollbar for merchant list */
#agent-merchants-container::-webkit-scrollbar {
  width: 6px;
}
#agent-merchants-container::-webkit-scrollbar-track {
  background: transparent;
}
#agent-merchants-container::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.3);
  border-radius: 3px;
}

.merchant-item-card {
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.merchant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.merchant-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.merchant-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.merchant-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Light Theme Merchant Card Overrides */
body.light-theme .merchant-item-card {
  background-color: #ffffff;
}

/* Dashboard Split Grid */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

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

.chart-card-large {
  padding: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-range-selector {
  display: flex;
  background-color: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.range-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.range-btn.active {
  background-color: #0ed3c6;
  color: var(--bg-primary);
}

.chart-wrapper-main {
  height: 280px;
  position: relative;
}

/* Top Merchants list */
.top-merchants-card {
  padding: 24px;
}

.merchants-rank-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.merchant-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.merchant-rank-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.rank-1 { background-color: rgba(14, 211, 198, 0.15); color: #0ed3c6; border: 1px solid #0ed3c6; }
.rank-2 { background-color: rgba(255, 179, 0, 0.15); color: #ffb300; border: 1px solid #ffb300; }
.rank-3 { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }
.rank-other { background-color: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border-color); }

.merchant-rank-info {
  flex-grow: 1;
}

.merchant-rank-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.merchant-rank-txs {
  font-size: 11px;
  color: var(--text-muted);
}

.merchant-rank-volume {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Light theme overrides for Top Merchants items */
body.light-theme .merchant-rank-item {
  background-color: #ffffff;
}
body.light-theme .merchant-rank-item:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

/* Toast Notification styling */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
  max-width: 350px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
