/* Modern Minimalist Modal Styles */
.modal-content {
  border: none;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background: #ffffff;
}

.modal-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 1px solid #e2e8f0;
  padding: 24px 30px 20px;
  position: relative;
}

.modal-title {
  color: #1e293b;
  font-weight: 600;
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.025em;
}

.btn-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 20px;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  opacity: 0.7;
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close::before {
  content: "×";
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.btn-close:hover {
  background: #f1f5f9;
  color: #475569;
  opacity: 1;
  transform: scale(1.1);
}

.modal-body {
  padding: 30px;
  background: #ffffff;
}

.form-label {
  color: #374151;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 8px;
  display: block;
  letter-spacing: 0.025em;
}

.form-control, .form-select {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #374151;
  font-weight: 400;
}

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

.form-control::placeholder {
  color: #9ca3af;
}

.mb-3 {
  margin-bottom: 20px;
}

.modal-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 20px 30px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn {
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  justify-content: center;
  cursor: pointer;
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
  background: #9ca3af;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* Media preview styling */
#mediaPreview img, #mediaPreview video {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive untuk desktop 1360x768 */
@media (max-width: 1360px) {
  .modal-dialog.modal-lg {
    max-width: 90%;
    margin: 1.75rem auto;
  }
  .modal-content {
    max-height: 85vh;
    overflow-y: auto;
  }
  .modal-body {
    max-height: 60vh;
    overflow-y: auto;
  }
  .col-12.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 768px) {
  .modal-dialog.modal-lg {
    max-width: 95%;
    margin: 0.5rem auto;
  }
  .modal-content {
    max-height: 90vh;
  }
  .modal-body {
    max-height: 70vh;
  }
  .col-12.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .btn-add-news {
    margin-right: 8px;
    height: 36px;
    min-width: 36px;
  }
  .modal-header, .modal-body, .modal-footer {
    padding: 20px;
  }
}

/* Force media box to 720x698 ratio inside blog posts */
.blog-post .wt-post-media {
  position: relative;
  width: 100%;
  aspect-ratio: 720 / 698;
  overflow: hidden;
  border-radius: 12px;
}
.blog-post .wt-post-media img,
.blog-post .wt-post-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Add News (+) button - modern minimalist */
.btn-add-news {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #d1d7e0;
  background: #ffffff;
  color: #1967d2;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .05s ease;
}
.btn-add-news:hover {
  background: #f5faff;
  border-color: #1967d2;
  color: #0d47a1;
  box-shadow: 0 4px 14px rgba(25, 103, 210, 0.18);
}
.btn-add-news:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 103, 210, 0.18);
}
.btn-add-news:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(25, 103, 210, 0.18);
}
@media (max-width: 768px) {
  .btn-add-news { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 8px; }
}

/* Force blog post media size to 720x698 aspect ratio */
.blog-post .wt-post-media {
  width: 100% !important;
  height: 0 !important;
  padding-bottom: 96.94% !important; /* 698/720 = 0.9694 = 96.94% */
  overflow: hidden !important;
  border-radius: 12px !important;
  position: relative !important;
}

.blog-post .wt-post-media img,
.blog-post .wt-post-media video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 12px !important;
}

.blog-post .wt-post-media a {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

/* Limit post title and text to 2 lines with ellipsis */
.blog-post .wt-post-title .post-title a {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.4 !important;
  max-height: 2.8em !important; /* 2 lines * 1.4 line-height */
  min-height: 2.8em !important; /* Reserve height for 2 lines even if only 1 line exists */
}

.blog-post .wt-post-text p {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.4 !important;
  max-height: 2.8em !important; /* 2 lines * 1.4 line-height */
  min-height: 2.8em !important; /* Reserve height for 2 lines even if only 1 line exists */
}

/* Sidebar/compact post header title: single line with ellipsis */
.wt-post-info .wt-post-header .post-title a {
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.4 !important;
  max-width: 100% !important;
}

/* Recent Article post-title: 1 baris dengan ellipsis */
.widget-post .wt-post-info .wt-post-header .post-title a {
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.4 !important;
  max-width: 100% !important;
}

/* Search Results Styling */
.search-results-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
}

.search-results-info h4 {
  color: #1e293b;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 18px;
}

.search-results-info p {
  margin-bottom: 15px;
  font-size: 14px;
}

.search-results-info .btn {
  font-size: 12px;
  padding: 6px 12px;
}

/* Highlight search terms in results */
.search-highlight {
  background: #fef3c7;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 500;
}

/* Search type badge styling */
.search-type-badge {
  margin-bottom: 15px;
}

.search-type-badge .badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: 500;
}

.search-type-badge .bg-primary {
  background-color: #3b82f6 !important;
}

.search-type-badge .bg-success {
  background-color: #10b981 !important;
}

.search-type-badge .bg-info {
  background-color: #06b6d4 !important;
}

