/* General Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333; /* Default text color for light theme */
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --input-bg: #ffffff;
  --text-color: #333;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --primary-color-dark: #0056b3;
  padding-top: 80px; /* Increased from 60px to 80px to ensure content starts below header */
}

/* Particle.js Background */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Dark Theme */
body.dark-theme {
  background-color: #000;
  color: #fff;
  --card-bg: #333;
  --border-color: #555;
  --input-bg: #222;
  --text-color: #fff;
  --bg-primary: #222;
  --bg-secondary: #333;
}

body.dark-theme #particles-js {
  background: #000;
}

body.dark-theme header {
  background-color: rgba(0, 0, 0, 0.5);
}

body.dark-theme .tools-section,
body.dark-theme .about-section,
body.dark-theme .contact-section {
  background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .tool-card {
  background-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .contact-section input,
body.dark-theme .contact-section textarea {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.dark-theme .contact-section input::placeholder,
body.dark-theme .contact-section textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .menu-toggle span {
  background-color: #fff;
}

/* Light Theme */
body.light-theme {
  background-color: #f4f4f4;
  color: #333;
}

body.light-theme #particles-js {
  background: #f4f4f4;
}

body.light-theme header {
  background-color: rgba(255, 255, 255, 0.8);
}

body.light-theme .tools-section,
body.light-theme .about-section,
body.light-theme .contact-section {
  background-color: rgba(255, 255, 255, 0.8);
}

body.light-theme .tool-card {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.light-theme .contact-section input,
body.light-theme .contact-section textarea {
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
}

body.light-theme .contact-section input::placeholder,
body.light-theme .contact-section textarea::placeholder {
  color: rgba(0, 0, 0, 0.7);
}

/* Header */
header {
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  min-width: 200px;
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo-img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

.logo h1 {
  margin: 0;
  font-size: 1.5rem;
  color: inherit;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-container {
  flex: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

.nav-links a {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
  padding: 0.5rem;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.nav-links a:hover {
  opacity: 0.8;
}

.nav-links .search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.nav-links .search-bar input {
  padding: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.9);
  color: inherit;
  min-width: 200px;
}

.nav-links .search-bar button {
  padding: 0.5rem 1rem;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.nav-links .search-bar button:hover {
  background-color: #0056b3;
}

.theme-toggle {
  display: flex;
  align-items: center;
}

.theme-toggle button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: inherit;
  padding: 0.5rem;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle button:hover {
  opacity: 0.8;
}

/* Hero Section */
.hero {
  padding: 100px 2rem 4rem;
  text-align: center;
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  background-color: #007bff;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #0056b3;
}

/* Tools Section */
.tools-section {
  padding: 40px 2rem 2rem;
  backdrop-filter: blur(10px);
  margin: 2rem;
  border-radius: 10px;
  position: relative;
  z-index: 1;
}

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

.tool-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tool-card.active {
  border: 2px solid var(--primary-color);
}

.tool-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.tool-card:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* About Section */
.about-section {
  padding: 80px 2rem 3rem;
  text-align: center;
  backdrop-filter: blur(10px);
  margin: 2rem;
  border-radius: 10px;
  position: relative;
  z-index: 1;
}

.about-content {
  max-width: 1200px;
  margin: 0 auto;
}

.about-section h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: inherit;
}

.about-section h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #007bff;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.feature {
  padding: 1.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
}

.feature h4 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #007bff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.feature p {
  font-size: 1rem;
  line-height: 1.6;
}

.about-footer {
  font-size: 1.2rem;
  margin-top: 2rem;
  padding: 1rem;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

/* Dark Theme Adjustments */
body.dark-theme .feature {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .about-section h3,
body.dark-theme .feature h4 {
  color: #3d91ff;
}

/* Mobile Responsiveness for About Section */
@media (max-width: 768px) {
  .about-section {
    padding: 70px 1rem 2rem;
    margin: 1rem;
    padding-top: 80px;
  }

  .about-section h2 {
    font-size: 2rem;
  }

  .about-section h3 {
    font-size: 1.5rem;
  }

  .about-features {
    gap: 1rem;
    margin: 2rem 0;
  }

  .feature {
    padding: 1rem;
  }

  .about-footer {
    font-size: 1.1rem;
    margin-top: 1.5rem;
  }
}

@media (max-width: 480px) {
  .about-section h2 {
    font-size: 1.8rem;
  }

  .about-section h3 {
    font-size: 1.3rem;
  }

  .feature h4 {
    font-size: 1.1rem;
  }

  .feature p {
    font-size: 0.9rem;
  }

  .about-footer {
    font-size: 1rem;
  }
}

/* Contact Section */
.contact-section {
  padding: 80px 2rem 2rem;
  backdrop-filter: blur(10px);
  margin: 2rem;
  border-radius: 10px;
  position: relative;
  z-index: 1;
}

.contact-section form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

.contact-section input,
.contact-section textarea {
  padding: 0.8rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.9);
  color: inherit;
}

.contact-section button {
  padding: 0.8rem;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.contact-section button:hover {
  background-color: #0056b3;
}

/* Footer Styles */
.footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 4rem 2rem 1rem;
  position: relative;
  z-index: 1;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  color: #007bff;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.footer-section p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.8rem;
}

.footer-section ul a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s;
  opacity: 0.8;
}

.footer-section ul a:hover {
  opacity: 1;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  color: inherit;
  font-size: 1.5rem;
  transition: opacity 0.3s;
  opacity: 0.8;
}

.social-links a:hover {
  opacity: 1;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}

.newsletter-form button {
  padding: 0.8rem 1.5rem;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background-color: #0056b3;
}

.footer-bottom {
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  font-size: 0.8rem;
}

.footer-bottom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 0.5px;
  background: rgba(128, 128, 128, 0.2);
}

.footer-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 0.5px;
  background: rgba(128, 128, 128, 0.2);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-color);
  opacity: 0.8;
  text-align: center;
}

.footer-links {
  margin: 0;
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 0;
  justify-content: center;
}

.footer-links a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.8;
  font-size: 0.8rem;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 1;
}

