/*
 * Daily Log - Application Styles
 */

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

html {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #0056b3;
}

/* Main Content */
.main-content {
  flex: 1;
}

/* Container */
.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 2rem;
  background-color: white;
  /* Ensure background is white */
  margin-bottom: 0px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

/* Locale Select */
.locale-select {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.locale-select:hover {
  border-color: #007bff;
}

.locale-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #212529;
}

/* Tag Filters */
.tag-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e9ecef;
}

.tag-filter-btn {
  padding: 0.5rem 1.25rem;
  border: 2px solid #dee2e6;
  border-radius: 20px;
  background-color: white;
  font-size: 0.95rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-filter-btn:hover {
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-1px);
}

.tag-filter-btn.active {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
}

/* Posts List */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-item {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.post-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.post-item .post-title-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

.post-item h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.post-item h2 a {
  color: #212529;
}

.post-item h2 a:hover {
  color: #007bff;
}

.post-item time {
  color: #6c757d;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.post-item .post-tags {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.tag-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tag-badge.tag-daily {
  background-color: #e3f2fd;
  color: #1976d2;
}

.tag-badge.tag-retrospective {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.tag-badge.tag-technical {
  background-color: #e8f5e9;
  color: #388e3c;
}

.tag-badge.tag-notice {
  background-color: #fff3e0;
  color: #e65100;
}

.tag-badge.tag-new {
  background-color: #ff1744;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
}

/* No Posts Message */
.no-posts {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
  font-size: 1.1rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding: 1rem 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Admin Actions */
.admin-actions {
  display: none;
  margin: 1rem 0;
  gap: 0.5rem;
}

.admin-actions form {
  display: inline-block;
}

/* Form Styles (for new/edit pages) */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #495057;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea.form-control {
  resize: vertical;
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Tag checkboxes styling */
.tag-checkboxes {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.tag-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.75rem 1rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background-color: white;
  transition: all 0.2s;
}

.tag-checkbox:hover {
  border-color: #007bff;
  background-color: #f8f9fa;
}

.tag-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.tag-checkbox input[type="checkbox"]:checked+span {
  font-weight: 600;
  color: #007bff;
}

.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #f8d7da;
  border-radius: 4px;
}

.note {
  padding: 1rem;
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  color: #856404;
  margin-bottom: 1.5rem;
}

/* Admin Only Pages */
.admin-only {
  background-color: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-only main {
  max-width: 700px;
  margin: 0 auto;
}

.admin-only h2 {
  margin-bottom: 1.5rem;
  color: #212529;
}

/* Post Detail Page */
article.post {
  background: white;
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

article.post .post-title-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e9ecef;
}

article.post .post-title-line h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
  line-height: 1.4;
  flex: 1;
  margin: 0;
}

article.post .post-title-line time {
  color: #6c757d;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

article.post .post-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

article.post .admin-actions {
  margin-bottom: 1.5rem;
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #495057;
  margin-bottom: 2rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-footer {
  border-top: 1px solid #e9ecef;
  padding-top: 1.5rem;
}

.back-link {
  color: #6c757d;
  font-weight: 500;
  transition: color 0.2s;
}

.back-link:hover {
  color: #007bff;
}


/* Footer */
footer {
  background-color: white;
  border-top: 1px solid #e9ecef;
  padding: 0.1rem 0;
}

.footer-content {
  display: flex;
  justify-content: flex-end;
}

.footer-info {
  text-align: right;
}

.footer-line {
  font-size: 0.9rem;
  line-height: 1.4;
}

.footer-line a {
  color: #6c757d;
  transition: color 0.2s;
}

.footer-line a:hover {
  color: #007bff;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.social-link svg {
  vertical-align: middle;
}

.footer-divider {
  color: #dee2e6;
}

.footer-credit {
  color: #adb5bd;
  font-size: 0.6rem;
}

.ruby-heart {
  color: #cc342d;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .tag-filters {
    gap: 0.5rem;
  }

  .tag-filter-btn {
    font-size: 0.875rem;
    padding: 0.4rem 1rem;
  }

  .post-item {
    padding: 1rem;
  }

  .post-item .post-title-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .post-item h2 {
    font-size: 1.1rem;
  }

  .post-item time {
    font-size: 0.85rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  article.post {
    padding: 1.5rem;
  }

  article.post .post-title-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  article.post .post-title-line h2 {
    font-size: 1.25rem;
  }

  article.post .post-title-line time {
    font-size: 0.85rem;
  }

  .post-content {
    font-size: 1rem;
  }

  .footer-content {
    justify-content: center;
  }

  .footer-info {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }
}
