@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom styles can go here */

/* Example of additional styles */
body {
  @apply bg-gray-900 text-gray-300; /* Dark background with less bright text */
  background-color: #000000; /* Pure black background */
  max-width: 800px;
  margin: 3em auto;
  padding: 0 1em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #D8D8D8;
  scroll-behavior: smooth; /* Enable smooth scrolling */
}

::selection {
  background-color: rgba(59, 130, 246, 0.5); /* blue-500 with opacity */
  color: white;
}

.dark body {
  @apply bg-gray-900 text-gray-100; /* Dark mode styles */
  background-color: #000000; /* Pure black background */
  color: #D8D8D8; /* Light gray text color as requested */
}

h1 {
  color: #228B22; /* Forest Green for H1 */
  font-size: 2.5em;
  margin-bottom: 0.5em;
}

h2 {
  color: #2E8B57; /* Sea Green for H2 */
  font-size: 2em;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

h3 {
  color: #3CB371; /* Medium Sea Green for H3 */
  font-size: 1.75em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h4 {
  color: #4CAF50; /* Green for H4 */
  font-size: 1.4em;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 500;
}

h3 strong, h4 strong, h5 strong {
  font-weight: 500;
}

/* Dark mode styles for headings */
.dark h1 {
  color: #228B22; /* Forest Green for H1 in dark mode */
}

.dark h2 {
  color: #2E8B57; /* Sea Green for H2 in dark mode */
}

.dark h3 {
  color: #3CB371; /* Medium Sea Green for H3 in dark mode */
}

.dark h4 {
  color: #4CAF50; /* Green for H4 in dark mode */
}

/* Improve paragraph readability in dark mode */
.dark p, .dark li {
  color: #D8D8D8;
  line-height: 1.6;
}


/* Post content */
.content {
  letter-spacing: 0.01em;
}

/* Links */
a {
  color: #4CAF50; /* Normal link color */
  text-decoration: none;
  border-bottom: 1px solid transparent; /* Transparent border by default */
  transition: color 0.3s, border-color 0.2s; /* Smooth transition for hover effect */
}

.dark a {
  color: #4CAF50; /* Normal link color in dark mode */
  border-bottom: 1px solid transparent; /* Transparent border for dark mode */
}

a:visited {
  color: #388E3C; /* Visited link color */
}

a:hover {
  color: #66BB6A; /* Hover link color */
  border-bottom: 1px solid #0070f3; /* Show border on hover */
}

/* Post list */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 0.5em 0;
  transition: transform 0.2s ease;
  margin-bottom: 0.25em;
}

.post-list li:hover {
  transform: translateX(5px);
}

.post-list li a {
  display: block;
  font-size: 1.1em;
  padding: 0.3em 0;
  /* border-bottom: none; */
  border-bottom: 2px solid rgba(76, 175, 80, 0.2);
  width: max-content;
  padding-right: 1rem;
  line-height: 1.2;
  font-weight: 300;
}
.post-list li a:hover {
  border-bottom: 2px solid rgba(76, 175, 80, 0.5);
}

.post-list li.view-all {
  margin-top: 2em;
  text-align: center;
  font-size: 0.9em;
  border-bottom: none;
}

.post-list li.view-all a {
  color: #4CAF50;
  padding: 0.3em 0.5em;
  transition: all 0.2s ease;
  display: inline;
}

.post-list li.view-all a:hover {
  border-bottom: 1px solid #66BB6A;
  color: #66BB6A;
}

/* All posts page specific styles */
.all-posts li {
  padding: 0.7em 0;
}

time {
  color: #666;
  margin-right: 1em;
}

.dark time {
  color: #A0A0A0; /* Lighter gray for time in dark mode */
}

/* Navigation */
nav {
  margin: 2em 0;
  display: flex; /* Flexbox for navigation */
  justify-content: center; /* Center navigation items */
  margin-bottom: 2em; /* Space below navigation */
}

nav a {
  margin: 0 1em; /* Space between navigation links */
  color: #0070f3; /* Link color */
  border-bottom: 1px solid transparent; /* Transparent border by default to maintain spacing */
}

nav a:hover {
  border-bottom: 1px solid #0070f3; /* Show border on hover */
}

/* Tags */
.tags {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid #ddd;
}

.tag {
  color: #0070f3;
  margin-right: 1em;
}

/* Footer */
footer {
  margin-top: 3em;
  border-top: 1px solid #ddd;
  padding-top: 1em;
  color: #666;
}

.dark footer {
  border-top: 1px solid #333;
  color: #A0A0A0; /* Lighter gray for footer in dark mode */
}

/* Add styles for sections */
header {
  text-align: center; /* Center the header text */
  margin-bottom: 2em; /* Space below the header */
}

section {
  margin-bottom: 3em; /* Space between sections */
}

html {
  scroll-behavior: smooth; /* Enable smooth scrolling */
  scroll-padding-top: 2rem; /* Add padding for anchors */
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    margin: 1.5em auto;
    padding: 0 15px;
  }
  
  h1 {
    font-size: 2em;
  }
  
  h2 {
    font-size: 1.5em;
  }
  
  nav {
    flex-direction: column;
    align-items: center;
  }
  
  nav a {
    margin: 0.5em 0;
  }
}

