/* ===========================
   Radix Color Palette (Slate)
   =========================== */
:root {
  /* Typography colors */
  --color-text: hsl(206, 24.0%, 9.0%);
  --color-text-secondary: hsl(206, 6.0%, 43.5%);
  --color-text-muted: hsl(206, 6.0%, 56.1%);

  /* Border color */
  --color-border: rgba(0,0,0,0.05);

  /* Backgrounds */
  --color-bg: hsl(206, 30.0%, 98.8%);
  --color-surface: hsl(210, 16.7%, 97.6%);

  /* Accent color - Electric Blue */
  --color-accent: #0066FF;
  --color-accent-hover: #0052CC;
  
  /* Status colors */
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
}

/* ===========================
   Reset & Base Styles
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  letter-spacing: -0.5px;
}

/* ===========================
   Typography
   =========================== */
h1 {
  font-size: 64px;
  letter-spacing: -0.5px;
  line-height: 1.2;
  font-weight: 600;
}

h2 {
  font-size: 48px;
  letter-spacing: -0.5px;
  line-height: 1.2;
  font-weight: 600;
}

h3 {
  font-size: 42px;
  letter-spacing: -0.5px;
  line-height: 1.4;
  font-weight: 600;
}

h4 {
  font-size: 32px;
  letter-spacing: -0.5px;
  line-height: 1.4;
  font-weight: 600;
}

h5 {
  font-size: 28px;
  letter-spacing: -0.5px;
  line-height: 1.4;
  font-weight: 600;
}

h6 {
  font-size: 24px;
  letter-spacing: -0.5px;
  line-height: 1.4;
  font-weight: 600;
}

p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--color-text);
}

small, .caption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ===========================
   Container & Layout
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* ===========================
   Navigation
   =========================== */
.navbar {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: -1px;
}

.navbar-menu {
  display: flex;
  gap: 24px;
  align-items: center;
  list-style: none;
}

.navbar-menu a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}