/* Dark Theme Footer Adjustments */
body.dark-theme .footer {
  background: rgba(0, 0, 0, 0.2);
}

body.dark-theme .newsletter-form input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsiveness for Footer */
@media (max-width: 768px) {
  .footer {
    padding: 3rem 1rem 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-bottom {
    padding: 1rem;
    gap: 0.5rem;
  }

  .footer-bottom::before,
  .footer-bottom::after {
    width: 150px;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Mobile Menu Styles */
.mobile-nav {
  display: none;
}

.menu-toggle {
  background: none;
  border: none;
  padding: 8px;
  width: 40px;
  height: 40px;
  position: relative;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 3px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Update Responsive Design */
@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }

  header {
    padding: 0.5rem 1rem;
  }

  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: auto;
  }

  .header-right {
    justify-content: flex-end;
  }

  .theme-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-nav {
    display: block;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
  }

  .nav-container {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    padding: 80px 20px 20px 20px;
    transition: left 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .nav-container.active {
    left: 0;
  }

  body.dark-theme .nav-container {
    background-color: rgba(0, 0, 0, 0.95);
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .nav-links li {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
    text-align: left;
  }

  body.dark-theme .nav-links a,
  body.dark-theme .categories-link {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  body.dark-theme .nav-container {
    background-color: rgba(0, 0, 0, 0.95);
  }

  body.dark-theme .categories-content {
    background: transparent;
  }

  body.dark-theme .categories-content a {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  body.dark-theme .nav-links .search-bar input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  body.dark-theme .nav-links .search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.6);
  }

  .categories-dropdown {
    width: 100%;
  }

  .categories-link {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
  }

  .categories-link.active::after {
    transform: rotate(180deg);
  }

  .categories-content {
    display: none;
    position: static;
    transform: none;
    background: transparent;
    box-shadow: none;
    width: 100%;
    padding-left: 20px;
    margin: 0;
    border-radius: 0;
  }

  .categories-content a {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 15px;
    color: inherit;
  }

  .categories-content a:last-child {
    border-bottom: none;
  }

  body.dark-theme .categories-link {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  body.dark-theme .categories-content {
    background: transparent;
  }

  body.dark-theme .categories-content a {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  .categories-content a:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }

  body.dark-theme .categories-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }

  .nav-links .search-bar {
    width: 100%;
    margin: 15px 0;
    padding: 5px 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .nav-links .search-bar input {
    width: 70%;
    padding: 8px 12px;
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 14px;
    height: 36px;
  }

  .nav-links .search-bar button {
    width: 28%;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    height: 36px;
    background-color: #007bff;
    color: #fff;
    border: none;
  }

  /* Dark theme adjustments for search bar */
  body.dark-theme .nav-links .search-bar input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  header {
    height: 50px;
  }

  .mobile-nav {
    left: 0.5rem;
  }

  .nav-container {
    padding-top: 60px;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 0.8rem;
  }

  .nav-links .search-bar {
    margin: 10px 0;
  }

  .nav-links .search-bar input {
    width: 65%;
    padding: 6px 10px;
    font-size: 13px;
    height: 32px;
  }

  .nav-links .search-bar button {
    width: 32%;
    padding: 6px 10px;
    font-size: 13px;
    height: 32px;
  }

  body {
    padding-top: 50px;
  }
}

/* Categories Dropdown */
.categories-dropdown {
  position: relative;
}

.categories-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.categories-link::after {
  content: '▼';
  font-size: 0.8em;
  margin-left: 0.25rem;
}

.categories-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  z-index: 1002;
  margin-top: 0.5rem;
}

.categories-dropdown:hover .categories-content {
  display: block;
}

.categories-content a {
  color: #333;
  padding: 0.8rem 1rem;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s;
  text-align: left;
  font-weight: normal;
}

.categories-content a:hover {
  background-color: #f5f5f5;
  opacity: 1;
}

/* Dark Theme Adjustments for Categories */
body.dark-theme .categories-content {
  background-color: #222;
}

body.dark-theme .categories-content a {
  color: #fff;
}

body.dark-theme .categories-content a:hover {
  background-color: #333;
}

/* Mobile Responsiveness Updates */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 1rem;
    gap: 0;
  }

  .categories-content {
    position: static;
    transform: none;
    background: transparent;
    box-shadow: none;
    margin-top: 0;
    width: 100%;
  }

  .categories-content a {
    text-align: center;
    padding: 0.8rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  }

  body.dark-theme .categories-content {
    background: transparent;
  }

  body.dark-theme .categories-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* Policy Pages Styles */
.policy-content {
  max-width: 1000px;
  margin: 80px auto 2rem;
  padding: 2rem;
}

.policy-section {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 3rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.policy-section h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #007bff;
}

.last-updated {
  color: #666;
  font-style: italic;
  margin-bottom: 2rem;
}

.policy-block {
  margin-bottom: 2.5rem;
}

.policy-block h2 {
  font-size: 1.8rem;
  color: #007bff;
  margin-bottom: 1.5rem;
}

.policy-block h3 {
  font-size: 1.3rem;
  color: #333;
  margin: 1.5rem 0 1rem;
}

.policy-block p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.policy-block ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.policy-block ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.cookie-table th,
.cookie-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.cookie-table th {
  background-color: rgba(0, 123, 255, 0.1);
  font-weight: bold;
}

/* Dark Theme Adjustments for Policy Pages */
body.dark-theme .policy-section {
  background: rgba(0, 0, 0, 0.2);
}

body.dark-theme .last-updated {
  color: #999;
}

body.dark-theme .policy-block h3 {
  color: #fff;
}

body.dark-theme .cookie-table th {
  background-color: rgba(0, 123, 255, 0.2);
}

body.dark-theme .cookie-table th,
body.dark-theme .cookie-table td {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsiveness for Policy Pages */
@media (max-width: 768px) {
  .policy-content {
    padding: 1rem;
    margin-top: 60px;
  }

  .policy-section {
    padding: 2rem 1.5rem;
  }

  .policy-section h1 {
    font-size: 2rem;
  }

  .policy-block h2 {
    font-size: 1.5rem;
  }

  .policy-block h3 {
    font-size: 1.2rem;
  }

  .cookie-table {
    display: block;
    overflow-x: auto;
  }

  .cookie-table th,
  .cookie-table td {
    padding: 0.8rem;
    min-width: 120px;
  }
}

/* Dark Theme Adjustments */
body.dark-theme .nav-links .search-bar input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Tool Category Styles */
.tool-category {
  margin-bottom: 4rem;
}

.tool-category h3 {
  font-size: 2rem;
  color: #007bff;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0, 123, 255, 0.2);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.tool-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tool-card.active {
  border: 2px solid var(--primary-color);
}

.tool-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.tool-card:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.tool-card h4 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 1rem;
}

.tool-card p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Dark Theme Adjustments */
body.dark-theme .tool-category h3 {
  color: #3d91ff;
}

body.dark-theme .tool-card {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .tool-card h4 {
  color: #fff;
}

body.dark-theme .tool-card p {
  color: rgba(255, 255, 255, 0.8);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .tool-category {
    margin-bottom: 3rem;
  }

  .tool-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .tool-card {
    padding: 1.25rem;
  }

  .tool-card h4 {
    font-size: 1.1rem;
  }

  .tool-card p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .tool-category {
    margin-bottom: 2rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tool-card {
    padding: 1rem;
  }
}

/* Tool Container Styles */
.main-content {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: none;
  position: relative;
  top: 0;
  scroll-margin-top: 80px; /* Add space for fixed header */
}

.main-content:not(:empty) {
  display: block;
}

/* Tool Interface Styles */
.tool-interface {
  max-width: 800px;
  margin: 0.5rem auto;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-interface h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.tool-interface p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.tool-interface form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-interface textarea {
  width: 100%;
  min-height: 200px;
  padding: 15px;
  margin: 15px 0;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tool-interface textarea:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

body.dark-theme .tool-interface textarea {
  background: #1a1a1a;
  border-color: #404040;
  color: #fff;
}

body.dark-theme .tool-interface textarea:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.tool-interface select {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
  color: var(--text-color);
}

.tool-interface button {
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.tool-interface button:hover {
  background-color: var(--primary-hover);
}

.tool-interface .button-group {
  display: flex;
  gap: 1rem;
}

.tool-interface .options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.tool-interface .options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-interface .result {
  display: flex;
  gap: 1rem;
}

.tool-interface .result input {
  flex: 1;
}

.tool-interface .count-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 4px;
}

.tool-interface .count-results div {
  text-align: center;
}

.tool-interface .count-results span {
  font-weight: bold;
  color: var(--primary-color);
}

/* Dark theme adjustments */
[data-theme="dark"] .tool-interface {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .tool-interface textarea,
[data-theme="dark"] .tool-interface input[type="text"],
[data-theme="dark"] .tool-interface input[type="number"],
[data-theme="dark"] .tool-interface select {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    padding-top: 60px; /* Adjusted for mobile */
  }
  
  .main-content {
    scroll-margin-top: 60px;
  }
  
  .tool-interface {
    margin: 0 auto;
    padding: 1rem;
    width: calc(100% - 2rem);
    max-width: 100%;
  }

  .tool-interface textarea,
  .tool-interface input[type="text"],
  .tool-interface input[type="number"],
  .tool-interface select {
    width: 90%;
    margin: 0 auto;
    display: block;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    border-radius: 4px;
    font-size: 16px;
  }

  body.dark-theme .tool-interface textarea,
  body.dark-theme .tool-interface input[type="text"],
  body.dark-theme .tool-interface input[type="number"],
  body.dark-theme .tool-interface select {
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
  }

  .tool-interface textarea:focus,
  .tool-interface input:focus,
  .tool-interface select:focus {
    outline: none;
    border-color: var(--primary-color);
  }

  .tool-interface form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .tool-interface textarea {
    min-height: 150px;
  }

  .tool-interface select {
    width: 90%;
    height: 45px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
  }

  .tool-interface button {
    width: 90%;
    padding: 12px;
    font-size: 16px;
    margin: 0.5rem auto;
    height: 45px;
    border-radius: 4px;
  }
}

@media (max-width: 480px) {
  .tool-interface {
    margin: 0.5rem auto;
    padding: 0.75rem;
  }

  .tool-interface textarea,
  .tool-interface input[type="text"],
  .tool-interface input[type="number"],
  .tool-interface select,
  .tool-interface button {
    width: 95%;
  }
}

/* Text Diff Checker Styles */
.diff-inputs {
    display: flex;
    flex-direction: row;
    gap: 24px;
    width: 100%;
    margin-bottom: 24px;
    align-items: flex-start;
    justify-content: center;
}

.diff-input {
    width: 45%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.diff-input label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.diff-input textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 1px solid #000;
    border-radius: 0;
    background-color: #fff;
    color: #000;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.diff-input textarea:focus {
    outline: none;
    border-color: #000;
    background-color: #fff;
}

body.dark-theme .diff-input textarea {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

body.dark-theme .diff-input textarea:focus {
    border-color: #666;
    background-color: #333;
}

.tool-interface button.compare-btn {
    width: auto;
    min-width: 120px;
    padding: 8px 16px;
    font-size: 14px;
    margin: 24px 0;
    height: auto;
    border-radius: 0;
    display: block;
    background-color: #fff;
    color: #000;
    border: 1px solid #000;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-interface button.compare-btn:hover {
    background-color: #000;
    color: #fff;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .diff-inputs {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 16px;
    }

    .diff-input {
        width: 100%;
        align-items: center;
    }

    .diff-input textarea {
        width: 85%;
        min-height: 120px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }

    .tool-interface button.compare-btn {
        width: 85%;
        margin: 16px auto;
        border-radius: 4px;
        background-color: var(--primary-color);
        color: white;
        border: none;
    }

    .tool-interface button.compare-btn:hover {
        background-color: var(--primary-hover);
    }
}

/* Text Encoder/Decoder Styles */
.encoder-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.encoder-options select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-color);
    font-size: 1rem;
}

.encoder-options .button-group {
    display: flex;
    gap: 0.5rem;
}

.encoder-options button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.encoder-options button:hover {
    background: var(--primary-color-dark);
}

#copy-encoded {
    align-self: flex-end;
    margin-top: 1rem;
}

/* Dark theme adjustments */
body.dark-theme .encoder-options select {
    background: var(--bg-primary);
    color: var(--text-color);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .encoder-options {
        flex-direction: column;
    }
    
    .encoder-options .button-group {
        width: 100%;
    }
    
    .encoder-options button {
        flex: 1;
    }
}

/* Image Converter Styles */
.converter-options {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.quality-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quality-option input[type="range"] {
    flex: 1;
}

#converter-preview {
    margin: 1rem 0;
    text-align: center;
}

#converter-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Image Compressor Styles */
.compressor-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.size-option {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.size-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-option input[type="number"] {
    width: 100px;
}

.compression-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 4px;
}

#compressor-preview {
    margin: 1rem 0;
    text-align: center;
}

#compressor-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Color Picker Styles */
.picker-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.picker-mode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#color-picker-preview {
    margin: 1rem 0;
    text-align: center;
}

#color-picker-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
}