/* Clickable categories and tags styling */
.widget.all_services_list ul li a {
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.widget.all_services_list ul li a:hover {
  color: #3b82f6;
  text-decoration: none;
  transform: translateX(2px);
}

.widget.tw-sidebar-tags-wrap .tagcloud a {
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.widget.tw-sidebar-tags-wrap .tagcloud a:hover {
  background: #3b82f6 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Blog post actions styling */
.blog-post-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.btn-update-news {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #3b82f6;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-update-news:hover {
  background: #3b82f6;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  text-decoration: none;
}

.btn-update-news:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Ensure blog post container has relative positioning */
.blog-post.twm-blog-post-1-outer {
  position: relative;
}

/* Button group styling */
.btn-group .btn-success {
  background: #10b981;
  border-color: #10b981;
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  transition: all 0.2s ease;
  height: 40px;
  display: inline-flex;
  align-items: center;
}

.btn-group .btn-success:hover {
  background: #059669;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-group .dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  margin-top: 4px;
}

.btn-group .dropdown-item {
  padding: 8px 16px;
  font-size: 14px;
  color: #374151;
  transition: all 0.2s ease;
}

.btn-group .dropdown-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

/* Management Table Styling - Modern Minimalist */
.management-table-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

/* Full width management table when sidebar is hidden */
.col-12 .management-table-container {
  margin: 0;
  width: 100%;
}

.management-table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.management-table thead th {
  background: #f8fafc;
  border: none;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  padding: 20px 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.management-table tbody td {
  padding: 20px 16px;
  vertical-align: middle;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
}

.management-table tbody tr {
  transition: all 0.2s ease;
}

.management-table tbody tr:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.management-table tbody tr:last-child td {
  border-bottom: none;
}

/* Column specific styling */
.management-table th:nth-child(1), /* No */
.management-table td:nth-child(1) {
  width: 60px;
  text-align: center;
  font-weight: 600;
  color: #6b7280;
}

.management-table th:nth-child(2), /* Title */
.management-table td:nth-child(2) {
  width: 35%;
}

.management-table th:nth-child(3), /* Category */
.management-table td:nth-child(3) {
  width: 15%;
  text-align: center;
}

.management-table th:nth-child(4), /* Author */
.management-table td:nth-child(4) {
  width: 15%;
}

.management-table th:nth-child(5), /* Created */
.management-table td:nth-child(5) {
  width: 12%;
}

.management-table th:nth-child(6), /* Status */
.management-table td:nth-child(6) {
  width: 8%;
  text-align: center;
}

.management-table th:nth-child(7), /* Actions */
.management-table td:nth-child(7) {
  width: 15%;
  text-align: center;
}

/* News title styling */
.news-title-cell {
  max-width: 300px;
}

.news-title-cell strong {
  color: #1f2937;
  font-weight: 600;
  line-height: 1.4;
  font-size: 15px;
}

/* Badge styling */
.management-table .badge {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.management-table .bg-secondary {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
}

.management-table .bg-info {
  background: #dbeafe !important;
  color: #1e40af !important;
}

.management-table .bg-success {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.management-table .bg-danger {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

/* Tags styling */
.news-tags .badge {
  font-size: 10px;
  padding: 4px 8px;
  margin-right: 4px;
  margin-bottom: 4px;
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  border-radius: 12px;
}

/* Action buttons styling */
.management-table .btn-group {
  display: inline-flex;
  flex-direction: row;
  gap: 4px;
  white-space: nowrap;
}

.management-table .btn-group .btn {
  flex: 0 0 auto;
  min-width: 36px;
  height: 36px;
  padding: 8px;
  font-size: 13px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.management-table .btn-group .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.management-table .btn-group .btn-outline-primary {
  color: #3b82f6;
  border-color: #dbeafe;
  background: #eff6ff;
}

.management-table .btn-group .btn-outline-primary:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.management-table .btn-group .btn-outline-warning {
  color: #f59e0b;
  border-color: #fef3c7;
  background: #fffbeb;
}

.management-table .btn-group .btn-outline-warning:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.management-table .btn-group .btn-outline-danger {
  color: #ef4444;
  border-color: #fee2e2;
  background: #fef2f2;
}

.management-table .btn-group .btn-outline-danger:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.management-table .btn-group-sm .btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  margin-right: 2px;
}

.management-table .btn-group-sm .btn:last-child {
  margin-right: 0;
}

/* Compact button group styling */
.management-table .btn-group {
  display: inline-flex;
  flex-direction: row;
  gap: 2px;
  white-space: nowrap;
}

.management-table .btn-group .btn {
  flex: 0 0 auto;
  min-width: 32px;
  height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.management-table .btn-group .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.management-table .btn-group .btn-outline-primary {
  color: #3b82f6;
  border-color: #3b82f6;
}

.management-table .btn-group .btn-outline-primary:hover {
  background-color: #3b82f6;
  color: white;
}

.management-table .btn-group .btn-outline-warning {
  color: #f59e0b;
  border-color: #f59e0b;
}

.management-table .btn-group .btn-outline-warning:hover {
  background-color: #f59e0b;
  color: white;
}

.management-table .btn-group .btn-outline-danger {
  color: #ef4444;
  border-color: #ef4444;
}

.management-table .btn-group .btn-outline-danger:hover {
  background-color: #ef4444;
  color: white;
}

.management-table .badge {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
}

/* Responsive for management table */
@media (max-width: 768px) {
  .management-table-container {
    margin: 0 -15px;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
  
  .management-table thead th,
  .management-table tbody td {
    padding: 16px 12px;
    font-size: 13px;
  }
  
  .news-title-cell {
    max-width: 200px;
  }
  
  /* Mobile column optimization */
  .management-table th:nth-child(1), /* No */
  .management-table td:nth-child(1) {
    width: 40px;
    min-width: 40px;
  }
  
  .management-table th:nth-child(2), /* Title */
  .management-table td:nth-child(2) {
    width: 40%;
    min-width: 150px;
  }
  
  .management-table th:nth-child(3), /* Category */
  .management-table td:nth-child(3) {
    width: 12%;
    min-width: 80px;
  }
  
  .management-table th:nth-child(4), /* Author */
  .management-table td:nth-child(4) {
    width: 12%;
    min-width: 80px;
  }
  
  .management-table th:nth-child(5), /* Created */
  .management-table td:nth-child(5) {
    width: 10%;
    min-width: 70px;
  }
  
  .management-table th:nth-child(6), /* Status */
  .management-table td:nth-child(6) {
    width: 6%;
    min-width: 50px;
  }
  
  .management-table th:nth-child(7), /* Actions */
  .management-table td:nth-child(7) {
    width: 20%;
    min-width: 100px;
  }
  
  /* Mobile button group */
  .management-table .btn-group {
    gap: 2px;
  }
  
  .management-table .btn-group .btn {
    min-width: 32px;
    height: 32px;
    padding: 6px;
    font-size: 12px;
  }
  
  /* Mobile badges */
  .management-table .badge {
    font-size: 10px;
    padding: 4px 8px;
  }
  
  .news-tags .badge {
    font-size: 9px;
    padding: 3px 6px;
    margin-right: 2px;
    margin-bottom: 2px;
  }
}

/* Status select styling */
.status-select {
  min-width: 120px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 10px;
  color: #374151;
  background: #ffffff;
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease, color .2s ease;
  text-align: center;             /* center option text */
  text-align-last: center;        /* ensure selected text centered */
  display: inline-block;          /* allow centering inside td */
  height: 36px;                   /* fixed height to match category */
}
.status-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  outline: none;
}
/* Colored states */
.status-select.status-active {
  background-color: #dcfce7; /* green-100 */
  border-color: #86efac;     /* green-300 */
  color: #166534;            /* green-800 */
}
.status-select.status-inactive {
  background-color: #fee2e2; /* red-100 */
  border-color: #fca5a5;     /* red-300 */
  color: #991b1b;            /* red-800 */
}

/* Category badge dynamic colors */
.category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  text-align: center;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  height: 36px; /* match status select */
}
.cat-color-1 { background-color:#e0f2fe; border-color:#93c5fd; color:#1e3a8a; } /* blue */
.cat-color-2 { background-color:#fef3c7; border-color:#fcd34d; color:#92400e; } /* amber */
.cat-color-3 { background-color:#ede9fe; border-color:#c4b5fd; color:#5b21b6; } /* violet */
.cat-color-4 { background-color:#dcfce7; border-color:#86efac; color:#166534; } /* green */
.cat-color-5 { background-color:#fae8ff; border-color:#f0abfc; color:#86198f; } /* fuchsia */
.cat-color-6 { background-color:#fee2e2; border-color:#fca5a5; color:#991b1b; } /* red */
.cat-color-7 { background-color:#e9d5ff; border-color:#d8b4fe; color:#6b21a8; } /* purple */
.cat-color-8 { background-color:#dbeafe; border-color:#93c5fd; color:#1e40af; } /* indigo */
.cat-color-9  { background-color:#cffafe; border-color:#67e8f9; color:#155e75; } /* cyan */
.cat-color-10 { background-color:#ffedd5; border-color:#fdba74; color:#9a3412; } /* orange */
.cat-color-11 { background-color:#ecfccb; border-color:#a3e635; color:#365314; } /* lime */
.cat-color-12 { background-color:#e2e8f0; border-color:#cbd5e1; color:#0f172a; } /* slate */
.cat-color-13 { background-color:#f1f5f9; border-color:#cbd5e1; color:#1f2937; } /* gray */
.cat-color-14 { background-color:#ffe4e6; border-color:#fda4af; color:#9f1239; } /* rose */
.cat-color-15 { background-color:#fef9c3; border-color:#fde047; color:#713f12; } /* yellow */
.cat-color-16 { background-color:#dcf2ff; border-color:#93c5fd; color:#0c4a6e; } /* sky */
