/* MPHY 6120 - AI for Medicine - Dark Penn Theme */

/* ============================================
   COLOR PALETTE (Penn-inspired for dark theme)
   ============================================
   Penn Blue (official):  #011F5B
   Penn Red (official):   #990000
   
   Dark theme adaptations:
   Background:       #0d1117
   Surface/Cards:    #161b22
   Borders:          #30363d
   Primary text:     #c9d1d9
   Secondary text:   #8b949e
   Penn Blue Light:  #4a90d9 (links, accents)
   Penn Blue Hover:  #6ba3e3
   Penn Red Light:   #d64545 (warnings, due dates)
   Headers:          #f0f6fc
   ============================================ */

/* Base Theme */
body {
  padding-top: 70px;
  background-color: #0d1117 !important;
  color: #c9d1d9 !important;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Global smooth transitions */
*, *::before, *::after {
  transition: background-color 0.2s ease, color 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

/* Main container */
.container {
  background-color: transparent;
}

/* Links - Penn Blue Light */
a {
  color: #4a90d9;
}

a:hover, a:focus {
  color: #6ba3e3;
  text-decoration: none;
}

/* Headings - EB Garamond (Penn standard) */
h1, h2, h3, h4, h5, h6 {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  color: #f0f6fc;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.5rem;
  font-weight: 500;
}

h2 {
  border-bottom: 2px solid #4a90d9;
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.9rem;
}

h3 {
  color: #4a90d9;
  margin-top: 1.5rem;
  font-size: 1.4rem;
}

/* Paragraphs and text */
p, li, dd, dt {
  color: #c9d1d9;
}

strong, b {
  color: #f0f6fc;
}

em, i {
  color: #8b949e;
}

/* Definition Lists (Course Info section) */
dl {
  margin-bottom: 1rem;
}

dt {
  font-weight: 600;
  color: #4a90d9;
  margin-top: 0.75rem;
}

dd {
  margin-left: 0;
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  color: #c9d1d9;
}

/* Horizontal rules */
hr {
  border-color: #30363d;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */

.navbar, .navbar-default {
  background-color: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar-brand, .navbar-nav > li > a {
  color: #c9d1d9 !important;
}

.navbar-brand:hover, .navbar-nav > li > a:hover {
  color: #4a90d9 !important;
}

.navbar-nav > li.active > a {
  color: #4a90d9 !important;
  background-color: transparent !important;
}

/* Dropdown menus */
.dropdown-menu {
  background-color: #161b22;
  border: 1px solid #30363d;
}

.dropdown-menu > li > a {
  color: #c9d1d9;
}

.dropdown-menu > li > a:hover {
  background-color: #21262d;
  color: #4a90d9;
}

/* ============================================
   ALERT BOXES (Outlined Style)
   ============================================ */

/* Reset all Bootstrap alerts */
.alert {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 8px !important;
  color: #c9d1d9 !important;
  padding: 1.25rem !important;
  margin-bottom: 1.5rem;
}

/* Warning alert - Field Guide Mindset (Penn Red accent) */
.alert-warning {
  border-color: #d64545 !important;
  border-left: 4px solid #d64545 !important;
}

.alert-warning strong {
  color: #d64545 !important;
}

/* Info alert - Course Logistics (Penn Blue) */
.alert-info {
  border-color: #4a90d9 !important;
  border-left: 4px solid #4a90d9 !important;
}

.alert-info strong {
  color: #4a90d9 !important;
}

/* Success alert - Prerequisites (green tint) */
.alert-success {
  border-color: #3fb950 !important;
  border-left: 4px solid #3fb950 !important;
}

.alert-success strong {
  color: #3fb950 !important;
}

/* Custom green box (Welcome section) */
div[style*="background-color: #d4edda"] {
  background-color: #161b22 !important;
  color: #c9d1d9 !important;
  border: 1px solid #3fb950 !important;
  border-left: 4px solid #3fb950 !important;
  border-radius: 8px !important;
}

div[style*="background-color: #d4edda"] strong {
  color: #3fb950 !important;
}

div[style*="background-color: #d4edda"] li {
  color: #c9d1d9 !important;
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
}

table th {
  background-color: #21262d;
  color: #f0f6fc;
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
  border-bottom: 2px solid #4a90d9;
}

table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #30363d;
  color: #c9d1d9;
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover {
  background-color: #21262d;
}

/* Grade Scale Table - compact width */
h3 + table {
  max-width: 300px;
}

/* ============================================
   SCHEDULE TABLE (Override Bootstrap striping)
   ============================================ */

/* Force ALL table rows to dark background - override Bootstrap completely */
.table-striped > tbody > tr:nth-of-type(odd),
.table-striped > tbody > tr:nth-of-type(even),
.table-striped tbody tr,
.table > tbody > tr,
table tbody tr {
  background-color: #161b22 !important;
  background: #161b22 !important;
}

/* Subtle alternating rows - slightly different shade for odd rows */
.table-striped > tbody > tr:nth-of-type(odd),
.table-striped tbody tr:nth-child(odd) {
  background-color: #1c2128 !important;
  background: #1c2128 !important;
}

/* All table cells get proper text color */
.table > tbody > tr > td,
.table > thead > tr > th,
.table-striped > tbody > tr > td,
table tbody tr td,
table td {
  color: #c9d1d9 !important;
  border-color: #30363d !important;
  background-color: inherit !important;
  background: inherit !important;
}

/* Override alert classes used in schedule cells */
td.alert,
td.alert-info,
td.alert-success,
td.alert-danger,
td.alert-warning {
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  padding: 0.6rem 0.75rem !important;
}

/* Alert-info cells (quizzes) - subtle blue tint */
tr:has(td.alert-info),
tr td.alert-info {
  color: #58a6ff !important;
}

/* Alert-success cells (homework due) - subtle green */
tr:has(td.alert-success),
tr td.alert-success {
  color: #3fb950 !important;
}

/* Alert-danger cells (exams) - subtle red */
tr:has(td.alert-danger),
tr td.alert-danger {
  color: #f85149 !important;
}

/* Hover state for schedule rows */
.table-striped > tbody > tr:hover,
.table > tbody > tr:hover,
table tbody tr:hover {
  background-color: #21262d !important;
  background: #21262d !important;
}

/* Table header styling */
.table > thead > tr > th,
table thead tr th {
  background-color: #21262d !important;
  background: #21262d !important;
  color: #f0f6fc !important;
  border-bottom: 2px solid #4a90d9 !important;
  font-weight: 600;
}

/* Table borders */
.table,
.table-striped,
table {
  border-color: #30363d !important;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > thead > tr > th {
  border-top-color: #30363d !important;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

blockquote {
  background-color: #161b22;
  border-left: 4px solid #4a90d9;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  color: #c9d1d9;
}

blockquote strong {
  color: #4a90d9;
}

blockquote em, blockquote i {
  color: #c9d1d9;
  font-style: italic;
}

/* ============================================
   LISTS
   ============================================ */

ul, ol {
  color: #c9d1d9;
}

li {
  margin-bottom: 0.25rem;
}

/* ============================================
   CODE BLOCKS
   ============================================ */

code, pre {
  background-color: #161b22;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 4px;
}

code {
  padding: 0.2rem 0.4rem;
}

pre {
  padding: 1rem;
}

/* ============================================
   IMAGES
   ============================================ */

img {
  border-radius: 8px;
}

.img-rounded {
  border-radius: 8px;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #30363d;
  color: #8b949e;
  font-size: 0.9rem;
  text-align: center;
}

footer a {
  color: #4a90d9;
}

/* ============================================
   STAFF PAGE FLIP CARDS
   ============================================ */

.flip-card {
  background-color: transparent;
  border: 1px solid #30363d !important;
  border-radius: 8px;
}

.flip-card-front, .flip-card-back {
  background-color: #161b22 !important;
  border-radius: 8px;
}

/* ============================================
   MISC BOOTSTRAP OVERRIDES
   ============================================ */

.well {
  background-color: #161b22;
  border: 1px solid #30363d;
}

.panel {
  background-color: #161b22;
  border: 1px solid #30363d;
}

.panel-heading {
  background-color: #21262d;
  border-color: #30363d;
  color: #f0f6fc;
}

.panel-body {
  color: #c9d1d9;
}

/* Form controls */
.form-control {
  background-color: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
}

.form-control:focus {
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

/* Buttons */
.btn-default {
  background-color: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}

.btn-default:hover {
  background-color: #30363d;
  color: #f0f6fc;
}

.btn-primary {
  background-color: #4a90d9;
  border-color: #4a90d9;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #6ba3e3;
  border-color: #6ba3e3;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .navbar-collapse {
    background-color: #161b22;
    border-top: 1px solid #30363d;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  h3 + table {
    max-width: 100%;
  }
}

/* ============================================
   SELECTION HIGHLIGHT
   ============================================ */

::selection {
  background-color: #4a90d9;
  color: #ffffff;
}

::-moz-selection {
  background-color: #4a90d9;
  color: #ffffff;
}
