:root {
  --primary-color: #0b4da2;
  --secondary-color: #2fa84f;
  --accent-color: #1f7a3a;
  --dark-text: #2b2f38;
  --light-text: #6b7280;
  --white: #ffffff;
  --light-bg: #f4f7fb;
  --border-color: #e5e9f0;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-text);
  background-color: var(--white);
  animation: pageFade 0.8s ease;
}

@keyframes pageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  padding-left: 40px;
  padding-right: 40px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  padding: 10px 25px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-block;
}

.btn-small {
  padding: 5px 12px;
  font-size: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--white);
  border: none;
}

.btn-primary:hover {
  background-color: #004494;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(11, 77, 162, 0.25);
}

.btn-outline {
  border: 2px solid var(--secondary-color);
  color: var(--secondary-color);
  background: transparent;
}

.btn-outline:hover {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-edit {
  background: #16a34a;
  color: #fff;
}

.btn-edit:hover {
  background: #15803d;
}

.btn-delete {
  background: #dc2626;
  color: #fff;
}

.btn-delete:hover {
  background: #991b1b;
}

/* Blog layout */
.blog-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 10px;
}

.blog-main {
  min-width: 0;
}

.blog-sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
}

.blog-page-title {
  font-size: 2.3rem;
  margin-bottom: 30px;
  color: #2c3e50;
}

.blog-page-title span {
  color: var(--primary-color);
}

/* Blog cards */
.blog-card-small {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  transition: all 0.35s ease;
}

.blog-card-small:hover {
  transform: translateY(-8px);
}

.blog-thumb-small {
  width: 220px;
  height: 140px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  flex-shrink: 0;
  background: #f3f4f6;
  margin-top: 30px;
}

.blog-card-small:hover .blog-thumb-small {
  transform: scale(1.05);
}

.blog-card-content h3 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.3;
  cursor: pointer;
}

.blog-card-content p {
  font-size: 16px;
  color: #374151;
  max-width: 520px;
}

.blog-meta {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 10px;
}

.read-more {
  display: inline-block;
  color: #2563eb;
  font-weight: 500;
  margin-top: 8px;
  transition: color 0.3s ease;
}

.read-more::after {
  content: ' →';
  transition: transform 0.3s ease;
}

.read-more:hover {
  color: #2980b9;
}

.read-more:hover::after {
  transform: translateX(5px);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
  padding: 10px 0;
}

.pagination button {
  padding: 10px 16px;
  border: none;
  background: #0073aa;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.pagination button:hover {
  background: #005e8a;
}

