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

/* Page */
body {
  font-family: system-ui, sans-serif;
  background-color: #f3f4f6;
  color: #1f2937;
  line-height: 1.5;
}

header {
  background: #2563EB;
  background: linear-gradient(0deg,rgba(37, 99, 235, 1) 0%, rgba(116, 143, 212, 1) 100%);  max-width: 900px;
  width: 100%;
  color: white;
  padding: 20px;
  margin: auto;
  margin-top: 2em;
}

header a {
  color: white;
}

.signin-register-container {
  float: right;
  margin-top: 5px;
}

.logout-button {
  background: none;
  color: white;
  border: 0;
  font-size: 1rem;
  cursor: pointer;
}
.logout-button:hover {
  text-decoration: underline;
}

#login-form {
    margin-top: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#login-form input[type="text"], #login-form input[type="password"] {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

#login-form button {
  margin-top: 10px;
  width: 100%;
  align-self: flex-start;
  background: #2563EB;
  background: linear-gradient(0deg,rgba(37, 99, 235, 1) 0%, rgba(116, 143, 212, 1) 100%);  max-width: 900px;
  color: #ffffff;
  font-weight: 600;
  padding: 1rem 1.2rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}


a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 0rem 0rem 1rem 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Form box */
.form-box {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
}

.form-box form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-box label {
  font-weight: 600;
  color: #374151;
}

.form-box textarea, .reply-form textarea {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-box textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

.write-post-button {
  align-self: flex-start;
  background: #2563EB;
  background: linear-gradient(0deg,rgba(37, 99, 235, 1) 0%, rgba(116, 143, 212, 1) 100%);  max-width: 900px;
  color: #ffffff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.write-post-button:hover {
  background: #2563EB;
  background: linear-gradient(0deg,rgba(37, 99, 235, 1) 0%, rgba(116, 143, 212, 1) 50%);  max-width: 900px;
}

/* Post styling */
.post {
  margin-bottom: 1rem;
  padding: 1.5rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.post .meta {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.post .meta a {
  font-weight: 600;
}

.post .meta .datetime-link {
  font-weight: normal;
  color: #6b7280;
}

.post p {
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

/* Post buttons */
.post form {
  display: inline;
  margin-right: 0.5rem;
}

.like-button,
.delete-button,
.reply-button {
  background: none;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 2rem;
  color: #343c42;
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 0.5rem;
}

/* Source link */
.container > a[href*="github"] {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #6b7280;
  margin-left: 1rem;
}

.container > a[href*="github"]:hover {
  color: #374151;
}

.reply-form {
    margin-top: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.replies {
  margin-left: 30px;
}

@media screen and (max-width: 600px) {
  header {
    width: 100%;
    margin: 0;
  }

  .container {
    width: 100%;
    margin: 0;
  }
}