/* Core Theme & Style Variables for Cowin Lead Management CRM */
:root {
  --primary-indigo: #6366f1;
  --primary-indigo-hover: #4f46e5;
  --dark-slate-900: #0f172a;
  --dark-slate-800: #1e293b;
  --dark-slate-700: #334155;
  --bg-light: #f8fafc;
  --border-light: rgba(226, 232, 240, 0.8);
  
  /* Button themes & Action Colors */
  --btn-add: #10b981;      /* Emerald Green */
  --btn-edit: #6366f1;     /* Indigo Blue */
  --btn-delete: #ef4444;   /* Rose Red */
  --btn-whatsapp: #25d366; /* WhatsApp Green */
  --btn-call: #06b6d4;     /* Cyan Blue */
  
  --card-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03), 0 2px 4px -2px rgba(15, 23, 42, 0.02), 0 10px 15px -3px rgba(15, 23, 42, 0.03);
  --card-shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg-light);
  font-family: 'Outfit', sans-serif;
  color: var(--dark-slate-700);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Wrapper Layout */
.wrapper {
  min-height: 100vh;
}

/* Mobile Navbar */
.mobile-navbar {
  height: 64px;
  background-color: var(--dark-slate-900) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1030;
}

/* Sidebar Layout & Transitions */
.sidebar {
  background: linear-gradient(180deg, var(--dark-slate-900) 0%, var(--dark-slate-800) 100%);
  padding: 24px 16px;
  color: white;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.05);
}

.sidebar h3 {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1.35rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
}

.sidebar li {
  margin: 8px 0;
}

.sidebar a {
  color: #94a3b8;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.sidebar a i {
  font-size: 1.15rem;
}

.sidebar a:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar a.active {
  color: white;
  background: rgba(99, 102, 241, 0.15);
  box-shadow: inset 4px 0 0 var(--primary-indigo);
}

/* Sidebar Backdrop on Mobile */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1040;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* Desktop Sidebar Layout Configuration */
@media (min-width: 992px) {
  .wrapper {
    display: flex;
  }
  .sidebar {
    width: 260px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
  }
  .content {
    flex: 1;
    padding: 40px;
    max-width: calc(100% - 260px);
  }
}

/* Mobile Sidebar Layout Configuration */
@media (max-width: 991.98px) {
  .wrapper {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    width: 280px;
    z-index: 1050;
    height: 100vh;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.show {
    left: 0;
  }
  .content {
    padding: 24px 16px;
    width: 100%;
  }
}

/* Premium Elevating Cards */
.card.shadow {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--card-shadow) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card.shadow:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover) !important;
  border-color: rgba(99, 102, 241, 0.25);
}

/* Dashboard Summary Card Figures */
.card h2 {
  font-size: 2.2rem;
  letter-spacing: -1px;
}

/* Form Inputs styling */
.form-control, .form-select {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: 'Outfit', sans-serif;
  color: var(--dark-slate-700);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* Table Card Layout */
.table-responsive {
  border-radius: 12px;
  border: 1px solid var(--border-light);
  overflow-x: auto;
}

.table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  background-color: #f1f5f9 !important;
  color: var(--dark-slate-700);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.92rem;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Actions Button Styling & Micro-interactions */
.d-inline-flex.gap-1 .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  padding: 0;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  color: white !important;
}

.d-inline-flex.gap-1 .btn:active {
  transform: scale(0.92);
}

.btn-edit { background-color: var(--btn-edit) !important; }
.btn-edit:hover { background-color: var(--primary-indigo-hover) !important; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }

.btn-delete { background-color: var(--btn-delete) !important; }
.btn-delete:hover { background-color: #e11d48 !important; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }

.btn-call { background-color: var(--btn-call) !important; }
.btn-call:hover { background-color: #0891b2 !important; box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3); }

.btn-whatsapp { background-color: var(--btn-whatsapp) !important; }
.btn-whatsapp:hover { background-color: #16a34a !important; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); }

/* Custom Badge Statuses */
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 30px;
  display: inline-block;
  letter-spacing: 0.3px;
}

.status-new { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.status-interested { background-color: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.status-followup { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.status-completed { background-color: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.status-lost { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* SPA View Section smooth transition animations */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Spinner Overlay styles */
#globalSpinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Custom premium progress bar */
.progress {
  height: 8px !important;
  border-radius: 8px;
  background-color: #e2e8f0;
}
.progress-bar {
  border-radius: 8px;
  background-image: linear-gradient(90deg, var(--primary-indigo) 0%, #818cf8 100%);
}

/* Modals Modern Look */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 24px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 16px 24px;
}

.btn-success {
  background-color: var(--btn-add);
  border-color: var(--btn-add);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-success:hover {
  background-color: #059669;
  border-color: #059669;
  transform: translateY(-1px);
}

.btn-primary {
  background-color: var(--primary-indigo);
  border-color: var(--primary-indigo);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background-color: var(--primary-indigo-hover);
  border-color: var(--primary-indigo-hover);
  transform: translateY(-1px);
}