#color-picker-canvas {
    display: none;
}

#color-picker-section {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

#color-picker {
    width: 100px;
    height: 100px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.color-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.color-values input {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.color-palette {
    margin-top: 1rem;
}

#color-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.color-box {
    width: 100%;
    height: 100px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.color-box:hover {
    transform: scale(1.05);
}

/* Dark theme adjustments */
.dark-theme .compression-info,
.dark-theme .color-values input {
    background-color: var(--bg-primary);
}

.dark-theme #color-picker {
    border: 2px solid var(--border-color);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .converter-options,
    .compressor-options,
    .picker-options {
        flex-direction: column;
    }

    .size-option {
        flex-direction: column;
    }

    .color-values {
        grid-template-columns: 1fr;
    }

    #color-palette-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* QR Code Generator Styles */
.tool-interface #qr-code-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.tool-interface #qr-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
}

.tool-interface .qr-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.tool-interface .qr-options > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-interface .qr-options label {
    font-weight: 500;
}

.tool-interface .qr-options select,
.tool-interface .qr-options input[type="color"] {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* Override select color in dark theme */
.dark-theme .tool-interface #qr-code-form select {
    background-color: #ffffff;
    color: #000000;
}

.tool-interface #qr-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.tool-interface #qr-code {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 300px;
    margin: 0 auto;
}

