/* Root variables */
:root {
  --bg-light: #fafafa;
  --bg-dark: #121212;
  --text-light: #111;
  --text-dark: #eee;
  --footer-bg: #333;
  --footer-text: #ddd;
  --highlight-color: #4caf50;
  --table-header-light: #f4f4f4;
  --table-row-odd-light: #f9f9f9;
  --table-header-dark: #2a2a2a;
  --table-row-odd-dark: #1e1e1e;
  --table-row-even-dark: #2a2a2a;
}

/* Base styles */
html,
body {
  margin: 0;
  padding: 0;
  font-family: "Roboto Flex";
  line-height: 1.6;
  background: var(--bg-light);
  color: var(--text-light);
  transition: background 0.3s, color 0.3s;
}

.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

/* Header */
header {
  padding: 1rem;
  background: var(--highlight-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Navigation */
nav a {
  margin: 0 0.5rem;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: white;
  transition: background 0.2s;
}
nav a:hover {
  background-color: var(--highlight-color);
  color: #fff;
}

/* Section padding */
section {
  padding: 1rem;
}

/* Fortune Generator */
.fortune-box {
  margin: 1rem auto;
  padding: 1rem;
  max-width: 400px;
  border: 2px solid #333;
  text-align: center;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.fortune-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.fortune-controls .btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background: var(--highlight-color);
  color: white;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
}
.fortune-controls .btn:hover {
  transform: scale(1.05);
  background: #45a049;
}

/* Stopwatch */
#timer-display {
  font-size: 2rem;
  text-align: center;
  margin: 1rem;
}
.stopwatch-controls {
  text-align: center;
}

/* To-Do List */
#todo-input {
  padding: 0.5rem;
  width: calc(100% - 120px);
}
#todo-list {
  list-style: none;
  padding: 0;
}
#todo-list li {
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
}

/* Profile image */
.profile-pic {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  transition: transform 0.3s;
}
.profile-pic:hover {
  transform: scale(1.1);
}

/* External image styling */
.external-img {
  display: block;
  margin: 1rem auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  background: var(--table-header-light);
}
tbody tr:nth-child(odd) {
  background: var(--table-row-odd-light);
}
table,
th,
td {
  border: 1px solid #ddd;
}
table th,
table td {
  padding: 0.5rem;
}
table tbody tr:hover {
  background: rgba(76, 175, 80, 0.1);
}

/* Dark mode table overrides */
.dark thead {
  background: var(--table-header-dark);
}
.dark tbody tr:nth-child(odd) {
  background: var(--table-row-odd-dark);
}
.dark tbody tr:nth-child(even) {
  background: var(--table-row-even-dark);
}

/* Responsive table */
@media (max-width: 600px) {
  nav {
    display: flex;
    flex-direction: column;
  }
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }
  th {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  td {
    border: none;
    position: relative;
    padding-left: 50%;
  }
  td:before {
    position: absolute;
    left: 0;
    width: 45%;
    white-space: nowrap;
    font-weight: bold;
  }
  td:nth-of-type(1):before {
    content: "Course";
  }
  td:nth-of-type(2):before {
    content: "Description";
  }
  td:nth-of-type(3):before {
    content: "Credits";
  }
}

/* Contact form */
.contact-form {
  max-width: 400px;
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
}
.contact-form label {
  margin-bottom: 0.5rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Button animation */
.btn-animated {
  margin-top: 1rem;
  padding: 0.6rem;
  border: none;
  border-radius: 4px;
  background: var(--highlight-color);
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}
.btn-animated:hover {
  transform: scale(1.05);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.fade-in {
  animation: fadeIn 1s ease-in forwards;
  opacity: 0;
}
.delay {
  animation-delay: 0.5s;
}
.delay2 {
  animation-delay: 1s;
}
.delay3 {
  animation-delay: 1.5s;
}
.delay4 {
  animation-delay: 2s;
}
.slide-in {
  animation: slideIn 0.8s ease-out forwards;
  opacity: 0;
}

/* Footer */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
}
