/* Local Poppins Font Integration */
@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins/Poppins-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins/Poppins-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins/Poppins-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

:root {
  --primary-color: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #5eead4;
  --secondary-color: #3b82f6;
  --accent-color: #f59e0b;
  --dropped-color: #ef4444;
  --background-color: #f1f5f9;
  --card-bg: rgba(255, 255, 255, 0.85);
  --text-color: #0f172a;
  --light-text: #475569;
  --border-color: rgba(226, 232, 240, 0.5);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif !important;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.main-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.main-nav ul {
  display: flex;
  list-style: none;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.main-nav a.active,
.main-nav a:hover {
  color: white;
}

.main-nav a:focus-visible {
  outline: 2px solid white;
  outline-offset: -5px;
  border-radius: 4px;
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.section-title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #444;
}

/* Input Styles */
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-size: 0.85rem;
  color: var(--light-text);
  margin-bottom: 0.4rem;
}

.input-group input,
.input-group select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  color: var(--text-color);
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.input-group input:focus-visible,
.input-group select:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.button-area {
  display: flex;
  justify-content: center;
}

.btn {
  padding: 0.6rem 2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.3);
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border-color);
  margin-left: 10px;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Dashboard Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  color: white;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

.metric-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover::after {
  opacity: 1;
}

.metric-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card p {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}

.metric-card.wait-time,
.metric-card.turnaround-time,
.metric-card.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.metric-card.service-time,
.metric-card.response-time,
.metric-card.orange {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.metric-card.dropped-customers {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.metric-card.cost-metric {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1rem;
}

th,
td {
  padding: 1rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

th {
  background-color: rgba(248, 250, 252, 0.8);
  color: var(--text-color);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border-color);
}

tr:hover td {
  background-color: rgba(13, 148, 136, 0.03);
}

tr:last-child td {
  border-bottom: none;
}

.action-bar {
  display: flex;
  justify-content: flex-end;
}

.btn-download {
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Gantt Chart */
.chart-container {
  margin-bottom: 3rem;
}

#ganttChartTitle {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.gantt-wrapper {
  position: relative;
  padding: 20px 10px 40px 10px;
  background: #fdfdfd;
  border-radius: 8px;
}

.gantt-chart {
  display: flex;
  height: 70px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.gantt-item {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: white;
  min-width: 0;
  position: relative;
  transition: transform 0.2s ease, filter 0.2s ease;
  cursor: default;
}

.gantt-item.service {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.gantt-item.idle {
  background-color: #f1f5f9;
  color: #94a3b8;
  font-style: italic;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0, 0, 0, 0.02) 5px, rgba(0, 0, 0, 0.02) 10px);
}

.gantt-axis {
  position: relative;
  height: 20px;
  margin-top: 5px;
}

.axis-tick {
  position: absolute;
  top: 0;
  font-size: 0.7rem;
  color: var(--light-text);
}

/* Visuals Grid */
.visuals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #555;
  font-weight: 500;
  display: block;
  /* Overriding previous display:none */
}

.scatter-card {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .scatter-card {
    grid-column: span 1;
  }
}

canvas {
  width: 100% !important;
  height: auto !important;
}

@media (max-width: 768px) {
  .visuals-grid {
    grid-template-columns: 1fr;
  }
}

/* Custom Error Notifications */
.error-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.error-toast {
  background: #fff;
  color: #1e293b;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 450px;
  border-left: 5px solid var(--dropped-color);
  pointer-events: auto;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.5s ease 4.5s forwards;
}

/* Theory Page Specific Styles */
.theory-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.theory-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.theory-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

.theory-section {
  margin-bottom: 4rem;
}

.theory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.formula-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
}

.formula-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

.formula-card h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

/* Math Formatting */
.math-block {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1rem 0;
  border-left: 4px solid var(--primary-color);
}

.math {
  font-family: 'Cambria Math', 'serif';
  font-style: italic;
  font-size: 1.4rem;
  color: #1e293b;
  display: block;
  text-align: center;
}

.math-inline {
  font-family: 'Cambria Math', 'serif';
  font-style: italic;
  font-weight: 600;
}

.frac {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  padding: 0 0.1em;
}

.frac>span {
  display: block;
  padding: 0.05em 0.2em;
}

