/*define light mode colours using css variables*/
:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --accent-color: #3498db;
}

/*override colours when dark mode is enabled*/
html.dark {
  --bg-color: #121212;
  --text-color: #f1f1f1;
}


/*general body stylin' with smooth transitions*/
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/*header bar*/
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-color);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 10;
}

/*header buttons*/
.sidebar-toggle, .theme-toggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

/*sidebar toggle button on da left*/
.sidebar-toggle {
  margin-right: 0;
}

/*theme toggle button on da right*/
.theme-toggle {
  margin-left: 0;
  transform: rotate(0deg);
  transition: transform 0.4s ease;
  position: fixed;  /*fixed positioning*/
  right: 20px;      /*20px from the right edge*/
  top: 20px;        /*20px from the top edge*/
  transform: rotate(0deg);  /*no rotation initially*/
  z-index: 1000;    /*ensure it's on top of other elements*/
}




/*rotate icon when in dark mode*/
html.dark .theme-toggle {
  transform: rotate(180deg);
}

/*sidebar menu (hidden by default)*/
.sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background-color: var(--bg-color);
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  padding-top: 2rem;
  transition: left 0.3s;
  z-index: 20;
}

/*sidebar nav links*/
.sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

/*style sidebar links*/
.sidebar nav a {
  text-decoration: none;
  color: var(--text-color);
  margin: 1rem 0;
  font-size: 1.2rem;
}

/*show sidebar when open*/
.sidebar.open {
  left: 0;
}

/*sidebar close button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

/*padding for main content to avoid overlap with header*/
main {
  padding: 6rem 2rem 2rem;
}

/*section with fade in anim on load*/
.fade-in {
  opacity: 0;
  transform: translateY(-20px);
  animation: fadeInTop 1s forwards;
}

/*keyframes for fade-in from top*/
@keyframes fadeInTop {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*blog specific styles*/
.blog-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.blog-post {
  margin-bottom: 3rem;
}

.blog-post h2 {
  margin-bottom: 0.5rem;
}

.blog-post .date {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.pagination button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/*comments styling*/

.comment {
  background-color: var(--bg-secondary);
  padding: 1em;
  margin-bottom: 1em;
  border-radius: 5px;
}

.thought-form input,
.thought-form textarea {
  width: 100%;
  padding: 0.5em;
  margin-bottom: 1em;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--bg-primary);
  color: var(--text-color);
}

.thought-form button {
  padding: 0.5em 1em;
  border: none;
  border-radius: 5px;
  background-color: var(--accent-color);
  color: #fff;
  cursor: pointer;
}

#pagination-controls button {
  margin: 0 0.5em;
  padding: 0.5em 1em;
  border: none;
  border-radius: 5px;
  background-color: var(--accent-color);
  color: #fff;
  cursor: pointer;
}

.textarea-wrapper {
  position: relative;
}

.char-counter {
  text-align: right;
  font-size: 0.75rem;
  margin-top: 4px;
  color: var(--text-color);
  opacity: 0.6;
}

.comment-date {
  color: gray;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}
