/* Modern SaaS Design System - AM Agent Matrix Tools */

:root {
  /* Light Theme Variables */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --border-color: rgba(10, 102, 194, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --primary-color: #0A66C2;
  --primary-hover: #004b93;
  --accent-color: #e0f2fe;
  --accent-text: #0369a1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(10, 102, 194, 0.08), 0 4px 6px -2px rgba(10, 102, 194, 0.04);
  --glass-shadow: 0 8px 32px 0 rgba(10, 102, 194, 0.06);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  /* Dark Theme Variables */
  --bg-primary: #090d16;
  --bg-secondary: #0f1420;
  --bg-card: rgba(15, 20, 32, 0.75);
  --border-color: rgba(10, 102, 194, 0.25);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent-color: #0b3b5c;
  --accent-text: #38bdf8;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Base Link Style */
a {
  color: var(--primary-color);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Glassmorphism Classes */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
}

/* Sticky Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.main-header.scrolled {
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none !important;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-text));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.1rem;
}

/* Navigation Links */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-item {
  position: relative;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary-color);
}

/* Dropdown Menu styling */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-toggle::after {
  content: "▾";
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 260px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 0;
  display: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.dropdown-menu a:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
  text-decoration: none;
}

/* Search bar in header */
.header-search {
  position: relative;
  max-width: 180px;
}

.header-search input {
  width: 100%;
  padding: 0.4rem 1rem 0.4rem 2rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

.header-search::before {
  content: "🔍";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0.6;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 0.4rem;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  background: var(--accent-color);
  color: var(--primary-color);
}

/* Mobile Menu Button */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: radial-gradient(circle at 10% 20%, rgba(10, 102, 194, 0.06) 0%, transparent 60%);
  overflow: hidden;
  padding: 5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero-left {
  flex: 1.2;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 20%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  animation: shine 3s infinite linear;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  text-decoration: none;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 150%; }
  100% { left: 150%; }
}

/* Hero Right: 3D rotating objects */
.hero-right {
  flex: 0.8;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 300px;
}

.scene-3d {
  width: 250px;
  height: 250px;
  position: relative;
  perspective: 1000px;
}

.object-container {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  animation: rotate3D 16s infinite linear;
}

.object-3d {
  position: absolute;
  width: 90px;
  height: 90px;
  background: var(--bg-secondary);
  border: 2px solid var(--primary-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(10, 102, 194, 0.15);
  backface-visibility: visible;
}

.obj-pdf {
  transform: translate3d(80px, -40px, 40px);
  border-color: #ef4444;
  color: #ef4444;
}

.obj-jpg {
  transform: translate3d(-80px, 40px, -40px);
  border-color: #10b981;
  color: #10b981;
}

.obj-conversion {
  transform: translate3d(0, 90px, 0);
  border-color: #3b82f6;
  color: #3b82f6;
}

.object-3d i, .object-3d span {
  font-size: 2rem;
  font-weight: 700;
}

.object-3d label {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 4px;
}

@keyframes rotate3D {
  0% { transform: rotateY(0deg) rotateX(15deg); }
  100% { transform: rotateY(360deg) rotateX(15deg); }
}

/* Background floating particles */
.floating-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-circle {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--primary-color);
  filter: blur(100px);
  opacity: 0.12;
}

.glow-1 { top: 10%; right: 20%; }
.glow-2 { bottom: 20%; left: 10%; }

/* Workspace/Tool Container Section */
.workspace-section {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  flex: 1;
}

.workspace-left {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.tool-interface {
  padding: 3rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Interactive Drag & Drop Area */
.dropzone {
  width: 100%;
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  background: rgba(10, 102, 194, 0.01);
  transition: border-color 0.2s, background-color 0.2s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-color);
  background: rgba(10, 102, 194, 0.04);
}

.dropzone-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  color: var(--primary-color);
}

.dropzone input[type="file"] {
  display: none;
}

/* Option fields */
.tool-options {
  width: 100%;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  text-align: left;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.option-group input, .option-group select {
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

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

/* Sidebar Styling */
.sidebar-card {
  padding: 2rem;
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
  letter-spacing: 0.3px;
}

.popular-tools-list, .recent-tools-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.popular-tools-list a, .recent-tools-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}

.popular-tools-list a:hover, .recent-tools-list a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

/* Home Page Categories layout */
.home-categories {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.section-title {
  font-size: 2.25rem;
  text-align: center;
  margin-bottom: 3.5rem;
  font-weight: 800;
}

.category-block {
  margin-bottom: 4rem;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary-color);
  border-left: 4px solid var(--primary-color);
  padding-left: 0.75rem;
}

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

.tool-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  box-sizing: border-box;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-color);
  color: var(--primary-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.tool-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex-grow: 1;
  line-height: 1.5;
}

/* SEO content markup */
.seo-content-section {
  max-width: 1000px;
  margin: 5rem auto;
  padding: 0 2rem;
}

.seo-content-card {
  padding: 4rem;
}

.seo-content-card h2 {
  font-size: 1.85rem;
  margin: 2.5rem 0 1.25rem;
  font-weight: 800;
}

.seo-content-card h3 {
  font-size: 1.35rem;
  margin: 2rem 0 1rem;
  font-weight: 700;
}

.seo-content-card p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.seo-content-card ul, .seo-content-card ol {
  margin-left: 2rem;
  margin-bottom: 1.75rem;
  color: var(--text-secondary);
}

.seo-content-card li {
  margin-bottom: 0.6rem;
}

/* FAQ accordion lists */
.faq-container {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.75rem;
  background: var(--bg-secondary);
  border: none;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.faq-question::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: bold;
}

.faq-item.active .faq-question::after {
  content: "-";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  background: var(--bg-card);
}

.faq-answer p {
  padding: 1.25rem 1.75rem;
  margin: 0;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

/* Premium Footer */
.main-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 5rem 2rem 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr 1.4fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.footer-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--primary-color);
  border-radius: 6px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.footer-socials {
  display: flex;
  gap: 0.75rem;
}

.social-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  font-weight: bold;
  font-size: 0.85rem;
}

.social-icon:hover {
  border-color: transparent;
  color: white;
  transform: translateY(-3px);
}

.social-facebook:hover { background-color: #1877F2; }
.social-x:hover { background-color: #000000; }
.social-instagram:hover { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-linkedin:hover { background-color: #0A66C2; }

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.75px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

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

.newsletter-form input {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  color: var(--text-secondary);
}

/* Tool execution UI panels */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: var(--accent-color);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1.5rem;
  display: none;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

.result-container {
  width: 100%;
  margin-top: 2.5rem;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(10, 102, 194, 0.01);
  display: none;
}

.result-header {
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Responsive queries */
@media (max-width: 1024px) {
  .hero-container {
    flex-direction: column;
    text-align: center;
  }
  .hero-desc {
    margin: 0 auto 2rem;
  }
  .hero-actions {
    justify-content: center;
  }
  .workspace-section {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0.75rem 1rem;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1.5rem 0;
    gap: 0;
  }
  .main-nav.active {
    display: flex;
  }
  .nav-item {
    width: 100%;
    padding: 0.75rem 2rem;
  }
  .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    padding-left: 1.5rem;
    transform: none;
    display: none !important;
  }
  .nav-dropdown.active .dropdown-menu {
    display: block !important;
    opacity: 1;
  }
  .header-search {
    max-width: 100%;
    margin: 0.5rem 2rem;
  }
  .hamburger {
    display: flex;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }
}
