/* 
 * Jain-Krishna Catalytic Model Web Application
 * Light Mode Design System & Fixed Sidebar Layout
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css');

:root {
  --bg-body: #d6dbe3;
  --bg-sidebar: rgba(87, 106, 202, 0.65);
  --bg-card: #ffffff;
  --bg-card-header: #f8fafc;
  --border-card: #cbd5e1;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-heading: #0f172a;
  
  --primary: #576aca;
  --primary-active: #4758b2;
  --accent-blue: #2563eb;
  --accent-teal: #0d9488;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --accent-orange: #ea580c;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

/* Fixed Sidebar Styling */
.sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 15.5rem !important; /* ~248px width */
  padding: 1.5rem 1.1rem !important;
  background-color: var(--bg-sidebar) !important;
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0, 0, 0, 0.12) !important;
  overflow-y: auto !important;
  z-index: 1000 !important;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08) !important;
}

.sidebar-brand {
  font-family: 'Outfit', 'Palatino Linotype', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sidebar-subbrand {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1rem;
}

/* Page Content Container (GUARANTEED NO OVERLAP) */
.page-content-wrapper, .page-content {
  margin-left: 17rem !important; /* Clear 272px offset ensuring zero sidebar overlap */
  flex: 1 !important;
  padding: 1.5rem 2rem 3rem 1.5rem !important;
  min-height: 100vh;
  box-sizing: border-box !important;
  width: calc(100% - 17rem) !important;
}

/* Navigation Links */
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  background-color: #6073d6 !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(96, 115, 214, 0.35);
}

.nav-link {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  border-radius: 8px !important;
  padding: 0.6rem 1rem !important;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.25) !important;
}

/* Sidebar Index Box */
.sidebarindex {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 0.9rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebarindex-title {
  font-family: 'Outfit', serif;
  text-align: center;
  color: var(--text-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.icon-div {
  text-align: left;
  background-color: #ffffff;
  padding: 0.35rem 0.2rem;
  font-size: 12.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.icon-div:last-child {
  border-bottom: none;
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 6px;
  flex-shrink: 0;
}

/* KPI Dashboard Cards (Light Mode) */
.metric-card-light {
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card-light:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-label-light {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.metric-value-light {
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0;
}

/* Card Styling */
.card {
  border-radius: 12px !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border-card) !important;
  margin-bottom: 1.25rem;
  background-color: var(--bg-card) !important;
}

.card-header {
  background-color: var(--bg-card-header) !important;
  text-align: center;
  border-radius: 12px 12px 0px 0px !important;
  border-bottom: 1px solid var(--border-card) !important;
  font-family: 'Outfit', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-heading);
  padding: 0.85rem 1.25rem !important;
}

.card-body {
  border-radius: 0px 0px 12px 12px !important;
  background-color: var(--bg-card) !important;
  padding: 1.25rem !important;
}

.cardbody-about {
  border-radius: 12px !important;
  background-color: var(--bg-card) !important;
}

/* Classic Button-8 Styling */
.button-8 {
  background-color: #e1ecf4;
  border-radius: 4px;
  border: 1px solid #7aa7c7;
  box-shadow: rgba(255, 255, 255, .7) 0 1px 0 0 inset;
  box-sizing: border-box;
  color: #39739d;
  cursor: pointer;
  display: inline-block;
  font-family: -apple-system, system-ui, "Segoe UI", "Liberation Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  margin: 0.25rem 0.35rem 0.25rem 0;
  outline: none;
  padding: 7px 14px;
  text-align: center;
  text-decoration: none;
  user-select: none;
  transition: all 0.15s ease;
}

.button-8:hover, .button-8:focus {
  background-color: #b3d3ea;
  color: #2c5777;
}

.button-8:active {
  background-color: #a0c7e4;
  box-shadow: none;
}

/* Form Inputs */
input.form-control, .type-1, .custom-input {
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  padding: 6px 12px !important;
  font-size: 14px !important;
  background-color: #ffffff !important;
  color: var(--text-main) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

input.form-control:focus, .type-1:focus, .custom-input:focus {
  border-color: #576aca !important;
  box-shadow: 0 0 0 3px rgba(87, 106, 202, 0.2) !important;
  outline: none !important;
}

/* Selection Info Box */
.selection-box {
  border-radius: 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

/* Base Classes for Mobile Elements (MUST BE BEFORE MEDIA QUERY) */
.mobile-toggle-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1040;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background-color 0.2s ease;
}

.mobile-toggle-btn:hover {
  background-color: var(--primary-active);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Overrides (MUST BE AT THE VERY BOTTOM) */
@media (max-width: 991.98px) {
  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 16rem !important;
    transform: translateX(-100%) !important; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1050 !important; 
  }

  .sidebar.active {
    transform: translateX(0) !important;
  }

  .page-content-wrapper, .page-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 1.25rem !important;
    padding-top: 4rem !important; 
  }
}