/* 
  Mypenal Affiliate Management System - Global Design System
  Fonts: Inter, Outfit
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary: #6366f1;
  --dark-bg: #0f111a;
  --dark-sidebar: #1b1e2f;
  --dark-card: #1f2335;
  --card-border: rgba(255, 255, 255, 0.05);
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-hover-bg: rgba(139, 92, 246, 0.1);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-white: #f8fafc;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --glass: rgba(255, 255, 255, 0.03);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-primary);
  line-height: 1.6;
}

h1, h2, h3, h4, .outfit {
  font-family: 'Outfit', sans-serif;
}

.admin-body {
  background-color: var(--dark-bg);
  color: var(--text-white);
}

/* =============================================
   GLOBAL HORIZONTAL SCROLL FIX
   Har jagah wide table automatically scroll hogi
   ============================================= */

.card,
.honey-card,
.conversions-container,
.reports-container,
.table-wrapper,
.table-responsive {
  overflow-x: auto !important;
  width: 100%;
}

table {
  min-width: 1000px;
  width: 100%;
  border-collapse: collapse;
}

/* Custom Scrollbar — theme ke saath match */
.card::-webkit-scrollbar,
.honey-card::-webkit-scrollbar,
.conversions-container::-webkit-scrollbar,
.reports-container::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.card::-webkit-scrollbar-track,
.honey-card::-webkit-scrollbar-track,
.conversions-container::-webkit-scrollbar-track,
.reports-container::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.card::-webkit-scrollbar-thumb,
.honey-card::-webkit-scrollbar-thumb,
.conversions-container::-webkit-scrollbar-thumb,
.reports-container::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* Firefox scrollbar */
.card,
.honey-card,
.conversions-container,
.reports-container,
.table-wrapper,
.table-responsive {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

/* ============================================= */

/* Auth Pages (Login/Signup) */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.auth-card {
  width: 100%;
  max-width: 450px;
  background: var(--light-card);
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  font-family: inherit;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
}

/* Dashboard CSS etc will be added in more detail later */

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-semibold { font-weight: 600; }
.text-bold { font-weight: 700; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-auto { margin-top: auto; }

.grid { display: grid; }
.rounded-xl { border-radius: 1rem; }
.rounded-2xl { border-radius: 1.5rem; }

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 12px;
}
.stat-trend-up { background: rgba(16, 185, 129, 0.1); color: var(--success); }

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.fab:hover {
  transform: rotate(15deg) scale(1.1);
  background-color: var(--primary-hover);
}

/* =============================================
   MOBILE RESPONSIVE — Admin & Affiliate Panel
   ============================================= */

/* Tablet & Mobile */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .dual-panel {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {

  /* Sidebar hide on mobile */
  .sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transition: left 0.3s ease !important;
    width: 260px !important;
  }
  .sidebar.mobile-open {
    left: 0 !important;
    box-shadow: 0 0 40px rgba(0,0,0,0.6) !important;
  }

  /* Sidebar overlay */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
  }
  .sidebar-overlay.active {
    display: block;
  }

  /* Main content full width */
  .main-wrapper,
  .content-area,
  main,
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 1rem !important;
  }

  /* Top header */
  .top-header,
  .topbar,
  header {
    padding: 0.75rem 1rem !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
  }

  /* Hamburger button show */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(139,92,246,0.15);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
  }

  /* Stats cards - 2 column on mobile */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .premium-card {
    padding: 1rem !important;
    border-radius: 16px !important;
  }

  .stat-value {
    font-size: 1.2rem !important;
  }

  /* Dual panel - single column */
  .dual-panel {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Tables */
  table {
    min-width: 500px !important;
  }

  .card,
  .honey-card,
  .premium-card {
    overflow-x: auto !important;
  }

  /* Page title */
  h1.text-4xl {
    font-size: 1.6rem !important;
  }

  h1.text-3xl {
    font-size: 1.4rem !important;
  }

  /* Filter popover */
  .filter-popover {
    right: 1rem !important;
    left: 1rem !important;
    width: auto !important;
    bottom: 5.5rem !important;
  }

  .filter-fab {
    right: 1rem !important;
    bottom: 1rem !important;
    width: 50px !important;
    height: 50px !important;
  }

  /* Modals */
  .honey-card[style*="width: 500px"],
  div[style*="width: 500px"] {
    width: 95% !important;
    margin: 5% auto !important;
    padding: 1.5rem !important;
  }

  /* Flex wrap on mobile */
  .flex {
    flex-wrap: wrap;
  }

  /* Grid 2 cols to 1 col */
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Buttons */
  .btn {
    padding: 0.7rem 1rem !important;
    font-size: 0.85rem !important;
  }

  /* Affiliate links page filter bar */
  .filter-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  /* Publisher activity page */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-value {
    font-size: 1.1rem !important;
  }

  .premium-card {
    padding: 0.85rem !important;
  }

  h1.text-4xl {
    font-size: 1.3rem !important;
  }
}