:root {
  --primary-color: #4e73df;
  --primary-hover: #224abe;
  --success-color: #1cc88a;
  --danger-color: #e74a3b;
  --warning-color: #f6c23e;
  --dark-color: #5a5c69;
  --light-color: #f8f9fc;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --danger: #dc3545;
  --danger-hover: #bb2d3b;
  --success: #28a745;
  --success-hover: #218838;
  --info: #0a2463;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 0.75rem 1.25rem rgba(0, 0, 0, 0.15);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 8px;
}
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background: var(--light-color);
  color: var(--dark-color);
  margin-top: 90px;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
h5 {
  color: var(--info);
  font-weight: 600;
  line-height: 1.3;
}
h1,
h2 {
  border-bottom: 2px solid var(--info);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.admin-form {
  --primary-color: #4e73df;
  --success-color: #1cc88a;
  --danger-color: #e74a3b;
  --warning-color: #f6c23e;
  --dark-color: #5a5c69;
  --light-color: #f8f9fc;
}
.form-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}
.form-card:hover {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
}
.card-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.bg-gradient-image {
  background: linear-gradient(to right, #f6d365, #fda085);
}
.bg-gradient-text {
  background: linear-gradient(to right, #4e73df, #224abe);
}
.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.25rem;
}
.card-subtitle {
  font-size: 0.875rem;
  color: #858796;
  margin-bottom: 0;
}
.card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-label {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark-color);
}
.label-text {
  margin-right: 0.25rem;
}
.label-required {
  color: var(--danger-color);
  font-size: 1.1em;
}
.form-control,
.form-select,
.form-textarea {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d3e2;
  transition: all 0.3s ease;
}
.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
  outline: 0;
}
.form-textarea {
  min-height: 150px;
  resize: vertical;
}
.input-with-icon {
  position: relative;
}
.input-with-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #b7b9cc;
}
.input-with-icon .form-control {
  padding-left: 2.5rem;
}
.file-input-container {
  position: relative;
  border: 2px dashed #d1d3e2;
  border-radius: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
  background-color: var(--light-color);
}
.file-input-container:hover {
  border-color: var(--primary-color);
  background-color: rgba(78, 115, 223, 0.05);
}
.file-input-container input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}
.file-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #858796;
}
.file-input-label i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}
.divider-with-text {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #858796;
  font-size: 0.875rem;
}
.divider-with-text::before,
.divider-with-text::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #d1d3e2;
}
.divider-with-text::before {
  margin-right: 1rem;
}
.divider-with-text::after {
  margin-left: 1rem;
}
.image-preview-container {
  margin-top: auto;
  border-radius: 0.5rem;
  background-color: var(--light-color);
  border: 1px solid #d1d3e2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
.preview-image {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: none;
}
.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #b7b9cc;
  padding: 2rem;
}
.preview-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.textarea-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.textarea-container textarea {
  flex-grow: 1;
  min-height: 150px;
  resize: none;
}
.textarea-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}
.char-counter {
  font-size: 0.875rem;
  color: #858796;
}
.form-hint {
  font-size: 0.8125rem;
  color: #858796;
  margin-top: 0.25rem;
}
.invalid-feedback {
  color: var(--danger-color);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: none;
}
.form-control:invalid {
  border-color: var(--danger-color);
}
.form-control:invalid~.invalid-feedback {
  display: block;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
}
.btn-submit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to right, var(--primary-color), #224abe);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}
.btn-cancel {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--dark-color);
  border: 1px solid #d1d3e2;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-cancel:hover {
  background-color: #f8f9fc;
  border-color: #b7b9cc;
}
.form-section,
.posts-section {
  background-color: var(--light-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  border: 1px solid var(--gray-300);
}
.post-list-container {
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  background-color: var(--light-color);
  padding: 1.5rem;
  overflow: hidden;
}
.post {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
  background-color: var(--gray-100);
  transition: var(--transition);
  position: relative;
}
.post:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.post img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius);
  flex-shrink: 0;
  border: 1px solid var(--gray-300);
  transition: var(--transition);
  align-self: flex-start;
  background-color: var(--gray-200);
}
.post img:hover {
  transform: scale(1.03);
}
.post-details {
  flex: 1;
  min-width: 0;
}
.post-title {
  font-weight: 600;
  color: var(--info);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}
