/* General styling */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  background-color: #f8f9fa;
}

/* Highlight for "rerum" containing posts */
.highlight {
  background-color: #ffff99;
  color: black;
  font-weight: bold;
  padding: 0 2px;
  border-radius: 2px;
}

.rerum-highlight {
  background-color: rgba(255, 255, 153, 0.2);
}

/* Post body text styling */
.post-body {
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loading spinner */
#loading {
  padding: 30px;
  text-align: center;
}

/* Table styling */
.table {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}
.table th {
  background-color: #f8f9fa;
  border-top: none;
  font-weight: 600;
  color: #495057;
}

.table td {
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Card styling */
.card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
  font-weight: bold;
  border-bottom: none;
  border-radius: 8px 8px 0 0 !important;
}

/* Modal styling */
.modal-content {
  border: none;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.modal-body {
  max-height: 500px;
  overflow-y: auto;
  padding: 20px;
}

/* Buttons */
.btn {
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-info {
  color: #fff;
  background-color: #0dcaf0;
  border-color: #0dcaf0;
}

.btn-info:hover {
  color: #fff;
  background-color: #31d2f2;
  border-color: #25cff2;
}

/* Search box */
.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
}

/* Pagination */
.pagination {
  margin-bottom: 20px;
}

.page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.page-link {
  color: #0d6efd;
}

.page-link:hover {
  color: #0a58ca;
  background-color: #e9ecef;
}

/* Error alert */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
  border-radius: 8px;
}

/* Statistics display */
.display-1 {
  font-weight: 700;
}

.text-success {
  color: #198754 !important;
}

.text-warning {
  color: #ffc107 !important;
}

.text-danger {
  color: #dc3545 !important;
}

/* Responsive fixes */
@media (max-width: 768px) {
  .post-body {
    max-width: 200px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .display-1 {
    font-size: 3rem;
  }
}

@media (max-width: 576px) {
  .post-body {
    max-width: 150px;
  }

  .table th,
  .table td {
    padding: 0.5rem;
  }

  .pagination .page-link {
    padding: 0.3rem 0.5rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
  }

  body.dark-mode .card {
    background-color: #1e1e1e;
    border-color: #333;
  }

  body.dark-mode .table {
    color: #e0e0e0;
    background-color: #1e1e1e;
  }

  body.dark-mode .table th {
    background-color: #2a2a2a;
    color: #e0e0e0;
  }

  body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
  }
}

/* Navigation Styling */
.main-nav {
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-left: 1.5rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: all 0.3s;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: white;
  bottom: 0;
  left: 0;
  transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  opacity: 1;
}

/* Navbar Toggler Styling */
.navbar-toggler {
  padding: 0.25rem 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.navbar-toggler:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.navbar-toggler-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* Mobile Navigation */
@media (max-width: 767.98px) {
  .main-nav {
    position: static;
  }

  .navbar-collapse {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 1rem;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
  }

  .nav-item {
    margin: 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    padding: 0.75rem 0;
  }

  .nav-link::after {
    display: none;
  }
}

.navbar {
  background: transparent !important;
}

.navbar-nav .nav-item {
  margin-left: 0.5rem;
}

.navbar-nav .nav-link {
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  opacity: 0.85;
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 0;
  height: 2px;
  background-color: white;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 60%;
}

/* Mobile navigation */
@media (max-width: 767.98px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    z-index: 1000;
  }

  .navbar-nav {
    text-align: center;
  }

  .navbar-nav .nav-item {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }

  .navbar-nav .nav-link::after {
    display: none;
  }

  .navbar-toggler {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
  }

  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
  }
}

/* Header Gradient & Styling */
.site-header {
  background: linear-gradient(135deg, #0d47a1, #1976d2, #2196f3);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100;
}

.page-banner {
  background: linear-gradient(135deg, #0d47a1, #1976d2);
  position: relative;
  overflow: hidden;
}

.page-banner::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,100 L100,0 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: 100% 100%;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  max-height: 50px;
  margin-right: 10px;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* Custom Tooltip */
.custom-tooltip {
  position: relative;
  cursor: pointer;
  overflow: visible;
}

.custom-tooltip .tooltip-content {
  visibility: hidden;
  width: 300px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 1000;
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%);
  height: 20px;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s, height 0.3s;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  text-wrap: auto;
}

.custom-tooltip .tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.custom-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
  height: 100px;
}

/* Action Button Styling */
.btn-action {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-action i {
  font-size: 1rem;
}

.action-tooltip {
  position: relative;
}

.action-tooltip .action-tooltip-text {
  visibility: hidden;
  background-color: #333;
  color: white;
  text-align: center;
  border-radius: 4px;
  padding: 5px 10px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  font-size: 0.8rem;
}

.action-tooltip:hover .action-tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Footer Styling */
.site-footer {
  background: linear-gradient(to bottom, #212529, #111827);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, #0d6efd, #0dcaf0);
}

.footer-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 10px;
}

.footer-heading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: #0d6efd;
}

.footer-links {
  list-style: none;
  padding-left: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #dee2e6;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: #0d6efd;
  transform: translateX(3px);
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s;
}

.social-link:hover {
  background-color: #0d6efd;
  color: white;
  transform: translateY(-3px);
}

.dev-profile {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  border-left: 3px solid #0d6efd;
}

@media (max-width: 767px) {
  .footer-heading {
    margin-top: 10px;
  }

  .site-footer {
    text-align: center;
  }

  .footer-heading::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .social-links {
    justify-content: center;
  }

  .footer-links a:hover {
    transform: none;
  }
}

/* Modal enhancements */
.modal-content {
  border: none;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem 1.5rem;
}

/* Post details styling */
.post-details-content h4 {
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.post-meta {
  margin-bottom: 1.5rem;
}

.post-meta .badge {
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

/* Edit form styling */
#edit-post-form .form-label {
  font-weight: 500;
  color: #555;
}

#edit-post-form .form-control:focus {
  border-color: #ffc107;
  box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

#edit-post-form textarea {
  resize: vertical;
  min-height: 150px;
}

/* Delete confirmation styling */
#deleteConfirmModal .bi-exclamation-triangle {
  display: block;
  margin-bottom: 1rem;
}

/* Success message animation */
.alert-success {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal transition enhancements */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translateY(-20px);
}

.modal.show .modal-dialog {
  transform: translateY(0);
}