.tool-interface #qr-code img,
.tool-interface #qr-code canvas {
    display: block;
    max-width: 250px;
    height: auto;
}

.tool-interface #qr-code .error-message {
    color: #ff3333;
    text-align: center;
    padding: 20px;
    background-color: #fff5f5;
    border-radius: 4px;
    margin: 10px 0;
}

.tool-interface #download-qr {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.tool-interface #download-qr:hover {
    background-color: var(--primary-color-dark);
}

/* QR Code Generator Loading Styles */
.qr-loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: var(--text-color);
}

.qr-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: qr-spin 1s linear infinite;
}

@keyframes qr-spin {
    to {
        transform: rotate(360deg);
    }
}

.tool-interface #qr-code.loading .qr-loading {
    display: block;
}

/* UUID Generator Styles */
.tool-interface #uuid-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.tool-interface .uuid-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.tool-interface .uuid-options > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-interface .uuid-options label {
    font-weight: 500;
}

.tool-interface .uuid-options select,
.tool-interface .uuid-options input[type="number"] {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
}

.tool-interface #uuid-output {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: monospace;
    resize: vertical;
    margin-top: 20px;
}

.tool-interface #copy-uuids {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.tool-interface #copy-uuids:hover {
    background-color: var(--primary-color-dark);
}