.navbar-menu a:hover {
  color: var(--color-accent);
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.3px;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: white;
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

/* ===========================
   Forms
   =========================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  color: var(--color-text);
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-error {
  color: var(--color-error);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.form-error.show {
  display: block;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  padding: 120px 0;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.hero h1 {
  margin-bottom: 24px;
}

.hero p {
  font-size: 20px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================
   Dashboard
   =========================== */
.dashboard {
  padding: 40px 0;
  min-height: calc(100vh - 200px);
}

.dashboard-header {
  margin-bottom: 40px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.stat-card h3 {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
}

/* ===========================
   Table
   =========================== */
.table-container {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

th {
  padding: 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

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

/* ===========================
   Status Badges
   =========================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.badge-pending {
  background: #FEF3C7;
  color: #92400E;
}

.badge-failed {
  background: #FEE2E2;
  color: #991B1B;
}

/* ===========================
   Alert Messages
   =========================== */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
}

.alert.show {
  display: block;
}

.alert-success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* ===========================
   Footer
   =========================== */
.footer {
  background: white;
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
}

.footer p {
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1200px) {
  h1 { font-size: 56px; }
  h2 { font-size: 42px; }
  h3 { font-size: 36px; }
  h4 { font-size: 28px; }
  h5 { font-size: 24px; }
  h6 { font-size: 22px; }
}

@media (max-width: 992px) {
  h1 { font-size: 48px; }
  h2 { font-size: 36px; }
  h3 { font-size: 32px; }
  h4 { font-size: 24px; }
  h5 { font-size: 22px; }
  h6 { font-size: 20px; }
  
  .hero {
    padding: 80px 0;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }
  h3 { font-size: 28px; }
  h4 { font-size: 22px; }
  h5 { font-size: 20px; }
  h6 { font-size: 18px; }
  
  .container {
    padding: 0 16px;
  }
  
  .card {
    padding: 24px;
  }
  
  .navbar-menu {
    gap: 16px;
  }
  
  .hero {
    padding: 60px 0;
  }
  
  .hero p {
    font-size: 18px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  table {
    font-size: 13px;
  }
  
  th, td {
    padding: 12px 8px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 34px; }
  h2 { font-size: 28px; }
  h3 { font-size: 24px; }
  h4 { font-size: 20px; }
  h5 { font-size: 18px; }
  h6 { font-size: 16px; }
  
  .navbar-brand {
    font-size: 20px;
  }
  
  .navbar-menu {
    flex-direction: column;
    gap: 12px;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .hero h1 {
    font-size: 32px;
  }
  
  .hero p {
    font-size: 16px;
  }
}

/* ===========================
   Loading Spinner
   =========================== */
.spinner {
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: none;
}

.spinner.show {
  display: block;
}

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

/* API Keys Styles */
.api-keys-list {
    margin-top: 20px;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--slate-2);
    border-radius: 8px;
    margin-bottom: 15px;
}

.api-key-info {
    flex: 1;
}

.api-key-label {
    font-size: 12px;
    color: var(--slate-11);
    margin-bottom: 5px;
}

.api-key-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-key-value code {
    background: var(--slate-3);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.api-key-meta {
    font-size: 12px;
    color: var(--slate-11);
    margin-top: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

/* Integration Tabs */
.integration-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--slate-6);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--slate-11);
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--blue-11);
}

.tab-btn.active {
    color: var(--blue-11);
    border-bottom-color: var(--blue-9);
}

.tab-content {
    display: none;
}

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

.tab-content pre {
    background: var(--slate-2);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
}

.tab-content code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Documentation Links */
.doc-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--slate-2);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.doc-link:hover {
    background: var(--slate-3);
    transform: translateY(-2px);
}

.doc-icon {
    font-size: 32px;
}

.doc-link h4 {
    margin: 0 0 5px 0;
    color: var(--slate-12);
}

.doc-link p {
    margin: 0;
    font-size: 14px;
    color: var(--slate-11);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close {
    color: var(--slate-11);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--slate-12);
}

.api-key-display {
    margin: 20px 0;
}

.api-key-display label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.key-value {
    display: flex;
    gap: 10px;
}

.key-value input {
    flex: 1;
    font-family: 'Courier New', monospace;
}

/* Payment Methods Styles */
.payment-method-details {
    padding: 20px 0;
}

.supported-cards {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.upi-app {
    padding: 8px 16px;
    background: var(--slate-3);
    border-radius: 6px;
    font-weight: 500;
}

.method-stats {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--slate-11);
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-11);
}

.banks-grid, .wallets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.bank-item, .wallet-item {
    padding: 15px;
    background: var(--slate-2);
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.crypto-item {
    padding: 15px;
    background: var(--slate-2);
    border-radius: 8px;
    text-align: center;
}

.crypto-item span:first-child {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

.emi-options {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.emi-option {
    padding: 12px 24px;
    background: var(--slate-2);
    border-radius: 8px;
    font-weight: 500;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--slate-6);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--blue-9);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Settlements Styles */
.settlement-schedule {
    margin-top: 20px;
}

.schedule-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--slate-2);
    border-radius: 8px;
    margin-bottom: 15px;
}

.schedule-date {
    text-align: center;
    min-width: 60px;
}

.date-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue-11);
}

.date-month {
    font-size: 14px;
    color: var(--slate-11);
}

.schedule-details {
    flex: 1;
}

.schedule-details h4 {
    margin: 0 0 5px 0;
}

.schedule-details p {
    margin: 0 0 10px 0;
    color: var(--slate-11);
    font-size: 14px;
}

.schedule-amount {
    font-size: 20px;
    font-weight: 600;
    color: var(--green-11);
}

.schedule-meta {
    font-size: 12px;
    color: var(--slate-11);
    margin-top: 5px;
}

.schedule-status {
    display: flex;
    align-items: center;
}

.bank-details {
    max-width: 600px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--slate-6);
}

.detail-label {
    color: var(--slate-11);
}

.detail-value {
    font-weight: 600;
}

/* Webhooks Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--slate-2);
    border-radius: 6px;
    cursor: pointer;
}

.checkbox-label:hover {
    background: var(--slate-3);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .api-key-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .integration-tabs {
        overflow-x: auto;
    }
    
    .method-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .schedule-item {
        flex-direction: column;
    }
    
    .doc-links {
        grid-template-columns: 1fr;
    }
}
