@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #4F46E5;
  --secondary: #9333EA;
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --bg-color: #f3f4f6;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --card-radius: 16px;
  
  --white: #ffffff;
  --error: #ef4444;
  --success: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background Decoration */
body::before, body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
}

body::before {
  top: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: rgba(79, 70, 229, 0.2);
}

body::after {
  bottom: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: rgba(147, 51, 234, 0.2);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Navbar */
.navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  transition: color 0.3s ease;
}

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

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
  min-width: 200px;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 10;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-main);
  transition: background 0.3s ease;
}

.dropdown-menu a:hover {
  background: var(--bg-color);
  color: var(--primary);
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Buttons */
.btn {
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-primary {
  background: var(--gradient);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 5rem 5%;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero .btn-primary {
  font-size: 1.1rem;
  padding: 0.75rem 2rem;
}

/* Sections */
.section {
  padding: 3rem 5%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-main);
}

/* Tools Grid */
.category-block {
  margin-bottom: 3rem;
}

.category-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

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

/* Tool Card (Clean, iLovePDF aesthetic) */
.tool-card {
  background: var(--white);
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.08);
  border-color: #ddd;
}

.tool-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

/* Specific colors for icons to mimic iLovePDF's colorful icons */
.icon-merge { color: #E53935; } /* Red */
.icon-split { color: #f57c00; } /* Orange */
.icon-compress { color: #43A047; } /* Green */
.icon-pdf-word { color: #1E88E5; } /* Blue */
.icon-pdf-excel { color: #43A047; } /* Green */
.icon-delete { color: #D32F2F; } /* Deep Red */
.icon-image-pdf { color: #FBC02D; } /* Yellow/Gold */
.icon-ai { color: #8E24AA; } /* Purple */

.tool-card h3 {
  font-size: 1.4rem;
  color: #222;
  font-weight: 700;
}

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

/* Footer */
.footer {
  margin-top: auto;
  background: var(--white);
  padding: 3rem 5% 1rem;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.02);
}

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

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul a {
  color: var(--text-muted);
  transition: color 0.3s;
}

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

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

.social-icons a {
  color: var(--text-main);
  font-size: 1.25rem;
  transition: color 0.3s;
}

.social-icons a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  color: var(--text-muted);
  border-top: 1px solid #eee;
  margin-top: 2rem;
}

/* Forms (Login/Signup/Contact) */
.form-container {
  max-width: 450px;
  margin: 4rem auto;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 2.5rem;
  box-shadow: var(--glass-shadow);
}

.form-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: rgba(255,255,255,0.8);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.form-container .btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
}

.form-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-footer a {
  color: var(--primary);
  font-weight: 500;
}

/* Tool Pages specific styles */
.tool-workspace {
  background: var(--white);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
  padding: 3rem;
  text-align: center;
  max-width: 800px;
  margin: 2rem auto;
  border: 2px dashed #ccc;
  transition: all 0.3s ease;
  position: relative;
}

.tool-workspace.dragover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.tool-workspace i {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.tool-workspace h2 {
  margin-bottom: 0.5rem;
}

.tool-workspace p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.file-input {
  display: none;
}

/* Utility to show uploaded files */
.file-preview {
  margin-top: 2rem;
  display: none; /* Shown via JS */
  text-align: left;
}

.file-preview ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.file-preview li {
  background: #f9fafb;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-preview li i {
  font-size: 1rem;
  color: var(--primary);
  margin: 0;
}

.remove-file {
  color: var(--error);
  cursor: pointer;
}

.loader {
  display: none;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links, .nav-actions {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--glass-shadow);
  }
  
  .navbar.active .nav-links, .navbar.active .nav-actions {
    display: flex;
  }
  
  .nav-actions {
    top: calc(100% + 200px); /* rough estimate to place below nav-links */
  }

  .mobile-menu-btn {
    display: block;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}