body.dark-theme .tool-interface #uuid-form select {
    background-color: #ffffff;
    color: #000000;
}

@media (max-width: 768px) {
    .tool-interface .uuid-options {
        grid-template-columns: 1fr;
    }
    
    .tool-interface #uuid-output {
        font-size: 14px;
    }
}

/* Hash Generator Styles */
.tool-interface #hash-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.tool-interface .hash-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.tool-interface .hash-options > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-interface .hash-options label {
    font-weight: 500;
}

.tool-interface .hash-options select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
}

.tool-interface #hash-output {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: monospace;
    resize: vertical;
    margin-top: 20px;
}

.tool-interface #copy-hash {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.tool-interface #copy-hash:hover {
    background-color: var(--primary-color-dark);
}

body.dark-theme .tool-interface #hash-form select {
    background-color: #ffffff;
    color: #000000;
}

@media (max-width: 768px) {
    .tool-interface .hash-options {
        grid-template-columns: 1fr;
    }
    
    .tool-interface #hash-output {
        font-size: 14px;
    }
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: var(--hover-color);
}

.result-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.result-description {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.search-bar {
    position: relative;
}

/* Scientific Calculator Styles */
.calculator {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  margin: 0 auto;
}

.calc-display {
  background: var(--bg-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calc-expression {
  color: var(--text-secondary);
  font-size: 0.9em;
  min-height: 20px;
  margin-bottom: 5px;
  word-wrap: break-word;
}

#calc-display {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.8em;
  color: var(--text-color);
  text-align: right;
  outline: none;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.calc-btn {
  padding: 15px;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-color);
  color: var(--text-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.calc-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calc-btn.function {
  background: var(--primary-color);
  color: white;
}

.calc-btn.operator {
  background: var(--secondary-color);
  color: white;
}

.calc-btn.clear {
  background: #ff5555;
  color: white;
}

.calc-btn.equals {
  background: #4CAF50;
  color: white;
  grid-column: span 4;
}

/* Dark theme adjustments */
.dark-theme .calculator {
  background: var(--card-bg);
}

.dark-theme .calc-display {
  background: var(--bg-color);
}

.dark-theme .calc-btn {
  background: var(--bg-color);
  color: var(--text-color);
}

.dark-theme .calc-btn.function {
  background: var(--primary-color);
}

.dark-theme .calc-btn.operator {
  background: var(--secondary-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

body.dark-theme .modal-content {
    background-color: #1a1a1a;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-theme .close-modal {
    color: #999;
}

body.dark-theme .close-modal:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
        max-height: 90vh;
    }
}

.tool-container .result-area {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tool-container .result-area:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

body.dark-theme .tool-container .result-area {
    background: #1a1a1a;
    border-color: #404040;
    color: #fff;
}

body.dark-theme .tool-container .result-area:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

@media (max-width: 768px) {
    .tool-container .result-area {
        min-height: 150px;
        padding: 12px;
    }
}

.tool-container textarea#text-input {
    width: 96%;
    max-width: 96%;
    min-width: 0;
    display: block;
    margin: 0 auto 18px auto;
    min-height: 120px;
    height: 120px;
    font-size: 18px;
    padding: 18px;
    background: #181818;
    color: #fff;
    border: 2.5px solid #444;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tool-container textarea#text-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    outline: none;
}

@media (max-width: 600px) {
    .tool-container textarea#text-input {
        width: 98%;
        max-width: 98%;
        min-height: 80px;
        height: 80px;
        font-size: 16px;
        padding: 12px;
    }
}

.tool-container textarea#result {
    width: 96%;
    max-width: 96%;
    min-width: 0;
    display: block;
    margin: 0 auto 18px auto;
    min-height: 120px;
    height: 120px;
    font-size: 18px;
    padding: 18px;
    background: #181818;
    color: #fff;
    border: 2.5px solid #444;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tool-container textarea#result:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    outline: none;
}

@media (max-width: 600px) {
    .tool-container textarea#result {
        width: 98%;
        max-width: 98%;
        min-height: 80px;
        height: 80px;
        font-size: 16px;
        padding: 12px;
    }
}

.tool-container#loremIpsumGenerator-result,
.tool-container .result-area {
    width: 96%;
    max-width: 96%;
    min-width: 0;
    display: block;
    margin: 0 auto 18px auto;
    min-height: 120px;
    font-size: 18px;
    padding: 18px;
    background: #181818;
    color: #fff;
    border: 2.5px solid #444;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: border-color 0.3s, box-shadow 0.3s;
    word-break: break-word;
    white-space: pre-line;
}

@media (max-width: 600px) {
    .tool-container#loremIpsumGenerator-result,
    .tool-container .result-area {
        width: 98%;
        max-width: 98%;
        min-height: 80px;
        font-size: 16px;
        padding: 12px;
    }
}

.tool-container:has(#image-input) {
    background: #23272f;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 32px 24px 28px 24px;
    margin: 0 auto 32px auto;
    max-width: 480px;
}

.tool-container .input-group,
.tool-container .dimensions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
    align-items: center;
}

