:root {
  /* Colors */
  --primary: #8b5cf6; /* Violet */
  --primary-hover: #7c3aed;
  --secondary: #ef4444; /* Red */
  --secondary-hover: #dc2626;
  --accent: #ddd6fe; /* Soft Violet */
  
  /* Background gradients */
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  
  /* Text */
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-light: #f9fafb;
  
  /* layout */
  --max-width: 1200px;
  --header-height: 70px;
  
  /* Shadows & Transitions */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.5);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--bg-gradient);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Header & Nav */
header {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 100px 0;
  text-align: center;
  overflow: hidden;
}

#particles-js {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: white;
}

/* Sections */
section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--primary);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 30px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Tool Cards */
.tool-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tool-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.tool-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.tool-card h3 {
  font-size: 1.25rem;
  margin-bottom: 15px;
  color: var(--text-main);
}

.tool-card p {
  color: var(--text-muted);
  margin-bottom: 25px;
  flex-grow: 1;
}

.tool-card .btn-primary {
  font-size: 0.95rem;
  padding: 10px 20px;
}

/* Footer */
footer {
  background: #111827;
  color: var(--text-light);
  padding: 60px 0 20px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background: var(--primary);
}

.footer-col p {
  color: #9ca3af;
  margin-bottom: 15px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul a {
  color: #9ca3af;
}

.footer-col ul a:hover {
  color: var(--primary);
  padding-left: 5px;
}

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

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.social-icons a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  font-size: 0.9rem;
}

/* Info Sections */
.info-section {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
}

.info-section h2 {
  color: var(--primary);
  margin-bottom: 20px;
}

.info-section h3 {
  margin: 25px 0 15px;
  color: var(--text-main);
}

.info-section ul, .info-section ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.info-section p {
  margin-bottom: 15px;
  color: var(--text-muted);
}

/* FAQ Section */
.faq-item {
  background: white;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  padding: 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  background: var(--card-bg);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
  color: var(--text-muted);
}

.faq-item.active .faq-answer {
  padding: 20px;
  max-height: 500px;
  border-top: 1px solid #eee;
}

.faq-icon {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* Calculator Wrapper */
.calculator-container {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto 50px;
  border-top: 4px solid var(--primary);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-main);
}

.input-group input, .input-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus, .input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent);
}

.result-box {
  margin-top: 30px;
  padding: 20px;
  background: var(--bg-gradient);
  border-radius: 8px;
  border: 1px solid var(--accent);
  text-align: center;
  display: none; /* hidden initially */
}

.result-box.visible {
  display: block;
  animation: fadeIn 0.5s ease-out;
}

.result-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.error-msg {
  color: var(--secondary);
  font-size: 0.9rem;
  margin-top: 5px;
  display: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 992px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.5rem; }
  .section-title { font-size: 2rem; }
  
  .nav-links {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    gap: 0;
    box-shadow: var(--shadow-md);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.3s ease-out;
  }
  
  .nav-links.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  
  .nav-links a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
  }
  
  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 576px) {
  .footer-grid { grid-template-columns: 1fr; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .calculator-container { padding: 20px; }
}