.frac span.bottom {
  border-top: 1.5px solid #1e293b;
}

.sup {
  vertical-align: super;
  font-size: 0.7em;
  line-height: 0;
}

.sub {
  vertical-align: sub;
  font-size: 0.7em;
  line-height: 0;
}

.def-list {
  list-style: none;
}

.def-list li {
  margin-bottom: 1.2rem;
  display: flex;
  align-items: baseline;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed #e2e8f0;
}

.def-list li:last-child {
  border-bottom: none;
}

.def-term {
  font-weight: 700;
  color: var(--primary-color);
  min-width: 120px;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.def-desc {
  color: var(--light-text);
  font-size: 0.95rem;
}

.model-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .theory-header h2 {
    font-size: 2rem;
  }

  .theory-grid {
    grid-template-columns: 1fr;
  }
}


/* Theory Tables and Badges */
.theory-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.theory-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.theory-table th {
  background: var(--primary-color);
  color: white;
  text-align: left;
  padding: 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theory-table td {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 0.95rem;
  vertical-align: top;
}

.theory-table tr:last-child td {
  border-bottom: none;
}

.theory-table tr:hover td {
  background: rgba(13, 148, 136, 0.02);
}

.use-case-card {
  border-left: 5px solid var(--secondary-color);
  padding: 1.25rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 0 16px 16px 0;
  margin-top: 1.5rem;
}

.use-case-card strong {
  color: var(--secondary-color);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dist-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.dist-badge.poisson {
  background: #dcfce7;
  color: #166534;
}

.dist-badge.expo {
  background: #fef9c3;
  color: #854d0e;
}

.dist-badge.det {
  background: #e0f2fe;
  color: #075985;
}

.dist-badge.fifo {
  background: #dbeafe;
  color: #1e40af;
}

.dist-badge.np {
  background: #fef3c7;
  color: #92400e;
}

.dist-badge.pr {
  background: #fee2e2;
  color: #b91c1c;
}

.highlight-box {
  background: #f1f5f9;
  padding: 2rem;
  border-radius: 16px;
  margin: 2rem 0;
  border: 1px solid #e2e8f0;
}

.highlight-box h4 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.success-toast {
  border-left-color: #10b981;
}

.success-toast .icon {
  background-color: #d1fae5;
  color: #10b981;
}

.error-toast .icon {
  background-color: #fee2e2;
  color: var(--dropped-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.error-toast .message {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Ad Integration Styles */
.ad-container {
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  min-height: 120px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px dashed var(--primary-light);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.ad-container::before {
  content: 'Sponsored Advertisement';
  position: absolute;
  top: 5px;
  left: 10px;
  font-size: 0.65rem;
  color: var(--light-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

.ad-placeholder-text {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.8;
  text-align: center;
  padding: 1rem;
}

.ad-container:hover {
  border-style: solid;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.9);
}

.ad-top-banner {
  margin-top: 1.5rem;
  margin-bottom: 0;
  border-radius: 12px;
  border-top: 1px dashed var(--primary-light);
}

@media (max-width: 768px) {
  .ad-container {
    min-height: 250px;
    margin: 1.5rem auto;
  }
}

/* Native Ad Card Styles */
.ad-card {
  min-height: 350px;
  background: white;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transition: all 0.3s ease;
  text-align: center;
}

.ad-card .ad-placeholder-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  background: #fafafa;
  margin-top: 1rem;
  width: 100%;
}

.ad-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.ad-card::before {
  content: 'Sponsored Content';
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--light-text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ad-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: #555;
  font-weight: 500;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Privacy Policy Styles */
.privacy-container {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 3rem;
  margin: 2rem auto;
  max-width: 900px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.privacy-banner {
  text-align: center;
  margin-bottom: 4rem;
  padding: 3rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 20px;
}

.privacy-banner h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.privacy-section {
  margin-bottom: 3.5rem;
}

.privacy-section h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.privacy-section h2::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--primary-light);
  opacity: 0.3;
}

.privacy-section p,
.privacy-section li {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-color);
}

.privacy-section ul {
  list-style-type: none;
  padding-left: 0;
}

.privacy-section ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.privacy-section ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

@media (max-width: 768px) {
  .privacy-container {
    padding: 1.5rem;
  }

  .privacy-banner h1 {
    font-size: 2rem;
  }
}