.tool-container .dimensions input[type="number"] {
    width: 120px;
    padding: 10px;
    border-radius: 6px;
    border: 1.5px solid #444;
    background: #181818;
    color: #fff;
    font-size: 15px;
}

.tool-container input[type="file"] {
    background: #181818;
    color: #fff;
    border-radius: 6px;
    border: 1.5px solid #444;
    padding: 10px;
    font-size: 15px;
    margin-bottom: 10px;
}

.tool-container button {
    margin-top: 10px;
    margin-bottom: 18px;
    padding: 12px 28px;
    border-radius: 8px;
    background: #007bff;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    margin-right: 14px;
}

.tool-container button:last-child {
    margin-right: 0;
}

.tool-container button:hover {
    background: #0056b3;
}

.preview-container {
    margin-top: 18px;
    text-align: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.13);
}

#download-link {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 22px;
    background: #28a745;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
}

#download-link:hover {
    background: #218838;
}

@media (max-width: 600px) {
    .tool-container:has(#image-input) {
        padding: 16px 4px 16px 4px;
        max-width: 99vw;
    }
    .tool-container .dimensions input[type="number"] {
        width: 90px;
        font-size: 14px;
    }
    .tool-container button {
        padding: 10px 12px;
        font-size: 15px;
        margin-right: 8px;
    }
    #download-link {
        padding: 8px 10px;
        font-size: 14px;
    }
}

