/* Toast Notifications */
#toastContainer {
    z-index: 1100;
}

.toast {
    min-width: 300px;
    margin-bottom: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast.hide {
    opacity: 0;
}

.toast:not(.show) {
    display: block;
    opacity: 0;
}

.toast-body {
    display: flex;
    align-items: center;
}

.toast .bi {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

/* Custom styles from dashboard.html sidebar */
:root {
  --primary-color: #4e73df;
  --secondary-color: #1cc88a;
  --warning-color: #f6c23e;
  --info-color: #36b9cc;
  --dark-color: #5a5c69;
  --light-bg: #f8f9fc;
}

body {
  background-color: var(--light-bg);
}

.sidebar {
  background: linear-gradient(180deg, var(--primary-color) 0%, #224abe 100%);
  min-height: 100vh;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px; /* Fixed width */
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  overflow-y: auto;
  z-index: 1000;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 1rem;
  margin: 0.2rem 0;
  border-radius: 0.35rem;
  transition: all 0.3s;
}

.sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.sidebar .nav-link i {
  margin-right: 0.5rem;
}

.sidebar .nav-link.text-danger {
  color: #fff !important;
}

.sidebar .text-center h6, .sidebar .text-center small {
  color: white !important;
}

.initials-circle {
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem auto;
}

/* SweetAlert2 Large Modal */
.swal2-popup.swal2-large {
    max-height: 90vh;
    overflow-y: auto;
}

.swal2-popup.swal2-large .swal2-html-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Layout */
.wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary-color) 0%, #224abe 100%);
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  z-index: 1000;
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
}

/* Main content area */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 20px;
  min-height: 100vh;
  background-color: var(--light-bg);
  overflow-x: hidden;
  width: calc(100% - 220px);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    margin-left: -220px;
  }
  .sidebar.active {
    margin-left: 0;
  }
  .main-content {
    width: 100%;
    margin-left: 0;
  }
  .main-content.active {
    margin-left: 220px;
  }
}

/* Blog Management Specific Styles */
.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 0;
  border-bottom: 1px solid #e3e6f0;
}

.blog-actions {
  display: flex;
  gap: 10px;
}

.blog-card {
  height: 100%;
  border: none;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.15rem 0.75rem 0 rgba(58, 59, 69, 0.1);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.blog-card-img-container {
  height: 140px;
  overflow: hidden;
  background-color: #f8f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-img {
  transform: scale(1.05);
}

.blog-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.blog-card-text {
  color: #6c757d;
  font-size: 0.85rem;
  margin: 0 0 0.75rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  margin: 0 0 0.75rem 0;
  font-size: 0.75rem;
  color: #6c757d;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-card-date {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

.blog-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}

.blog-card-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: #e9ecef;
  border-radius: 50px;
  font-size: 0.7rem;
  color: #495057;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Responsive grid */
@media (min-width: 1400px) {
  .blog-card-column {
    flex: 0 0 auto;
    width: 20%;
  }
}

@media (max-width: 1399px) {
  .blog-card-column {
    flex: 0 0 auto;
    width: 25%;
  }
}

@media (max-width: 1199px) {
  .blog-card-column {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
}

@media (max-width: 991px) {
  .blog-card-column {
    flex: 0 0 auto;
    width: 50%;
  }
}

@media (max-width: 575px) {
  .blog-card-column {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* Pagination */
.pagination .page-link {
  color: #4e73df;
  border: 1px solid #e3e6f0;
  margin: 0 3px;
  border-radius: 0.35rem !important;
}

.pagination .page-item.active .page-link {
  background-color: #4e73df;
  border-color: #4e73df;
}

/* Empty state */
#noPostsMessage {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-table {
  width: 100%;
  border-collapse: collapse;
}

.blog-table th,
.blog-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e3e6f0;
}

.blog-table th {
  font-weight: 600;
  color: var(--dark-color);
  background-color: #f8f9fc;
}

.blog-table tr:hover {
  background-color: #f8f9fc;
}

.status-badge {
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-published {
  background-color: #d1e7dd;
  color: #0f5132;
}

.status-draft {
  background-color: #fff3cd;
  color: #664d03;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.action-btn.view {
  background-color: #e7f1ff;
  color: var(--primary-color);
}

.action-btn.edit {
  background-color: #fff8e1;
  color: #ffc107;
}

.action-btn.delete {
  background-color: #fee2e2;
  color: #dc3545;
}

.action-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .blog-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .blog-table {
    display: block;
    overflow-x: auto;
  }
}