.post-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
  line-height: 1.7;
  color: var(--gray-700);
  margin-bottom: 1rem;
  max-height: 8.4em;
  transition: max-height 0.4s ease;
}
.post-text.expandable:not(.expanded) {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}
.post-text.expandable.expanded {
  max-height: none;
  -webkit-line-clamp: unset;
}
.read-more-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
  display: inline-block;
  font-weight: 500;
  transition: all 0.3s ease;
}
.read-more-btn:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}
.post-meta {
  color: var(--gray-600);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  display: block;
}
.post-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.toast {
  border: none;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.toast-header {
  background-color: var(--info);
  color: var(--light-color);
  border: none;
  font-weight: 500;
}
.toast-body {
  background-color: var(--light-color);
  color: #212529;
  padding: 1rem;
}
#postList:empty::before {
  content: "Nenhuma postagem cadastrada.";
  display: block;
  text-align: center;
  padding: 2.5rem;
  font-size: 1.1rem;
  color: var(--gray-600);
  background-color: var(--gray-100);
  border-radius: 12px;
}
.loading {
  display: none;
}
@media (max-width: 992px) {
  .post {
    flex-direction: column;
  }
  .post img {
    width: 100%;
    height: auto;
    max-height: 350px;
  }
}
@media (max-width: 768px) {
  body {
    margin-top: 70px;
    font-size: 0.95rem;
  }
  .form-section,
  .posts-section,
  .post-list-container {
    padding: 1.25rem;
  }
  .post {
    padding: 1.25rem;
  }
  .post-actions {
    flex-wrap: wrap;
  }
  .post-actions .btn {
    flex: 1 0 120px;
  }
  #postForm {
    padding: 1.5rem;
  }
}
@media (max-width: 576px) {
  .post-actions .btn {
    flex: 1 0 100%;
    margin-bottom: 0.5rem;
  }
  .post-text {
    -webkit-line-clamp: 4;
    max-height: 5.6em;
  }
}
.admin-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 2.5rem;
  padding: 1rem 0;
}
.header-icon-container {
  background: linear-gradient(to right, #4e73df, #224abe);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(78, 115, 223, 0.3);
}
.header-icon-container i {
  font-size: 1.5rem;
}
.text-gradient {
  background: linear-gradient(to right, #2c3e50, #4e73df);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.btn-logout {
  display: flex;
  align-items: center;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  color: #e74a3b;
  background-color: transparent;
  border: 1px solid rgba(231, 74, 59, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-logout:hover {
  color: white;
  background-color: #e74a3b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 74, 59, 0.2);
}
.btn-logout-text {
  margin-right: 0.75rem;
  transition: all 0.3s ease;
}
.btn-logout:hover .btn-logout-text {
  transform: translateX(-2px);
}
.btn-logout-icon {
  transition: all 0.3s ease;
}
.btn-logout:hover .btn-logout-icon {
  transform: translateX(3px);
}
.posts-dashboard {
  background-color: #f8fafc;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 2rem;
}
.dashboard-header {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  color: white;
  padding: 1.5rem;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.title-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.icon-wrapper {
  background-color: rgba(255, 255, 255, 0.2);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: white;
}
.section-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 0;
}
.stats-container {
  display: flex;
  gap: 1rem;
}
.stat-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 140px;
}
.stat-card i {
  font-size: 1.25rem;
  opacity: 0.8;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  display: block;
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  opacity: 0.8;
  display: block;
}
.dashboard-content {
  padding: 1.5rem;
}
.posts-controls {
  margin-bottom: 1.5rem;
}
.search-filter {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}
.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
}
.search-box input {
  padding-left: 2.5rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  height: 42px;
  width: 100%;
}
.filter-dropdown {
  min-width: 180px;
}
.filter-dropdown select {
  border-radius: 8px;
  height: 43px;
  border: 1px solid #e2e8f0;
}
.posts-list-container {
  background-color: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  min-height: 400px;
  position: relative;
}
.loading-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 10;
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 300px;
  text-align: center;
}
.spinner-grow {
  width: 3rem;
  height: 3rem;
}
.loading-text p {
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.progress {
  height: 6px;
  border-radius: 3px;
  width: 100%;
}
.empty-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  z-index: 5;
}
.empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 300px;
  text-align: center;
}
.empty-icon {
  font-size: 3rem;
  color: #adb5bd;
}
.empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #2d3748;
}
.empty-text {
  color: #718096;
  margin-bottom: 1rem;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}
.post-card {
  background-color: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: all 0.2s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.post-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #e2e8f0;
}
.post-body {
  padding: 1.25rem;
}
.post-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #2d3748;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-excerpt {
  color: #4a5568;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #718096;
  margin-bottom: 1rem;
}
.post-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid #edf2f7;
  padding-top: 1rem;
}
.post-actions .btn {
  flex: 1;
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
}
.posts-pagination {
  padding: 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
}
.pagination {
  gap: 0.5rem;
}
.page-item .page-link {
  border-radius: 6px;
  min-width: 36px;
  text-align: center;
  border: 1px solid #e2e8f0;
  color: #4a5568;
}
.page-item.active .page-link {
  background-color: #4e73df;
  border-color: #4e73df;
}
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-container {
    width: 100%;
  }
  .stat-card {
    flex: 1;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
}