.tool-container textarea#cleaner-input {
    width: 96%;
    max-width: 96%;
    min-width: 0;
    display: block;
    margin: 0 auto 18px auto;
    min-height: 120px;
    height: 120px;
    font-size: 18px;
    padding: 18px;
    background: #181818;
    color: #fff;
    border: 2.5px solid #444;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tool-container textarea#cleaner-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    outline: none;
}

@media (max-width: 600px) {
    .tool-container textarea#cleaner-input {
        width: 98%;
        max-width: 98%;
        min-height: 80px;
        height: 80px;
        font-size: 16px;
        padding: 12px;
    }
}

.tool-container textarea#cleaner-result {
    width: 96%;
    max-width: 96%;
    min-width: 0;
    display: block;
    margin: 0 auto 18px auto;
    min-height: 120px;
    height: 120px;
    font-size: 18px;
    padding: 18px;
    background: #181818;
    color: #fff;
    border: 2.5px solid #444;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tool-container textarea#cleaner-result:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    outline: none;
}

@media (max-width: 600px) {
    .tool-container textarea#cleaner-result {
        width: 98%;
        max-width: 98%;
        min-height: 80px;
        height: 80px;
        font-size: 16px;
        padding: 12px;
    }
}

.tools-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
  text-align: center;
}

