:root {
  /* BIS Theme Colors - matching the logo */
  --bis-primary: #1e3a5f;
  --bis-secondary: #2c5282;
  --bis-accent: #4a9eff;
  --bis-light: #63b3ed;
  --bis-dark: #0f2744;
  --bis-gradient-start: #1a365d;
  --bis-gradient-end: #2563eb;

  /* UI Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #1a202c;
  --text-secondary: #64748b;
  --border: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(
    135deg,
    var(--bis-gradient-start) 0%,
    var(--bis-gradient-end) 100%
  );
  min-height: 100vh;
  padding: 2rem 1rem 4rem 1rem;
  color: var(--text-primary);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(74, 158, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(99, 179, 237, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.6s ease-out;
}

.logo-container {
  margin-bottom: 1.5rem;
  animation: logoFloat 3s ease-in-out infinite;
}

.logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.5px;
}

.header p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.main-card {
  background: var(--bg-card);
  border-radius: 28px;
  box-shadow: var(--shadow-2xl);
  padding: 2.5rem;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.selection-section {
  background: linear-gradient(
    135deg,
    var(--bis-primary) 0%,
    var(--bis-secondary) 100%
  );
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  color: white;
  box-shadow: var(--shadow-lg);
}

.selection-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: -0.3px;
}

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

.selection-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.selection-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.selection-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  opacity: 0.95;
  letter-spacing: 0.3px;
}

.cumulative-section {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  color: white;
  box-shadow: var(--shadow-lg);
}

.cumulative-title {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.cumulative-desc {
  text-align: center;
  opacity: 0.95;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.cumulative-input-group {
  display: flex;
  gap: 1rem;
  max-width: 550px;
  margin: 0 auto;
  align-items: flex-end;
}

.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 14px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.3px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--bis-accent) 0%,
    var(--bis-light) 100%
  );
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
  color: white;
}

.btn-secondary {
  background: linear-gradient(
    135deg,
    var(--bis-dark) 0%,
    var(--bis-primary) 100%
  );
  color: white;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.courses-table {
  width: 100%;
  margin-bottom: 2rem;
}

.table-header {
  display: grid;
  grid-template-columns: 60px 100px 2fr 1fr 140px;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(
    135deg,
    var(--bis-primary) 0%,
    var(--bis-secondary) 100%
  );
  color: white;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-md);
}

.section-header {
  padding: 1rem 1.5rem;
  border-radius: 14px;
  margin: 1.5rem 0 0.75rem 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: white;
  box-shadow: var(--shadow-sm);
}

.core-header {
  background: linear-gradient(
    135deg,
    var(--bis-accent) 0%,
    var(--bis-light) 100%
  );
}

.elective-header {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
}

.course-row {
  display: grid;
  grid-template-columns: 60px 100px 2fr 1fr 140px;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-main);
  border-radius: 14px;
  margin-bottom: 0.5rem;
  align-items: center;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease-out;
  border: 1px solid var(--border);
}

.course-row:hover {
  background: white;
  transform: translateX(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--bis-light);
}

.row-number {
  width: 44px;
  height: 44px;
  background: linear-gradient(
    135deg,
    var(--bis-accent) 0%,
    var(--bis-light) 100%
  );
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.course-code {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--bis-primary);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.course-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.course-hours {
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: white;
  font-weight: 500;
}

.form-control:focus {
  outline: none;
  border-color: var(--bis-accent);
  box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.12);
}

select.form-control {
  cursor: pointer;
}

.results-section {
  background: linear-gradient(
    135deg,
    var(--bis-primary) 0%,
    var(--bis-secondary) 100%
  );
  border-radius: 24px;
  padding: 2.5rem;
  color: white;
  margin-top: 2rem;
  animation: fadeInUp 0.6s ease-out 0.2s both;
  box-shadow: var(--shadow-2xl);
}

.results-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.result-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.result-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.result-label {
  font-size: 0.95rem;
  opacity: 0.95;
  margin-bottom: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.result-value {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -1px;
}

.rating-card {
  background: rgba(255, 255, 255, 0.97);
  color: var(--text-primary);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.rating-badge {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 60px;
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 0.75rem;
  animation: pulse 2s infinite;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-md);
}

.rating-excellent {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: white;
}

.rating-very-good {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: white;
}

.rating-good {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: white;
}

.rating-pass {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: white;
}

.rating-weak {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  color: white;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 1.05rem;
  font-weight: 500;
}

.download-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  justify-content: center;
}

.footer {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--bis-accent),
    transparent
  );
  margin: 1.5rem auto;
  border-radius: 2px;
}

.footer-text {
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.footer-social {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.social-icon {
  width: 24px;
  height: 24px;
}

.elective-badge {
  color: var(--success);
  font-weight: 600;
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}


/* Navigation Buttons - Desktop & Mobile */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 0.875rem 1.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--bis-primary);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: white;
}

@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem 3rem 0.5rem;
  }

  .logo {
    width: 80px;
    height: 80px;
  }

  .header h1 {
    font-size: 1.75rem;
  }

  .header p {
    font-size: 0.9rem;
  }

  .main-card {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .selection-section,
  .cumulative-section {
    padding: 1.5rem 1rem;
    border-radius: 18px;
  }

  .selection-title,
  .cumulative-title {
    font-size: 1.2rem;
  }

  .cumulative-desc {
    font-size: 0.85rem;
  }

  .cumulative-input-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cumulative-input-group > div:first-child {
    width: 100%;
  }

  .cumulative-input-group button {
    width: 100%;
  }

  .selection-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .selection-card {
    padding: 1.25rem;
  }
  .controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .controls .btn {
    width: 100%;
    justify-content: center;
  }

  /* Mobile-optimized table layout */
  .table-header {
    display: none; /* Hide header on mobile */
  }

  .section-header {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    margin: 1rem 0 0.5rem 0;
  }

  .course-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
  }

  .row-number {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
    align-self: flex-start;
  }

  .course-code {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bis-accent);
  }

  .course-name {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
  }

  .course-hours {
    display: inline-block;
    font-size: 0.8rem;
    background: var(--bis-light);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    align-self: flex-start;
  }

  /* Stack course info vertically */
  .course-row > div {
    width: 100%;
  }

  .form-control {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  .results-section {
    padding: 1.75rem 1.25rem;
    border-radius: 20px;
  }

  .results-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .result-card {
    padding: 1.5rem;
  }

  .result-label {
    font-size: 0.9rem;
  }

  .result-value {
    font-size: 1.75rem;
  }

  .rating-card {
    padding: 1.5rem;
  }

  .rating-badge {
    font-size: 1.25rem;
    padding: 0.75rem 1.75rem;
  }

  .download-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .download-actions .btn {
    width: 100%;
  }

  .footer {
    padding: 1.5rem 1rem;
    margin-top: 2rem;
  }

  .footer-text {
    font-size: 0.9rem;
  }

  .footer-social {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  .social-link {
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }

  .social-icon {
    width: 20px;
    height: 20px;
  }

  .empty-state {
    padding: 2.5rem 1.5rem;
  }

  .empty-state svg {
    width: 70px;
    height: 70px;
  }

  .empty-state p {
    font-size: 0.95rem;
  }

  .elective-badge {
    font-size: 0.8rem;
    display: block;
    margin-top: 0.25rem;
    margin-left: 0;
  }
}
