/* 1. Variables and Theming */
:root {
  --primary-color: #1a2b4b; /* Deep Navy */
  --accent-color: #007bff; /* Vibrant Blue */
  --accent-hover-color: #0056b3;
  --background-color: #f8f9fa; /* Light Gray */
  --text-color: #212529; /* Dark Charcoal */
  --card-bg-color: #ffffff;
  --nav-text-color: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.07);
  --border-radius: 10px;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Lato', sans-serif;
}

[data-theme="dark"] {
  --primary-color: #ffffff;
  --accent-color: #009eff; /* Lighter Blue for Dark Mode */
  --accent-hover-color: #007bff;
  --background-color: #121212;
  --text-color: #e0e0e0;
  --card-bg-color: #1e1e1e;
  --nav-text-color: #121212;
  --shadow-color: rgba(0, 0, 0, 0.25);
}

/* 2. Global Styles & Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: clamp(15px, 1.5vw, 17px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--primary-color);
  font-weight: 700;
}

/* 3. Accessibility */
.skip-link {
  position: absolute;
  top: -50px;
  left: 0;
  background: var(--accent-color);
  color: #fff;
  padding: 10px 20px;
  z-index: 10001;
  transition: top 0.3s ease-in-out;
}

.skip-link:focus {
  top: 0;
}

/* 4. Header and Navigation */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: var(--card-bg-color);
  z-index: 1000;
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: background-color 0.3s;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.logo {
  font-size: 1.25rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo i {
  color: var(--accent-color);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#nav-menu {
  list-style: none;
}

#nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: color 0.3s, background-color 0.3s;
}

#nav-menu a:hover,
#nav-menu a:focus {
  color: var(--accent-color);
  outline: none;
}

.menu-toggle, .theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, color 0.3s;
}

.theme-toggle:hover {
  background-color: var(--background-color);
}

.menu-toggle {
  display: none;
}

/* 5. Main Content and Sections */
main {
  padding: 3rem 1.5rem;
}

section {
  max-width: 800px;
  margin: 3rem auto;
}

/* 6. Tool Card Styling */
.tool-card {
  background-color: var(--card-bg-color);
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: 0 8px 30px var(--shadow-color);
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
  text-align: center;
}

#tool-heading {
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.tool-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--accent-color);
  font-weight: 400;
}

.tool-desc {
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.85;
}

#installation-guide h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.tool-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
}

code {
  background-color: var(--background-color);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
}

/* 7. Buttons */
.btn {
  background-image: linear-gradient(45deg, var(--accent-color) 0%, var(--accent-hover-color) 100%);
  color: #fff;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
}

.btn:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 4px;
}

/* 8. Footer */
footer {
  background-color: var(--card-bg-color);
  color: var(--text-color);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
  border-top: 1px solid var(--shadow-color);
  transition: background-color 0.3s, color 0.3s;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-section h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-links a {
  color: var(--text-color);
  font-size: 1.8rem;
  transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
  color: var(--accent-color);
  transform: scale(1.1);
}

.copyright {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--shadow-color);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* 9. Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--accent-color);
  color: #fff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--accent-hover-color);
  transform: translateY(-5px);
}

/* 10. Responsive Design */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    z-index: 1002;
  }
  
  #nav-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--card-bg-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
  }

  #nav-menu.active {
    display: flex;
  }
  
  #nav-menu a {
    font-size: 1.5rem;
  }

  .tool-card {
    padding: 2rem 1.5rem;
  }
}
