:root {
  --primary: #32a2f8;
  --primary-hover: #3082c5;
  --background: #eeeeee;
  --card-bg: #ffffff;
  --text: #000000;
  --subtext: #6b7280;
  --radius: 25px;
  --transition: all 0.3s ease;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body {
  margin: 0;
  background-color: var(--background);
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

p {
  color: var(--subtext);
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-align: center;
  gap: 0.5rem;
}

.btn-custom {
  background: #1e92e5;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: var(--shadow-light);
  width: auto;
}
.btn-custom::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0)
  );
  border-radius: inherit;
  z-index: -1;
  transition: var(--transition);
}
.btn-custom:hover {
  background: linear-gradient(
    45deg,
    rgba(74, 198, 255, 0.834),
    rgba(30, 193, 234, 0.862)
  );
  transform: translateY(-2px) scale(1.02);
  color: white;
  box-shadow: 0 8px 20px rgba(48, 130, 197, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-custom:focus {
  outline: 2px solid var(--primary-hover);
  outline-offset: 3px;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: none;
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(48, 130, 197, 0.15);
}

.badge-latest-on-image {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #ff7b00, #fbab00);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 0.25em 0.5em;
  box-shadow: 0 0 3px #f9d42388; /* subtle shadow only */
  cursor: default;
  z-index: 10;
  user-select: none;
  gap: 0.35em;
  width: 32px;            /* start small - just icon */
  height: 32px;
  overflow: hidden;
  transition:
    width 0.35s ease,
    box-shadow 0.35s ease;
}

.badge-latest-on-image i {
  color: #fff;
  font-size: 18px;
  filter: drop-shadow(0 0 1.5px #fff);
  flex-shrink: 0;
  transition: filter 0.35s ease;
}

/* Text hidden by default */
.latest-text {
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  margin-left: 0;
  transition:
    opacity 0.35s ease,
    margin-left 0.35s ease;
  pointer-events: none;
  user-select: none;
}

/* On hover: expand width, show text */
.badge-latest-on-image:hover {
  width: 110px; /* enough for text */
  box-shadow: 0 0 5px #f9d423cc; /* keep subtle shadow */
}

.badge-latest-on-image:hover i {
  filter: drop-shadow(0 0 2px #fff);
}

.badge-latest-on-image:hover .latest-text {
  opacity: 1;
  margin-left: 0.5em;
}

.card,
.blog-card {
  width: 100%;
  min-width: 0; /* Important in flex/grid layouts */
  flex: 1 1 auto; /* Allow cards to fill available space */
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.card:hover,
.blog-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-top-left-radius: var(--radius, 12px);
  border-top-right-radius: var(--radius, 12px);
  background-color: #f0f0f0;
}
.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.card:hover .image-wrapper img,
.blog-card:hover img {
  transform: scale(1.03);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.card-text,
.card-body small {
  color: var(--subtext);
  margin-bottom: 0.75rem;
}

.blog-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  background-color: #d7d7d7;
  color: var(--text);
  border-radius: var(--radius);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}
.badge:hover {
  background-color: #3c6dad;
}

.alert {
  padding: 1rem 1.25rem;
  background-color: #fff7ed;
  color: #92400e;
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
}

.pagination-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
}

.sidebar {
  position: sticky;
  top: 2rem;
}
.list-group-item {
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  transition: var(--transition);
}
.list-group-item:hover {
  background-color: #f3f4f6;
}

section {
  padding: 4rem 1rem;
}

.cloud-bg {
  position: relative;
  background: linear-gradient(135deg, #5e90d5dd 0%, #207fc3 100%);
  overflow: hidden;
  color: rgb(255, 255, 255);
  min-height: 300px;
  border-radius: 30px;
  isolation: isolate;
}
.cloud-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff15' stroke-width='0.5'%3E%3Cpath d='M0 0L60 0M0 20L60 20M0 40L60 40M0 60L60 60M0 0L0 60M20 0L20 60M40 0L40 60M60 0L60 60'/%3E%3C/g%3E%3Ccircle cx='30' cy='30' r='1' fill='%23ffffff22' /%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 60px 60px;
  animation: gridDrift 80s linear infinite;
  backdrop-filter: blur(6px) saturate(160%);
  -webkit-backdrop-filter: blur(6px) saturate(160%);
  opacity: 0.3;
  border-radius: inherit;
  pointer-events: none;
}
@keyframes gridDrift {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 300px 300px;
  }
}
.cloud-bg::before {
  content: "";
  position: absolute;
  top: 15%;
  right: -150px;
  width: 280px;
  height: 120px;
  background: #ffffff33;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.45;
  box-shadow:
    -70px 20px 0 0 #ffffff44,
    -140px 40px 0 0 #ffffff33,
    -210px 20px 0 0 #ffffff33,
    -100px 60px 0 0 #ffffff44;
  animation:
    floatCloudsHorizontalReverse 60s linear infinite,
    floatCloudsVertical 8s ease-in-out infinite alternate;
  z-index: -2;
}
@keyframes floatCloudsHorizontalReverse {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-500px);
  }
}
@keyframes floatCloudsVertical {
  0% {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(15px);
    opacity: 0.55;
  }
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
}
.cloud-bg .cloud-1,
.cloud-bg .cloud-2 {
  position: absolute;
  background: #ffffff44;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.4;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-fill-mode: forwards;
  z-index: -2;
}
.cloud-bg .cloud-1 {
  width: 180px;
  height: 80px;
  top: 45%;
  left: 25%;
  box-shadow:
    50px 10px 0 0 #ffffff44,
    90px 20px 0 0 #ffffff33,
    140px 10px 0 0 #ffffff33;
  animation-name: floatCloudsVerticalSmall;
  animation-duration: 6s;
}
.cloud-bg .cloud-2 {
  width: 200px;
  height: 90px;
  top: 65%;
  right: 20%;
  box-shadow:
    60px 15px 0 0 #ffffff44,
    100px 25px 0 0 #ffffff33,
    150px 15px 0 0 #ffffff33;
  animation-name: floatCloudsVerticalSmall;
  animation-duration: 7.5s;
  animation-delay: 2s;
}
@keyframes floatCloudsVerticalSmall {
  0% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(10px);
    opacity: 0.5;
  }
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
}

@media (max-width: 768px) {
  .blog-card img {
    height: 180px;
  }
  section {
    padding: 2.5rem 1rem;
  }
}

.emoji {
  font-size: 30px;
}