/* Color Picker Styles */
.color-picker-tool {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 350px;
  margin: 0 auto;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.color-picker-tool .input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-picker-tool label {
  font-weight: 500;
  color: var(--text-color);
}

.color-picker-tool input[type="color"] {
  width: 100%;
  height: 60px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.color-picker-tool input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-tool input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.color-picker-tool input[type="color"]::-moz-color-swatch-wrapper {
  padding: 0;
}

.color-picker-tool input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 8px;
}

.color-display {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.color-display input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1em;
  text-align: center;
  cursor: text;
}

.color-display input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Dark theme adjustments */
.dark-theme .color-picker-tool {
  background: var(--card-bg);
}

.dark-theme .color-picker-tool input[type="color"] {
  border-color: var(--border-color);
}

.dark-theme .color-display input[type="text"] {
  background: var(--input-bg);
  color: var(--text-color);
}

.dark-theme .color-display input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .color-picker-tool {
    padding: 15px;
    gap: 15px;
  }

  .color-picker-tool input[type="color"] {
    height: 50px;
  }

  .color-display input[type="text"] {
    padding: 8px;
    font-size: 0.9em;
  }
}

/* Contact Form Styles */
.contact-form {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  margin-bottom: 0;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  background: var(--primary-hover);
}

/* Dark theme specific styles */
.dark-theme .contact-form {
  background: var(--card-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.dark-theme .form-group input,
.dark-theme .form-group textarea {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

.dark-theme .form-group input::placeholder,
.dark-theme .form-group textarea::placeholder {
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .modal-content {
    width: 98vw !important;
    max-width: 98vw !important;
    padding: 8px !important;
    margin: 8px auto !important;
    box-sizing: border-box;
  }
  .tool-container {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px !important;
  }
  .tool-container textarea,
  .tool-container .result-area {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 15px !important;
    padding: 10px !important;
  }
  .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px !important;
    justify-content: center;
    margin-bottom: 10px;
  }
  .button-group button {
    flex: 1 1 45%;
    min-width: 120px;
    margin-bottom: 6px;
    font-size: 15px;
    padding: 10px 0;
  }
}