 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box
 }

 body {
     font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
     min-height: 100vh;
     display: flex;
     flex-direction: column;
     background: linear-gradient(116deg, #e8f9f7, #44bfb4);
     color: #222;
     transition: .3s;
 }

 header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     background: linear-gradient(135deg, #4fd1c5, #38b2ac);
     color: #fff;
     padding: 12px 25px;
     box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
 }

 header h1 {
     font-size: 1.6rem;
     letter-spacing: .5px;
 }

 .navbar {
     display: flex;
     gap: 20px;
     flex-wrap: wrap;
 }

 .navbar a {
     color: #fff;
     text-decoration: none;
     font-weight: 500;
     transition: opacity .3s;
     font-size: 1.2rem;
 }

 .navbar a:hover {
     opacity: .8
 }

 .toggle-theme {
     padding: 6px 10px;
     background: rgba(255, 255, 255, .25);
     border: none;
     border-radius: 6px;
     color: #fff;
     font-weight: 600;
     cursor: pointer;
     transition: .3s;
 }

 .toggle-theme:hover {
     background: rgba(255, 255, 255, .4);
 }

 /* Responsive Navbar */
 .menu-icon {
     display: none;
     font-size: 24px;
     cursor: pointer;
     color: #fff;
     background: rgba(255, 255, 255, 0.25);
     padding: 6px 10px;
     border-radius: 6px;
     transition: .3s;
 }

 .menu-icon:hover {
     background: rgba(255, 255, 255, 0.4);
 }
 .outer-editor{
 margin: 20px;
 
 }

 
 /* ✏️ New spellcheck styles */
 .editor {
     width: 100%;
     max-width: 800px;
     min-height: 250px;
     border: 1px solid #83b6b0;
     border-radius: 10px;
     padding: 10px;
     background: #fff;
     font-size: 16px;
     line-height: 1.6;
     outline: none;
     overflow-y: auto;
     white-space: pre-wrap;

     /* 👇 Add these lines */
     max-height: 400px;
     /* Editor stops growing after this height */
     overflow-y: auto;
     /* Scroll appears inside */
     scrollbar-width: thin;
     /* Slim scrollbar for Firefox */
     scrollbar-color: #38b2ac #e8f9f7;
     /* Custom scrollbar colors */
 }

 .tools{
     padding: 20px;
    }
    /* Optional: pretty scrollbars for Chrome/Edge */
 .editor::-webkit-scrollbar {
     width: 8px;
 }

 .editor::-webkit-scrollbar-track {
     background: #f1f1f1;
     border-radius: 10px;
 }

 .editor::-webkit-scrollbar-thumb {
     background: linear-gradient(135deg, #4fd1c5, #38b2ac);
     border-radius: 10px;
 }

 .editor::-webkit-scrollbar-thumb:hover {
     background: linear-gradient(135deg, #38b2ac, #319795);
    }
    

 .editor span.error-spell {
     text-decoration: underline wavy red;
     cursor: pointer;
 }

 .editor span.error-grammar {
     text-decoration: underline wavy blue;
     cursor: pointer;
 }

 .tooltip {
     position: absolute;
     background: rgba(40, 40, 40, 0.95);
     backdrop-filter: blur(6px);
     color: #fff;
     padding: 10px 12px;
     border-radius: 8px;
     font-size: 14px;
     z-index: 100;
     max-width: 260px;
     box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
     display: none;
     opacity: 0;
     transition: opacity .25s ease;
 }

 .tooltip.visible {
     display: block;
     opacity: 1;
 }

 .tooltip ul {
     margin: 8px 0 0;
     padding: 0;
     list-style: none;
    }

 .tooltip li {
     padding: 4px 0;
     cursor: pointer;
     border-radius: 4px;
     transition: .2s;
 }

 .tooltip li:hover {
     background: rgba(255, 255, 255, 0.15);
    }
    
    .buttons {
     display: flex;
     gap: 10px;
     margin-top: 15px;
    }

 button {
     padding: 10px 15px;
     font-size: 15px;
     background: linear-gradient(135deg, #4fd1c5, #38b2ac);
     color: #fff;
     border: none;
     border-radius: 8px;
     cursor: pointer;
     transition: .3s;
 }

 button:hover {
     transform: translateY(-2px);
     box-shadow: 0 4px 10px rgba(56, 178, 172, 0.4);
 }

 .toast {
     position: fixed;
     bottom: 20px;
     right: 20px;
     background: #333;
     color: #fff;
     padding: 10px 15px;
     border-radius: 6px;
     opacity: 0;
     transition: .3s;
     pointer-events: none;
 }
 @media (max-width: 768px) {
     .navbar {
         position: absolute;
         top: 60px;
         left: 0;
         width: 100%;
         background: linear-gradient(135deg, #4fd1c5, #38b2ac);
         flex-direction: column;
         align-items: center;
         gap: 15px;
         padding: 15px 0;
         display: none;
         box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
         z-index: 999;
         animation: slideDown .3s ease forwards;
     }

     .navbar.active {
         display: flex;
     }

 .outer-editor{
    margin: 10px;
 }
     .menu-icon {
         display: block;
     }

     header {
         position: relative;
         flex-wrap: wrap;
     }
.navbar a{
    font-size: 1rem;
}
     .toggle-theme {
         order: 3;
         margin-top: 10px;
     }
 }

 @keyframes slideDown {
     from {
         opacity: 0;
         transform: translateY(-10px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }


 main {
     flex: 1;
     display: flex;
     flex-direction: column;
     align-items: center;
     padding: 30px 20px;
     gap: 20px
 }

 .main-about {
     max-width: 800px;
     margin: 30px auto;
     padding: 20px;
     background: #fff;
     border-radius: 12px;
     box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
     line-height: 1.7;
 }


 .container {
     width: 100%;
     max-width: 800px;
     background: linear-gradient(180deg, #ffffff, #f9fdfd);
     padding: 0px;
     border-radius: 14px;
     box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
     display: flex;
     flex-direction: column;
 }


 input[type="text"] {
     padding: 10px;
     font-size: 16px;
     border-radius: 8px;
     border: 1px solid #bcdad6;
         /* border: 1px solid #38403f; */
     margin-top: 10px;
     transition: .3s;
     background-color: #ffffff;
 }

 /* 🔧 Tools Section Base */
.tools {
  /* margin-top: 25px; */
  margin: 25px 20px 25px 20px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  /* border: 1px solid #cbe9e6; */
  border: 1px solid #83b6b0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.count {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: #2c7a7b;
}

/* ⚙️ Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
  /* box-shadow: 1px 11px 14px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5); */
      box-shadow: -1px 10px 14px 0px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 20px;
  border-radius: 14px;
}

.action-buttons button {
  background: linear-gradient(135deg, #4fd1c5, #38b2ac);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s;
}

.action-buttons button:hover {
  background: linear-gradient(135deg, #38b2ac, #319795);
  transform: translateY(-2px);
}

/* 🧮 Stats Section */
.stats {
  margin-top: 20px;
  background: #fefefe;
  padding: 16px;
  box-shadow: -1px 10px 14px 0px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  border: 1px solid #cbe9e6;
  font-size: 15px;
  line-height: 1.6;
}


/* 🌤 Refined Light Mode Stats Bar */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px 25px;
  padding: 15px;
  background: linear-gradient(145deg, #f9ffff, #e8f9f7);
  /* border: 1px solid #83b6b0; */
  border-radius: 14px;
  /* border: 1px solid #c2ebe7; */
  margin-bottom: 15px;
      
      box-shadow: -1px 10px 14px 0px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5);
      /* box-shadow: -1px 10px 14px 0px #83b6b0, inset 0 1px 0 rgba(255, 255, 255, 0.5); */
      

  /* box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.5); */
  transition: background 0.4s, box-shadow 0.4s;
}

/* Each stat pill */
.stat-item {
  font-weight: 600;
  color: #2c7a7b;
  background: linear-gradient(145deg, #f3fffe, #dbf4f2);
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid #bfe6e1;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: linear-gradient(145deg, #e4faf8, #c8f1ed);
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(56, 178, 172, 0.2);
}

/* 🌙 Dark Mode remains untouched (already looks great) */
body.dark .stats-bar {
  background: #2b2b2b;
  border-color: #444;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.dark .stat-item {
  background: rgba(49, 151, 149, 0.15);
  color: #b2f5ea;
}


/* ⚙️ Action Buttons Layout */
.action-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0 25px;
}

.action-buttons button {
  background: linear-gradient(135deg, #4fd1c5, #38b2ac);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.action-buttons button:hover {
  background: linear-gradient(135deg, #38b2ac, #319795);
  transform: translateY(-2px);
}

body.dark .action-buttons button {
  background: linear-gradient(135deg, #319795, #2c7a7b);
}

/* 🧭 Responsive Layout */
@media (max-width: 700px) {
  .stats-bar {
    flex-direction: row;
    align-items: center;
    gap: 10px 10px;
  padding: 10px;
    border: none;
box-shadow: 1px 11px 14px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  
  .stat-item {
    /* width: 80%; */
    text-align: center;
  padding: 2px 10px;

  }
}

/* ✨ Extra Stats */
.extra-stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-weight: 500;
}

.extra-stats p {
  background: rgba(79, 209, 197, 0.15);
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.3s;
}

.extra-stats p:hover {
  background: rgba(56, 178, 172, 0.25);
}

/* 🎯 Goal System */
.goal-container {
  margin-top: 22px;
  text-align: center;
  /* padding-bottom: 5px; */
  padding: 0px 15px 5px 15px;
  border-radius: 14px;
  box-shadow: -1px 10px 14px 0px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.goal-container label {
  font-weight: 600;
  color: #2c7a7b;
  margin-right: 8px;
}

#goalInput {
  padding: 6px 10px;
  border: 1px solid #bcdad6;
  border-radius: 6px;
  outline: none;
  width: 120px;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#goalInput:focus {
  border-color: #38b2ac;
  box-shadow: 0 0 5px rgba(56, 178, 172, 0.4);
}

/* Progress Bar */
.goal-progress {
  width: 100%;
  height: 8px;
  background: #a4d4d0;
  margin: 10px 0px 0px 0px;
  border-radius: 6px;
  margin-top: 10px;
  overflow: hidden;
}
.goal-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e53e3e, #f6ad55, #38b2ac);
  background-size: 200% 100%;
  transition: width 0.5s ease, background-position 1s ease;
  border-radius: 6px;
  animation: moveGradient 3s linear infinite;
  box-shadow: 0 0 8px rgba(56, 178, 172, 0.5);
}

/* 🔥 Smooth Gradient Animation */
@keyframes moveGradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

#goalStatus {
  margin-top: 10px;
  font-weight: 600;
  color: #319795;
}

/* 🔍 Find & Replace */
.find-replace {
  margin-top: 25px;
  padding: 20px;
  border-radius: 14px;
  box-shadow: -1px 10px 14px 0px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.dictionary{
    box-shadow: -1px 10px 14px 0px rgb(0 0 0 / 31%), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    padding: 10px;
    margin-top: 10px;
}
#searchWord,
#replaceWord,
#dictInput {
  width: 100%;
  /* max-width: 350px; */
  display: block;
  margin: 10px auto;
  padding: 8px 12px;
  /* border: 1px solid #bcdad6; */
      border: 1px solid #4aa7a5;
  border-radius: 6px;
  outline: none;
  font-size: 15px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#searchWord:focus,
#replaceWord:focus,
#dictInput:focus {
  border-color: #38b2ac;
  box-shadow: 0 0 5px rgba(56, 178, 172, 0.4);
}

.highlight-box {
  background: #f9fafa;
  /* border: 1px dashed #bcdad6; */
      border: 1px solid #4aa7a5;
  padding: 12px;
  border-radius: 8px;
  min-height: 100px;
  white-space: pre-wrap;
  color: #333;
}

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

/* 🌙 Dark Mode */
body.dark .tools {
  background: #2b2b2b;
  border-color: #444;
}

body.dark .count span {
  color: #b2f5ea;
}

body.dark .action-buttons button {
  background: linear-gradient(135deg, #319795, #2c7a7b);
}

body.dark .stats {
  background: #2b2b2b;
  border-color: #444;
}

body.dark #goalInput {
  background: #2c2c2c;
  color: #fff;
  border-color: #3d7c7a;
}

body.dark #goalStatus {
  color: #81e6d9;
}

body.dark .highlight-box {
  background: #3a3a3a;
  color: #eee;
  border-color: #555;
}


 button {
     margin-top: 10px;
     padding: 10px;
     font-size: 16px;
     border-radius: 8px;
     border: none;
     background: linear-gradient(135deg, #4fd1c5, #38b2ac);
     color: #fff;
     font-weight: 600;
     cursor: pointer;
     transition: .3s;
 }

 button:hover {
     transform: translateY(-2px);
     box-shadow: 0 4px 10px rgba(56, 178, 172, 0.4);
 }

 .action-buttons {
     display: flex;
     gap: 10px;
     flex-wrap: wrap;
 }

 .suggestion {
     background: #fff;
     border-radius: 14px;
     padding: 25px;
     max-width: 800px;
     box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
     text-align: center;
     line-height: 1.7;
 }

 .blog-section {
     max-width: 1000px;
     background: #fff;
     border-radius: 14px;
     padding: 25px;
     box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
 }

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

 .blog-card {
     border: 1px solid #cbe9e6;
     border-radius: 10px;
     overflow: hidden;
     background: #f9fdfd;
     transition: .3s;
 }

 .blog-card:hover {
     transform: translateY(-3px);
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
 }

 .blog-card img {
     width: 100%;
     height: 150px;
     object-fit: cover;
 }

 .blog-card h3 {
     padding: 10px;
     font-size: 17px;
     color: #333;
 }

 .blog-card p {
     padding: 0 10px 10px;
     font-size: 14px;
     color: #666;
 }

 a{
    text-decoration: none;
    color: #38b2ac;
    font-weight: 600;
 }

 footer {
     background: linear-gradient(135deg, #4fd1c5, #38b2ac);
     color: #fff;
     padding: 20px 10% 0px 10%;
     display: flex;
     flex-direction: column;
     gap: 25px;
     text-align: center;
 }

 .footer-container {
     display: flex;
     justify-content: space-between;
     flex-wrap: wrap;
     gap: 40px;
 }

 .footer-section {
     flex: 1;
     min-width: 220px;
 }

 .footer-section h4 {
     margin-bottom: 10px;
     font-size: 18px;
     color: #fff;
     border-bottom: 2px solid rgba(255, 255, 255, 0.3);
     display: inline-block;
     padding-bottom: 5px;
 }

 .footer-section a {
     display: flex;
     justify-content: center;
     color: #fff;
     align-items: center;
     text-decoration: none;
     margin: 6px 0;
     font-weight: 500;
     transition: all 0.3s ease;
     padding: 4px;
 }

 .footer-section a:hover {
     color: #e6fdfb;
     transform: translateX(3px);
 }

 .common {
     display: flex;
     align-items: center;
     gap: 6px;
     padding: 5px 0px;
 }

 .copyright {
     border-top: 1px solid rgba(255, 255, 255, 0.2);
     padding: 20px;
     font-size: 16px;
 }

 @media (max-width: 768px) {
     .footer-container {
         flex-direction: column;
         align-items: center;
     }
 }

  @media (max-width: 570px) {
     .suggestion{
         margin: 0px;
     }
     .suggestion-h2{
        padding: 0px;
     }
     .main-about{
        margin: 15px;
     }
 }
   @media (min-width: 571px) {
     /* .suggestion{
         margin: 10px;
     } */
     .suggestion-h2{
        padding:0px 100px;
     }
 }

 form {
     display: flex;
     flex-direction: column;
     gap: 10px
 }

 input,
 textarea {
     padding: 10px;
     font-size: 15px;
     border: 1px solid #38403f;
     border-radius: 8px
 }

 /* 🌙 Dark Mode Styles */
 body.dark {
     background: linear-gradient(145deg, #1b1b1b, #242424);
     color: #f0f0f0;
 }

 body.dark header {
     background: linear-gradient(135deg, #319795, #285e61);
 }

 body.dark .container,
 body.dark .stats,
 body.dark input[type="text "],
 body.dark input[type="email"],
 body.dark textarea,
 body.dark .secure,
 body.dark .editor,
 body.dark .blog-section,
 body.dark .main-about,
 body.dark .suggestion {
     background: #2b2b2b;
     color: #f0f0f0 ;
     border-color: #444;
 }


 body.dark .c-b{
    border: 2px solid #444;
 }

 body.dark .editor,
 body.dark input[type="text"],
 body.dark input::placeholder,
 body.dark textarea::placeholder,
 body.dark input[type="email"],
 body.dark textarea {
     background-color: #3b3b3b;
         border: 1px solid #38403f;
     color: #f0f0f0;
 }


 body.dark main {
     background: #2b2b2b;
     color: #f0f0f0;
     border-color: #444;
 }
 body.dark .active,
 body.dark header {
     background: linear-gradient(135deg, #319795, #285e61);
     
 }


 body.dark .blog-card {
     background: #2c2c2c;
     color: #f0f0f0;
     border-color: #444;
 }

 body.dark .blog-card h3 {
     color: #fff;
 }

 body.dark .blog-card p {
     color: #ccc;
 }

 body.dark button,
 body.dark .toggle-theme {
     background: linear-gradient(135deg, #319795, #2c7a7b);
     color: #fff;
 }

 body.dark footer {
     background: linear-gradient(135deg, #319795, #285e61);
 }
