:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --secondary-bg: #f0f0f0;
  --secondary-text: #555555;
  --accent-color: #474af0;
  --card-bg: #ffffff;
  --card-shadow: rgba(0,0,0,0.1);
  --nav-bg: #ffffff;
  --nav-text: #000000;
  --nav-active-bg: #000000;
  --nav-active-text: #ffffff;
  --home-p-bg: rgba(128, 128, 128, 0.214);
  --border-color: black;
  --tag-bg: #e0e7ff;
  --tag-text: #1e3a8a;
  --dot-color: #e5e5e5;
}

.dark-mode {
  --bg-color: #121212;
  --text-color: #ffffff;
  --secondary-bg: #1e1e1e;
  --secondary-text: #cccccc;
  --accent-color: #6c6eff;
  --card-bg: #1e1e1e;
  --card-shadow: rgba(255,255,255,0.1);
  --nav-bg: #1e1e1e;
  --nav-text: #ffffff;
  --nav-active-bg: #ffffff;
  --nav-active-text: #000000;
  --home-p-bg: rgba(255, 255, 255, 0.1);
  --border-color: white;
  --tag-bg: #333333;
  --tag-text: #e0e7ff;
  --dot-color: #333333;
}

* {
  margin: 0;
  padding: 0;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.header-list {
  margin: 15px 20px;
}

.div-list {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.ul-list {
  list-style: none;
  display: flex;
  gap: 3rem;
  background-color: var(--nav-bg);
  box-shadow: 0 2px 8px var(--card-shadow);
  padding: 10px 25px;
  border-radius: 25px;
}

.ul-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 25px;
  transition: 0.3s;
}

.ul-list li a {
  font-family: "Montserrat", sans-serif;
  text-decoration: none;
  color: var(--nav-text);
}

.ul-list li.active {
  background-color: var(--nav-active-bg);
  padding: 10px 15px;
}

.ul-list li.active a,
.ul-list li.active i {
  color: var(--nav-active-text);
}

.header-logo {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
}

.header-logo img {
  height: 50px;
  width: auto;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.header-logo img:hover {
  transform: scale(1.1);
}

.hamburger {
    display: none;
    cursor: pointer;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    font-size: 28px;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.hamburger:hover {
    color: var(--accent-color);
}

/* fine header  */

.home {
  margin: 160px auto;
  max-width: 1400px;
  padding: 0 50px;
}

.home-container {
  display: flex;
  gap: 6rem;
}

.home-p {
  color: var(--text-color);
  background-color: var(--home-p-bg);
  display: inline-block;
  border-radius: 25px;
  padding: 5px 10px;
  margin-bottom: 30px;
}

.home-s {
  font-weight: bold;
  color: green;
}

.info-home h1 {
  font-size: 70px;
  font-family: "Raleway", sans-serif;
  margin-bottom: 20px;
}

.info-home h3 {
  font-size: 40px;
  font-family: "Playfair Display", serif;
  margin-bottom: 20px;
}

.info-p {
  color: var(--secondary-text);
  font-family: "Roboto", sans-serif;
  padding-bottom: 20px;
}

.info-p p {
  padding-bottom: 5px;
}

.info-p2 {
  display: flex;
  gap: 1rem;
  color: var(--secondary-text);
  font-size: 14px;
  padding-bottom: 20px;
}

.btnn {
  display: flex;
  gap: 1rem;
  padding-bottom: 30px;
}

.btn-home1 {
  background-color: var(--nav-active-bg);
  color: var(--nav-active-text);
  border: none;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
}

.btn-home2 {
  background-color: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-color);
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
  transition: 0.4s;
}

.btn-home2:hover{
    background-color: var(--nav-active-bg);
    color: var(--nav-active-text);
}

hr {
  width: 90%;
  font-weight: bold;
  color: gray;
}

.hhr {
  padding-bottom: 30px;
}

.follow {
  display: flex;
  gap: 1rem;
}

.follow ul {
  display: flex;
  gap: 2rem;
  font-size: 20px;
}

.follow ul li {
  list-style: none;
}

.follow ul a {
  text-decoration: none;
  color: var(--text-color);
}

.home img {
  width: 400px;
  border-radius: 10px;
}

/* fine home  */

.about{
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
}

.about p{
    padding-bottom: 30px;
    font-size: 13px;
    color: var(--secondary-text);
}

.about h1{
    font-family: "Open Sans", sans-serif;
}

.title{
    padding-bottom: 20px;
}

.about .hrrr{
    width: 30%;
    padding-bottom: 40px;
}

.info-about{
    display: flex;
    flex-direction: column;
}

.about-container{
    display: flex;
    gap: 2rem;
    align-items: center;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image img {
    width: 100%;
    max-width: 450px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.about h2{
    padding-bottom: 30px;
}

.card{
    display: flex;
    gap: 2rem;
}

.c1{
    display: flex;
    align-content: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border: 2px solid var(--border-color);
    padding: 5px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.c1 h3{
    padding-top: 10px;
    padding-bottom: 10px;
}

.c1:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: #ff3333;               
  background-color: #fff5f5;               
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);  
  cursor: pointer;                         
}


.project{
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.project p{
    padding-bottom: 20px;
    font-size: 13px;
    color: var(--secondary-text); 
}

.project h1{
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.project hr{
    width: 10%;
}

.info-pro{
    padding-top: 20px;
}

.info-pro p{
    padding-bottom: 10px;
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1100px;
  margin: auto;
}

.project-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 5px 15px var(--card-shadow);
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 15px;
}

.project-card h3 {
  color: var(--accent-color);
  margin-bottom: 8px;
}

.project-card p {
  color: var(--secondary-text);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.skills {
  margin-bottom: 15px;
}

.skills a {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 6px;
  margin: 3px;
  transition: background 0.3s;
}

.skills a:hover {
  background: #c7d2fe;
}

.btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
}

.btn {
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 25px;
  font-size: 0.9rem;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background: #2563eb;
  border-radius: 25px;

}

.services{
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.services p{
    padding-bottom: 20px;
    font-size: 13px;
    color: var(--secondary-text); 
}

.services h1{
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.services hr{
    width: 10%;
}

.services-container {
  padding-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  max-width: 1100px;
  margin: auto;
}

.service-card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 5px 15px var(--card-shadow);
  transition: 0.5s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.service-card img {
  width: 100px;
  margin-bottom: 15px;
  z-index: 1;
  position: relative;
}

.service-card h3 {
  color: var(--accent-color);
  margin-bottom: 10px;
  transition: color 0.5s;
  position: relative;
  z-index: 1;
}

.service-card p {
  color: var(--secondary-text);
  font-size: 0.9rem;
  transition: color 0.5s;
  position: relative;
  z-index: 1;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: #474af0;
  z-index: 0;
  transition: 0.5s;
}

.service-card:hover::before {
  left: 0;
}

.service-card:hover h3,
.service-card:hover p {
  color: #fff;
}

.contact{
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.contact p{
    padding-bottom: 20px;
    font-size: 13px;
    color: var(--secondary-text); 
}

.contact h1{
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.contact hr{
    width: 10%;
}

.contact-content {
  padding-top: 50px;
  display: flex;
  gap: 50px;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-info {
  flex: 1;
  min-width: 300px;
}

.contact-info p {
  font-size: 16px;
  margin-bottom: 25px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-color);
}

.contact-item i {
  font-size: 20px;
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-link {
  width: 50px;
  height: 50px;
  background: var(--secondary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 20px;
  transition: all 0.3s ease;
}

.social-link:hover {
  transform: translateY(-5px);
  color: #fff;
}

.social-link[href*="github"]:hover {
  background: #000;
}

.social-link[href*="linkedin"]:hover {
  background: #0A66C2;
}

.social-link[href*="wa.me"]:hover {
  background: #25D366;
}

/* Form */
.contact-form {
  flex: 1;
  min-width: 300px;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--secondary-text);
  background-color: var(--card-bg);
  color: var(--text-color);
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #474af0;
}

.btn-send {
  background: #474af0;
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s;
}

.btn-send:hover {
  background: #2c36d9;
}

/* Timeline Styles */
.timeline {
  flex: 1;
  position: relative;
  max-width: 800px;
  margin: 0;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background-color: var(--border-color);
  top: 0;
  bottom: 0;
  left: 20px; 
  margin-left: -1px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 100%;
  box-sizing: border-box;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background-color: var(--accent-color);
  border: 2px solid var(--bg-color);
  position: absolute;
  border-radius: 50%;
  left: 12px; 
  top: 15px;
  z-index: 1;
}

.timeline-date {
  font-size: 14px;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 5px;
}

.timeline-content {
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: 6px;
  box-shadow: 0 2px 8px var(--card-shadow);
}

.timeline-content h3 {
  margin-top: 0;
  color: var(--text-color);
}

.timeline-content p {
  margin-bottom: 0;
  color: var(--secondary-text);
}

/* Codeforces Section */
.codeforces {
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.codeforces p {
    padding-bottom: 20px;
    font-size: 13px;
    color: var(--secondary-text); 
}

.codeforces h1 {
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.codeforces hr {
    width: 10%;
}

.codeforces-container {
    display: flex;
    gap: 2rem;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.cf-card {
    background: var(--card-bg);
    padding: 20px 40px;
    border-radius: 16px;
    box-shadow: 0 5px 15px var(--card-shadow);
    text-align: center;
    min-width: 150px;
}

.cf-card h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.cf-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    padding-bottom: 0;
}

.cf-charts-container {
    display: flex;
    gap: 2rem;
    margin-top: 40px;
    width: 100%;
    max-width: 1100px;
    flex-wrap: wrap;
    justify-content: center;
}

.chart-wrapper {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 5px 15px var(--card-shadow);
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.chart-wrapper h3 {
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

@media (max-width: 1024px) {
    .codeforces {
        margin: 120px 50px;
    }
}

@media (max-width: 768px) {
    .codeforces {
        margin: 100px 20px;
    }
}

.my-skills {
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.my-skills p {
    padding-bottom: 20px;
    font-size: 13px;
    color: var(--secondary-text); 
}

.my-skills h1 {
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.my-skills hr {
    width: 10%;
    margin-bottom: 40px;
}

.skills-categories {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.skill-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-color);
    transition: 0.3s;
}

.skill-category:hover .category-icon {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.skill-category h3 {
    font-size: 16px;
    color: var(--text-color);
}

.skill-category p {
    font-size: 12px;
    color: var(--secondary-text);
    padding-bottom: 0;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 1000px;
}

.skill-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--secondary-text);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-color);
    transition: 0.3s;
    cursor: default;
}

.skill-badge i {
    color: var(--accent-color);
}

.skill-badge:hover {
    border-color: var(--accent-color);
    background-color: rgba(71, 74, 240, 0.1);
    transform: translateY(-3px);
}

@media (max-width: 1024px) {
    .my-skills {
        margin: 120px 50px;
    }
}

@media (max-width: 768px) {
    .my-skills {
        margin: 100px 20px;
    }
}

/* Responsive */
@media (max-width: 900px) {
  .contact-content {
    flex-direction: column;
  }
}


.footer {
  background-color: #000;
  color: #fff;
  padding: 40px 20px;
  text-align: center;
  overflow-x: hidden;
}

.footer-container {
  max-width: 1200px;
  margin: auto;
}

.footer-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.footer-logo-img {
  width: 60px;
  height: auto;
  margin-bottom: 10px;
  border-radius: 50%;
}

.footer-logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links li a:hover {
  color: #474af0;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.footer-social a {
  color: #fff;
  font-size: 18px;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: #474af0;
}

.footer-version {
  display: flex;
  gap: 15px;
  margin: 15px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.version-badge {
  background: rgba(71, 74, 240, 0.15);
  color: #474af0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(71, 74, 240, 0.3);
}

.version-date {
  color: var(--secondary-text);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-copy {
  font-size: 12px;
  color: #aaa;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease-out;
}

.active-reveal {
  opacity: 1;
  transform: translateY(0);
}

body {
  margin:0;
  padding:0;
  font-family: sans-serif;
  background-color: var(--bg-color);
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

#loading-screen {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background-color: #000;
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:9999;
  overflow:hidden;
  transition: opacity 0.5s ease;
}

.loader-gif {
  max-width: 150px;
  height: auto;
}

.hidden {
  opacity: 0;
  transform: translateY(-200px);
}

.fall {
  animation: fall 0.9s forwards;
}

@keyframes fall {
  0% {
    opacity:0;
    transform: translateY(-200px);
  }
  60% {
    opacity:1;
    transform: translateY(20px);
  }
  100% {
    transform: translateY(0);
  }
}

.loading-content h1,
.loading-content h2,
.loading-content i {
  margin: 20px 0;
}

.sub-icons {
  display:flex;
  justify-content:center;
  gap: 25px;
  margin-bottom: 20px;
}

#main-page {
  opacity:0;
  transition: opacity 1s ease;
}

#main-page.visible {
  opacity:1;
}

/* Modal Styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 2000; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.8); 
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--card-bg);
  margin: 5% auto; 
  padding: 40px;
  border: 1px solid var(--border-color);
  width: 80%; 
  max-width: 900px;
  border-radius: 15px;
  position: relative;
  color: var(--text-color);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-modal {
  color: var(--secondary-text);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 10px;
  transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
  color: var(--accent-color);
  text-decoration: none;
  cursor: pointer;
}

#modal-body {
    margin-top: 20px;
}

#modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
  display: block;
}

#modal-body h1, #modal-body h2, #modal-body h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

#modal-body p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: var(--secondary-text);
}

#modal-body ul, #modal-body ol {
    margin-bottom: 15px;
    padding-left: 25px;
    color: var(--secondary-text);
}

#modal-body li {
    margin-bottom: 5px;
}

#modal-body pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

#modal-body code {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(128, 128, 128, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
}

#modal-body pre code {
    background: transparent;
    padding: 0;
}

#modal-body a {
    color: var(--accent-color);
    text-decoration: none;
}

#modal-body a:hover {
    text-decoration: underline;
}

#modal-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
    color: var(--secondary-text);
    font-style: italic;
    margin: 15px 0;
}

.dark-mode #modal-body pre {
    background: #2d2d2d;
}

/* Blog Section */
.blogs {
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.blogs p {
    padding-bottom: 20px;
    font-size: 13px;
    color: var(--secondary-text); 
}

.blogs h1 {
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.blogs hr {
    width: 10%;
}

.blogs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 30px auto 0;
    width: 100%;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 5px 15px var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px var(--card-shadow);
}

.blog-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: top center;
}

.blog-card-content {
    padding: 20px;
}

.blog-card-date {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-title {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-card-btn:hover {
    background: #2563eb;
}

/* Blog Modal */
.blog-modal-content {
    max-width: 800px;
}

.blog-modal-header {
    margin-bottom: 20px;
}

.blog-modal-header img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.blog-modal-header h1 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.blog-modal-meta {
    display: flex;
    gap: 20px;
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.blog-modal-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-modal-body {
    line-height: 1.8;
    color: var(--secondary-text);
}

.blog-modal-body p {
    margin-bottom: 15px;
}

.blog-modal-body h2, .blog-modal-body h3 {
    color: var(--text-color);
    margin-top: 25px;
    margin-bottom: 15px;
}

.blog-modal-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.blog-modal-body pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.dark-mode .blog-modal-body pre {
    background: #2d2d2d;
}

.close-blog-modal {
    color: var(--secondary-text);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 10px;
    transition: 0.3s;
}

.close-blog-modal:hover {
    color: var(--accent-color);
}

/* Monkeytype Section */
.monkeytype {
    margin: 160px auto;
    max-width: 1400px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.monkeytype p {
    padding-bottom: 20px;
    font-size: 13px;
    color: var(--secondary-text); 
}

.monkeytype h1 {
    font-family: "Open Sans", sans-serif;
    padding-bottom: 10px;
}

.monkeytype hr {
    width: 10%;
}

.monkeytype-container {
    display: flex;
    gap: 2rem;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.mt-card {
    background: var(--card-bg);
    padding: 20px 40px;
    border-radius: 16px;
    box-shadow: 0 5px 15px var(--card-shadow);
    text-align: center;
    min-width: 150px;
    position: relative;
}

.mt-card h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.mt-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    padding-bottom: 0;
}

.mt-acc {
    display: block;
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin-top: 5px;
}

/* Responsive for tablets and phones */
@media (max-width: 1024px) {
  .home, .about, .project, .services, .contact, .my-skills, .codeforces, .blogs, .monkeytype {
    margin: 120px 50px;
  }

  .home-container, .about-container {
    flex-direction: column;
    gap: 3rem;
  }

  .home img, .about img {
    width: 100%;
    height: auto;
  }

  .ul-list {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background-color: var(--card-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: 0.5s;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 0;
    padding: 0;
  }

  .ul-list.active {
    right: 0;
  }

  .hamburger {
    display: block;
  }
  
  .hamburger.toggle .line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

  .hamburger.toggle .line:nth-child(2) {
    opacity: 0;
  }

  .hamburger.toggle .line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}

/* Phone layout */
@media (max-width: 768px) {
  .header-list {
      margin: 0;
      padding: 0;
      background-color: var(--nav-bg);
      box-shadow: 0 2px 10px var(--card-shadow);
  }
  
  .div-list {
      padding: 10px 20px;
      justify-content: space-between;
  }

  .header-logo {
      position: static;
      transform: none;
  }
  
  .hamburger {
      position: static;
      transform: none;
      display: block;
  }
  
  .home, .about, .project, .services, .contact, .my-skills, .codeforces, .blogs, .monkeytype {
    margin: 100px 20px;
  }

  .home-container, .about-container, .contact-content {
    flex-direction: column;
    gap: 2rem;
  }

  .projects-container, .services-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .home img, .about img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .btn-home1, .btn-home2, .btn, .btn-send {
    width: 100%;
    text-align: center;
  }
  
  .follow ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
  }

  /* Codeforces Responsiveness */
  .cf-card {
      width: 100%;
      padding: 15px;
  }
  
  .cf-charts-container {
      flex-direction: column;
  }
  
  .chart-wrapper {
      width: 100%;
      max-width: 100%;
      padding: 10px;
  }
}

@media (max-width: 1024px) {

  /* header { display: none; } <-- Removed this line too */

  .home, .about, .project, .services, .contact, .my-skills, .codeforces, .blogs, .monkeytype {
    margin: 80px 20px; /* Adjusted margin */
    padding: 0 15px;
    text-align: center;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .about .hrrr {
    margin: 0 auto;
  }

  .home-container,
  .about-container,
  .services-container,
  .projects-container,
  .contact-content,
  .card {
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }

  .about img {
    width: 100%;
    max-width: 220px; 
    height: auto;
    margin-bottom: 20px;
    position: relative;
    z-index: 1; 
  }

  .card .c1 {
    width: 100%;
    max-width: 300px;
    text-align: center;
    margin: 0 auto;
  }

  .home img,
  .project-card img,
  .service-card img {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
    object-fit: cover;
  }

  .info-home h1 { font-size: 26px; }
  .info-home h3 { font-size: 18px; }
  .info-p, .info-p2, .home-p, .about p, .project p, .service-card p, .contact p {
    font-size: 14px;
  }
  .project-card h3, .service-card h3 { font-size: 16px; }

  .contact-content {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .contact-info, .contact-form {
    width: 100%;
    max-width: 400px;
  }

  html, body {
    overflow-x: hidden;
  }
}

/* Horizontal Scroll for Cards on Mobile */
@media (max-width: 768px) {
    .projects-container, 
    .services-container, 
    .codeforces-container,
    .blogs-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        justify-content: flex-start !important;
        gap: 20px;
        padding: 10px 5px 20px 5px;
        width: 100%;
        
        /* Hide scrollbar */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .projects-container::-webkit-scrollbar,
    .services-container::-webkit-scrollbar,
    .codeforces-container::-webkit-scrollbar,
    .blogs-container::-webkit-scrollbar {
        display: none;
    }

    .project-card, 
    .service-card, 
    .cf-card,
    .blog-card {
        flex: 0 0 85%;
        min-width: 260px;
        scroll-snap-align: center;
        margin: 0 !important;
    }
    
    .cf-card {
        width: auto !important;
    }

    .project-card img,
    .service-card img {
        max-width: 100%;
        height: auto;
    }
}
