/* Root Variables for Light and Dark Mode */
:root {
  --light-bg-color: #f5f5f5;
  --dark-bg-color: #121212;
  --text-color: #333;
  --light-button-bg: #007bff;
  --dark-button-bg: #007bff;
  --button-hover-bg: #007bff;
  --header-bg: #007bff;
  --dark-header-bg: #1a5676;
  --container-bg: #ffffff;
  --dark-container-bg: #333;
  --profile-border: #007bff;
}

/* General Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--light-bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 80px;
  transition: background-color 0.3s, color 0.3s;
  box-sizing: border-box;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--header-bg);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

header h1 {
  margin: 0;
  font-size: 24px;
}

/* Position the dark mode toggle button on the left */
#darkModeToggle {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(65%);
}

.dark-mode-button {
  background-color: var(--light-button-bg);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 24px;
}

.dark-mode-button:hover {
  background-color: var(--button-hover-bg);
}

.dark-mode-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--light-button-bg);
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: var(--light-button-bg);
  color: white;
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dropbtn:hover {
  background-color: var(--button-hover-bg);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 40;
  background-color: #f9f9f9;
  min-width: 160px;
  z-index: 1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #ddd;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Fix for small screens: ensure the dropdown fits on mobile devices */
@media (max-width: 768px) {
  .dropdown-content {
    min-width: 100%; /* Allow dropdown to expand fully on mobile */
    left: 10; /* Ensure it aligns with the button */
  }
}

@media (max-width: 480px) {
  .dropdown-content {
    min-width: 100%; /* Allow full width on very small screens */
    left: 0; /* Ensure it aligns with the button */
  }
}

/* Navigation Links */
nav a {
  color: white;
  margin-left: 20px;
  text-decoration: none;
  font-size: 16px;
}

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

.container {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  padding: 20px;
  background: var(--container-bg);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-top: 80px;
  transition: background-color 0.3s, color 0.3s;
  box-sizing: border-box;
}

textarea {
  width: 100%;
  max-width: 100%;
  height: 150px;
  padding: 10px;
  border: 2px solid #ddd;
  background-color: transparent;
  resize: none;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea:focus {
  border-color: #007bff;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
  outline: none;
}

/* Button Styles */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.buttons button {
  margin: 5px;
  padding: 10px 20px;
  background-color: var(--light-button-bg);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.buttons button:hover {
  background-color: var(--button-hover-bg);
}

/* Footer Styling */
footer {
  text-align: center;
  background-color: var(--light-bg-color);
  color: var(--text-color);
  padding: 10px 0;
  margin-top: auto;
}

footer a {
  color: var(--light-button-bg);
}

/* Dark Mode Styling */
body.dark-mode {
  background-color: var(--dark-bg-color);
  color: white;
}

body.dark-mode .container {
  background-color: var(--dark-container-bg);
}

body.dark-mode button {
  background-color: var(--dark-button-bg);
}

/* Profile Section Styles */
.profile {
  text-align: center;
  padding: 20px;
}

.profile img {
  border-radius: 50%;
  width: 150px;
  height: 150px;
}

.countdown {
  font-size: 20px;
  font-weight: bold;
  color: #ff6347;
}

/* Responsive Design */
@media (max-width: 1200px) {
  header {
    padding: 15px;
  }

  nav a {
    font-size: 14px;
    margin-left: 10px;
  }

  .buttons button {
    padding: 8px 16px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }

  header h1 {
    font-size: 20px;
  }

  .container {
    margin-top: 60px;
    padding: 15px;
  }

  textarea {
    height: 120px;
  }

  .buttons button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  nav a {
    font-size: 14px;
    margin-left: 15px;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 50px;
  }

  header h1 {
    font-size: 18px;
  }

  nav {
    display: flex;
    flex-direction: column;
  }

  .buttons button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  .dropdown-content a {
    font-size: 14px;
  }
}