/* Dark mode toggle */
.theme-toggle {
  position: fixed;
  bottom: 1em;
  right: 1em;
  background: rgba(0,0,0,0.2);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Print styles */
@media print {
  body {
    font-size: 12pt;
    color: black;
    background: white;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .theme-toggle {
    display: none;
  }
}

/* Top left home link */
.home-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.home-link a {
  display: block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: rgba(76, 175, 80, 0.2); /* More visible background */
  border-radius: 50%;
  font-size: 1.5em;
  transition: all 0.2s ease;
  border-bottom: none; /* Remove underline */
}

.dark .home-link a {
  background-color: rgba(76, 175, 80, 0.3); /* More visible in dark mode */
  color: white;
}

.home-link a:hover {
  background-color: #4CAF50;
  color: white;
  transform: translateX(3px); /* Move right on hover */
}

/* Hide the home link on mobile */
@media (max-width: 768px) {
  .home-link {
    display: none;
  }
}

/* Hide the back link in footer on desktop */
@media (min-width: 769px) {
  footer .back-link {
    display: none;
  }
}

/* Contact Form Styles */
.contact-form {
  margin: 2em 0;
}

.contact-intro {
  margin-bottom: 1.5em;
  font-size: 0.95em;
  line-height: 1.5;
  color: #388E3C;
  padding: 0.5em;
  border-radius: 4px;
  background-color: rgba(76, 175, 80, 0.1);
}

.dark .contact-intro {
  color: #66BB6A;
  background-color: rgba(76, 175, 80, 0.15);
}

.form-group {
  margin-bottom: 1.5em;
}

.form-group label {
  display: block;
  margin-bottom: 0.5em;
  font-weight: 500;
  font-size: 0.95em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  background-color: #fff;
  color: #333;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.dark .form-group input,
.dark .form-group textarea {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.character-count {
  font-size: 0.8em;
  margin-top: 0.5em;
  color: #666;
}

.dark .character-count {
  color: #94a3b8;
}

.character-count .valid {
  color: #4CAF50;
}

.character-count .invalid {
  color: #f44336;
}

.submit-button {
  background-color: #4CAF50;
  color: white;
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 4px;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-button:hover {
  background-color: #45a049;
}

/* Form submission feedback */
.submit-feedback {
  margin: 1em 0;
  padding: 0.5em;
  background-color: rgba(76, 175, 80, 0.1);
  border-radius: 4px;
  text-align: center;
  font-size: 0.9em;
  color: #4CAF50;
}

.dark .submit-feedback {
  background-color: rgba(76, 175, 80, 0.2);
  color: #66BB6A;
}

/* Success Page Styles */
.success-card {
  text-align: center;
  padding: 2em;
}

.success-message {
  margin: 2em 0;
}

.button-container {
  margin-top: 2em;
}

.button {
  display: inline-block;
  background-color: #4CAF50;
  color: white;
  padding: 0.8em 1.5em;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s;
}

.button:hover {
  background-color: #45a049;
}

/* Contact Button on Home Page */
.contact-button-container {
  margin-top: 1.5em;
  text-align: center;
}

.contact-button {
  display: inline-block;
  background-color: #4CAF50;
  color: white;
  padding: 0.8em 1.5em;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.contact-button:hover {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}