/* Reset some default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #F5F5F5;
  color: #333;
  padding: 20px;
}

header {
  background-color: #005EB8;
  color: white;
  padding: 20px;
  border-radius: 8px;
}

.header-content { 
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  height: 100px;
  width: auto;
  border: 1px solid white; 
  border-radius: 6px;
  background-color: white; 
  padding: 2px;      
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
}

p {
  margin: 20px 0;
}

h3 {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  font-size: 1.5rem;
}

h2 {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 4px solid #ddd;
  font-size: 1.5rem;
}

nav a {
  text-decoration: none;
  color: #005EB8;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
}

nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 80%;
  margin: 0 auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

section {
  margin-bottom: 40px;
}

h2 {
  color: #0077cc;
  margin-bottom: 10px;
}

h3 {
  margin-top: 20px;
  margin-bottom: 20px;
  color: #005fa3;
}

pre {
  background: #efefef;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.9em;
  color: #666;
}

.function-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.function-box {
  flex: 1 1 calc(33.33% - 20px); 
  box-sizing: border-box;

  padding: 10px;
  border-radius: 8px;
  background-color: white;
  transition: box-shadow 0.3s ease;
}

.function-box:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.function-box button.function-toggle {
  display: block;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .example-card {
    flex: 1 1 calc(50% - 20px);
  }
}

@media (max-width: 600px) {
  .example-card {
    flex: 1 1 100%;
  }
}

.function-toggle {
  background-color: #005EB8;
  color: white;
  padding: 10px 15px;
  width: auto; 
  max-width: 400px;
  display: block;
  text-align: left;
  border: 1px solid #cce0f5;
  border: 1px solid #cce0f5;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.function-toggle .icon {
  height: 20px;
  width: auto;
  margin-right: 10px;
  vertical-align: middle;
  background-color: white;
  border-radius: 3px; 
}

.function-toggle:hover {
  background-color: #004999;
}

.function-details {
  display: none;
  padding: 15px 20px;
  border-top: 1px solid #ccc;
  background-color: white;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; 
  height: 0;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.function-toggle .icon {
  height: 20px;
  width: auto;
  margin-right: 10px;
  vertical-align: middle;
}

.example-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  margin-top: 20px;
}

.example-card {
  flex: 1 1 calc(33.33% - 20px);
  height: 180px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.example-card:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.example-text {
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  padding: 10px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
}

.split-container {
  display: flex;
  gap: 2rem;
  min-height: 300px; 
}

.right-half {
  display: flex;
  justify-content: center;  
  align-items: center;     
  flex: 1;                 
}

.example-image {
  height: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
}

pre {
  background: #efefef;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  max-width: fit-content; 
  margin: 20px auto;       
}

.fraction-block {
  display: block;
  width: fit-content;
  margin: 20px auto;
  font-family: monospace;
  font-size: 1.1em;
  line-height: 1.4;
  user-select: text;
  text-align: center; 
}

.fraction-block .numerator,
.fraction-block .denominator {
  padding: 2px 10px;
}

.fraction-block .fraction-line {
  border-top: 2px solid #000;
  width: 100%;
  margin: 2px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: 'Segoe UI', sans-serif;
}

thead th {
  background-color: #005EB8;
  color: white;
  padding: 10px;
  text-align: left;
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid #ccc;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}