@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Nunito:wght@400;600;700&display=swap");

:root {
  --primary-color: #2506ad;
  --secondary-color: #00d9ff;
  --bg-color: #ffffff;
  --text-color: #333333;
  --accent-color: #ff9f55;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  outline: none;
  border: none;
  transition: all 0.2s linear;
}

html {
  font-size: 62.5%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Poppins", sans-serif;
}

body.dark-mode {
  --bg-color: #0f172a;
  --text-color: #f1f5f9;
}

/* Header Section */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.7rem 10%;
  height: 6.5rem;
  background: var(--bg-color);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

body.dark-mode header {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
  background: #1e293b;
}

header .logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  gap: 0.8rem;
}

header .logo img {
  width: 3.5rem;
  height: 3.5rem;
  vertical-align: middle;
  border-radius: 50%;
  background: #030303;
  padding: 3px;
  box-shadow: 0 0 8px rgba(0, 217, 255, 0.5);
  transition: transform 0.3s ease;
  object-fit: cover;
  flex-shrink: 0;
}
header .logo:hover img {
  transform: rotate(360deg);
}

header .navbar ul {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

header .navbar ul li {
  position: relative;
  margin-left: 2.5rem;
}

header .navbar ul li a {
  font-size: 1.57rem;
  color: var(--text-color);
  font-weight: 600;
}

header .navbar ul li a:hover,
header .navbar ul li a.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 2px;
}

#menu {
  font-size: 2.5rem;
  color: var(--primary-color);
  cursor: pointer;
  display: none;
}

/* Blogs Section */
.blogs-section {
  min-height: 80vh;
  padding: 9rem 9% 3rem 9%;
  background: var(--bg-color);
}

body.dark-mode .blogs-section {
  background: #0f172a;
}

.blogs-section .heading {
  text-align: center;
  font-size: 3.5rem;
  padding: 1rem;
  color: var(--text-color);
  font-family: "Nunito", sans-serif;
  margin-bottom: 3rem;
}

.blogs-section .heading span {
  color: var(--primary-color);
}

.blogs-section .box-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr));
  gap: 2.5rem;
}

.blogs-section .box-container .box {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .blogs-section .box-container .box {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.blogs-section .box-container .box:hover {
  transform: translateY(-0.8rem) scale(1.02);
  box-shadow: 0 1.5rem 3rem rgba(0, 217, 255, 0.2);
  border-color: var(--primary-color);
}

.blogs-section .box-container .box .image-wrapper {
  position: relative;
  height: 22rem;
  width: 100%;
  overflow: hidden;
}

.blogs-section .box-container .box .image-wrapper .carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.blogs-section .box-container .box .image-wrapper .carousel-track img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 1;
}

.blogs-section .box-container .box .image-wrapper .carousel-track img.active {
  opacity: 1;
  z-index: 2;
}

.blogs-section .box-container .box .content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blogs-section .box-container .box .content .date {
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.blogs-section .box-container .box .content h3 {
  font-size: 1.9rem;
  color: var(--text-color);
  font-weight: 700;
  margin-bottom: 1rem;
}

.blogs-section .box-container .box .content p {
  font-size: 1.3rem;
  color: #666;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

body.dark-mode .blogs-section .box-container .box .content p {
  color: #cbd5e1;
}

.loading-spinner {
  text-align: center;
  font-size: 1.8rem;
  grid-column: 1 / -1;
  padding: 5rem 0;
  color: var(--text-color);
}

/* Footer Section */
.footer {
  background: #111827;
  padding: 2.5rem 9% 1rem 9%;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer .box-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer .box-container .box h3 {
  font-size: 1.8rem;
  color: #fff;
  padding: 0.8rem 0;
  font-weight: 600;
}

.footer .box-container .box p {
  font-size: 1.25rem;
  color: #9ca3af;
  line-height: 1.8;
  padding: 0.5rem 0;
}

.footer .box-container .box a {
  font-size: 1.25rem;
  color: #9ca3af;
  display: block;
  padding: 0.5rem 0;
}

.footer .box-container .box a:hover {
  color: #00d9ff;
  text-decoration: underline;
}

.footer .box-container .box i {
  color: var(--secondary-color);
  padding-right: 0.5rem;
}

.footer .credit {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem 1rem 0.5rem 1rem;
  font-size: 1.35rem;
  color: #9ca3af;
  font-weight: 500;
}

.footer .credit a {
  color: #00d9ff;
}

/* Scroll Top Button */
#scroll-top {
  position: fixed;
  bottom: 2.5rem;
  right: 2rem;
  z-index: 100;
  background: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  font-size: 2rem;
  padding: 1.2rem 1.5rem;
  display: none;
}

#scroll-top:hover {
  background: var(--secondary-color);
}

/* Media Queries */
@media (max-width: 768px) {
  #menu {
    display: block;
  }
  header .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  }
  body.dark-mode header .navbar {
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  header .navbar.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  header .navbar ul {
    flex-direction: column;
    padding: 1.5rem 0;
  }
  header .navbar ul li {
    margin: 1.5rem 0;
  }
}
