/* Clean and minimal CSS for academic website */
:root {
  --primary: #A54918;
  --primary-dark: #7a3512;
  --primary-light: #c65e2a;
  --text: #2c3e50;
  --text-light: #6c757d;
  --bg-light: #fdf9f7;
  --border: #f0e5df;
  --success: #28a745;
  --success-bg: #d4edda;
  --accent: #d4763b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  border-top: 4px solid var(--primary);
  box-shadow: 0 2px 8px rgba(165, 73, 24, 0.2);
}

.header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 400;
  color: white;
}

.header p {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.95;
  color: white;
}

/* Navigation */
.navbar {
  background: white;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar a {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  padding: 1rem 1.5rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.navbar a:hover {
  color: var(--primary);
  background: var(--bg-light);
}

.navbar a.active {
  background: var(--primary);
  color: white;
  border-bottom: 3px solid var(--primary-dark);
}

/* Main Content */
main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(165, 73, 24, 0.1);
  border-top: 3px solid var(--primary);
}

h1 {
  color: var(--text);
  margin: 0 0 1.5rem 0;
  font-size: 1.8rem;
  font-weight: 600;
}

h2 {
  color: var(--text);
  margin: 2.5rem 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

h3 {
  color: var(--primary);
  margin: 2rem 0 1rem 0;
  font-size: 1.2rem;
  font-weight: 600;
}

h4 {
  color: var(--text);
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 500;
}

p {
  margin: 0 0 1rem 0;
  line-height: 1.7;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Definition Lists (Contact Info) */
dl {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 6px;
  margin: 1.5rem 0;
  border-left: 4px solid var(--primary);
}

dt {
  font-weight: 600;
  color: var(--primary);
  margin-top: 1rem;
}

dt:first-child {
  margin-top: 0;
}

dd {
  margin: 0.25rem 0 0 0;
  color: var(--text);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

tr:nth-child(even) {
  background: var(--bg-light);
}

tr:hover {
  background: #fff3ed;
}

td:nth-child(n+4) {
  text-align: right;
  font-family: monospace;
}

/* Optimal solution highlighting */
.optimal-solution {
  background: var(--success-bg) !important;
  border-left: 4px solid var(--success);
}

.optimal-solution td {
  color: #155724;
}

.gap-optimal {
  background: var(--success) !important;
  color: white !important;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Buttons */
button {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1rem 0.5rem 0.5rem 0;
  transition: all 0.2s;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Horizontal Rule */
hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    margin: 1rem;
    padding: 1.5rem;
  }

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

  .navbar a {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .navbar a {
    display: block;
    border-bottom: 1px solid var(--border);
  }

  main {
    margin: 0.5rem;
    padding: 1rem;
  }
}