.pagination span {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Single blog */
.single-blog {
  width: 100%;
}

.blog-admin-bar {
  position: sticky;
  top: 90px;
  background: #fff;
  padding: 10px 0;
  z-index: 10;
}

.blog-post {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.blog-post-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.blog-post-title {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 15px;
  line-height: 1.3;
}

.blog-post-meta {
  display: flex;
  gap: 20px;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.blog-thumbnail {
  margin-bottom: 20px;
  display: flex;
  justify-content: left;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.blog-thumbnail img {
  width: 100%;
  max-width: 700px;
  height: auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.blog-thumbnail iframe {
  width: 100%;
  max-width: 700px;
  height: 400px;
  border-radius: 14px;
}

.blog-post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #444;
}

.blog-post-content h2 {
  font-size: 1.8rem;
  color: #2c3e50;
  margin: 35px 0 20px;
}

.blog-post-content h3 {
  font-size: 1.4rem;
  color: #34495e;
  margin: 25px 0 15px;
}

.blog-post-content p {
  margin-bottom: 20px;
}

.blog-post-content ul,
.blog-post-content ol {
  margin: 20px 0 20px 30px;
}

.blog-post-content li {
  margin-bottom: 10px;
}

.blog-post-content .highlight-box {
  background: #f8f9fa;
  border-left: 4px solid #3498db;
  padding: 20px;
  margin: 30px 0;
  border-radius: 0 8px 8px 0;
}

.blog-post-content .warning-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 20px;
  margin: 30px 0;
  border-radius: 0 8px 8px 0;
}

/* Sidebar */
.sidebar-box {
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 25px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.sidebar-box h3 {
  margin-bottom: 12px;
  color: #2c3e50;
}

.search-wrapper {
  position: relative;
}

.search-wrapper input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 10px;
}

#categoryList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#categoryList li {
  padding: 8px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

#categoryList li:hover {
  color: #2fa84f;
  padding-left: 6px;
}

/* Suggested blogs */
.suggested-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suggested-item {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.suggested-item img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.suggested-item h4 {
  font-size: 15px;
  margin: 0;
  line-height: 1.2;
}

.suggested-item span {
  font-size: 11px;
  color: #777;
}

/* Video */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Admin login / admin editor */
.admin-box {
  max-width: 900px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.admin-box h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.admin-box label {
  font-weight: 600;
  margin-top: 15px;
  display: block;
}

.admin-box input,
.admin-box select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.toolbar {
  margin: 15px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar button {
  padding: 6px 10px;
  border: 1px solid #ccc;
  background: #f4f7fb;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
}

#editor {
  min-height: 250px;
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

#editor ul,
#editor ol {
  margin-left: 25px;
  padding-left: 20px;
}

#editor li {
  margin-bottom: 8px;
  list-style-position: inside;
}

.thumb-preview {
  margin-top: 10px;
  max-width: 200px;
  display: none;
  border-radius: 8px;
}

.preview-box {
  margin-top: 40px;
  padding: 20px;
  border-top: 2px dashed #ddd;
}

/* Common hover polish */
img {
  transition: transform .4s ease;
}

img:hover {
  transform: scale(1.02);
}


@media (max-width: 992px) {
  .blog-layout {
    grid-template-columns: 1fr !important;
  }

  .blog-sidebar {
    position: relative;
    top: auto;
  }

  .blog-thumb-small {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .blog-page-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }

  .blog-card-small {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
  }

  .blog-thumb-small {
    width: 220px;
    height: 140px;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    flex-shrink: 0;
    background-color: #f3f4f6;
  }

  .blog-card-content h3 {
    font-size: 18px;
  }

  .blog-card-content p {
    font-size: 15px;
    max-width: 100%;
  }

  .blog-meta {
    font-size: 14px;
  }

  .pagination {
    gap: 8px;
  }

  .pagination button {
    padding: 10px 14px;
    font-size: 13px;
  }

  .pagination span {
    width: 100%;
    text-align: center;
    font-size: 13px;
  }

  .blog-post {
    padding: 25px;
  }

  .blog-post-title {
    font-size: 1.8rem;
  }

  .blog-post-meta {
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
  }

  .blog-post-content {
    font-size: 1rem;
    line-height: 1.75;
  }

  .blog-post-content h2 {
    font-size: 1.5rem;
  }

  .blog-post-content h3 {
    font-size: 1.25rem;
  }

  .blog-thumbnail {
    width: 100%;
    height: auto;
  }

  .blog-thumbnail img {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
  }

  .blog-thumbnail iframe {
    height: 240px;
  }

  .sidebar-box {
    padding: 14px;
    margin-bottom: 18px;
  }

  .suggested-item img {
    width: 95px;
    height: 68px;
  }

  .suggested-item h4 {
    font-size: 14px;
  }

  .suggested-item span {
    font-size: 10px;
  }

  .admin-box {
    margin: 20px 15px;
    padding: 20px;
  }

  .admin-box input,
  .admin-box select {
    font-size: 16px;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar button {
    padding: 8px 10px;
    font-size: 13px;
  }

  #editor {
    min-height: 220px;
    padding: 12px;
  }

  .preview-box {
    margin-top: 25px;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .pagination {
    flex-direction: column;
  }

  .pagination button {
    width: 100%;
    max-width: 220px;
  }

  .blog-page-title {
    font-size: 1.6rem;
  }

  .blog-post {
    padding: 18px;
  }

  .blog-post-title {
    font-size: 1.5rem;
  }

  .blog-card-content h3 {
    font-size: 17px;
  }

  .blog-card-content p {
    font-size: 14px;
  }

  .search-wrapper input {
    padding: 11px;
    font-size: 14px;
  }

  .suggested-item {
    align-items: flex-start;
  }

  .suggested-item img {
    width: 85px;
    height: 60px;
  }

  .admin-box {
    margin: 15px 10px;
    padding: 16px;
  }

  .admin-box h2 {
    font-size: 1.4rem;
  }

  .toolbar button {
    font-size: 12px;
    padding: 7px 8px;
  }
}