/* 
  StoneSpark Studio Styles 
*/

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 123, 0, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 216, 255, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-color) 0%, rgba(10, 10, 15, 0.95) 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

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

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

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

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
}

header.scrolled {
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo img {
  height: 48px;
  width: auto;
  /* Glow effect */
  filter: drop-shadow(0 0 8px rgba(255,123,0,0.4));
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-fast);
  box-shadow: var(--glow-primary);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  color: white;
  box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-tertiary), var(--accent-secondary));
  z-index: -1;
  transition: opacity var(--transition-normal);
  opacity: 0;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 123, 0, 0.5);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  border-color: var(--accent-secondary);
  box-shadow: var(--glow-secondary);
  color: var(--accent-secondary);
}

/* Sections */
section {
  padding: 8rem 0;
  position: relative;
}

.section-title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--header-height);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(255, 123, 0, 0.08) 0%, rgba(166, 36, 255, 0.03) 40%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: 1.5rem;
  line-height: 1.1;
  animation: fadeUp 1s ease-out;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 3rem;
  animation: fadeUp 1s ease-out 0.2s backwards;
}

.hero-btns {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  animation: fadeUp 1s ease-out 0.4s backwards;
}

/* Products Section */
.products-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.product-card {
  flex: 1 1 320px;
  max-width: 400px;
  padding: 0;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card-content {
  padding: 2rem;
  flex: 1;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 123, 0, 0.5);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), var(--glow-primary);
}

.product-card:hover::before {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  opacity: 1;
}

.product-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 123, 0, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: all var(--transition-normal);
}

.product-icon img {
  width: 65%;
  height: 65%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  transition: transform var(--transition-normal);
}

.product-card:hover .product-icon {
  background: rgba(15, 15, 20, 0.9);
  color: white;
  box-shadow: var(--glow-primary);
}

.product-card:hover .product-icon img {
  transform: scale(1.1);
}

.product-title {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}

.product-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-link i {
  transition: transform var(--transition-fast);
}

.product-card:hover .product-link i {
  transform: translateX(4px);
}

/* Contact Section */
#contact {
  padding: 4rem 0;
  background: radial-gradient(circle at 50% 100%, rgba(255, 123, 0, 0.05) 0%, transparent 50%);
}

.contact-card {
  padding: 2.5rem 2rem;
  text-align: center;
}

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

.contact-methods {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Documentation Portal */
#docs {
  min-height: 80vh;
}

/* Product Detail Page Header Card */
.product-header-card {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid rgba(255, 123, 0, 0.4);
  border-radius: var(--radius-lg);
  background: rgba(10, 10, 15, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.product-header-icon {
  flex-shrink: 0;
  width: 200px;
  aspect-ratio: 1 / 1;
  background: rgba(5, 5, 8, 0.6);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.product-header-icon img {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(255, 123, 0, 0.3));
}

.product-header-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 1rem 0;
}

.product-title-text {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: #8ce1a6; /* Soft green */
  margin-bottom: 1rem;
  font-weight: 800;
}

.product-desc-text {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 800px;
}

.product-action-btn {
  background: linear-gradient(135deg, rgba(255,123,0,1) 0%, rgba(166,36,255,1) 100%);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.8rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(255,123,0,0.3);
  transition: all var(--transition-normal);
  text-decoration: none;
}

.product-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,123,0,0.5);
  color: white;
}

@media (max-width: 900px) {
  .product-header-card {
    flex-direction: column;
    padding: 1.5rem;
    gap: 2rem;
  }
  .product-header-icon {
    width: 100%;
    height: 250px;
  }
  .product-header-content {
    align-items: center;
    text-align: center;
  }
}

#product-docs {
  padding: 3rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
  width: 100%;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  padding: 1.5rem;
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
}

.docs-sidebar::-webkit-scrollbar {
  width: 6px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 123, 0, 0.3);
  border-radius: var(--radius-full);
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.docs-sidebar h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.docs-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.docs-nav button {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  width: 100%;
}

.docs-nav button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-primary);
}

.docs-nav button.active {
  background: rgba(255, 123, 0, 0.1);
  color: var(--accent-primary);
  border-left: 3px solid var(--accent-primary);
}

.docs-content {
  padding: 3rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  min-height: 500px;
  overflow-x: hidden; /* Prevent horizontal scroll from markdown content */
}

/* Product Page ToC */
@media (max-width: 900px) {
  .prod-toc-sidebar {
    display: none !important;
  }
}

.toc-link:hover {
  color: var(--accent-primary) !important;
}

/* Markdown Styling */
.markdown-body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  display: block;
  overflow-x: auto;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  text-align: left;
}

.markdown-body th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text-main);
}

.markdown-body tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-family: var(--font-heading);
  margin-top: 2em;
  margin-bottom: 1em;
  color: var(--text-main);
}

.markdown-body h1 { font-size: 2.5em; border-bottom: 1px solid var(--border-color); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.8em; }

.markdown-body p { margin-bottom: 1.2em; color: var(--text-muted); }

.markdown-body a { color: var(--accent-secondary); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-secondary);
}

.markdown-body pre {
  background: rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  margin-bottom: 1.5em;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: var(--text-main);
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 1.5em;
  padding-left: 2em;
  color: var(--text-muted);
}

.markdown-body li { margin-bottom: 0.5em; }

.markdown-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.product-hero-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Loader */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}
.loader-circle {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 123, 0, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Footer */
footer {
  padding: 2rem 0;
  background: rgba(5, 5, 8, 0.6);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-info p {
  color: var(--text-muted);
  max-width: 300px;
  margin-top: 1rem;
}

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

.social-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg-surface-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.social-icon:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--glow-primary);
}

.social-icon i {
  transition: transform var(--transition-fast);
}
.social-icon:hover i {
  transform: scale(1.1);
}

.footer-bottom {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

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

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

@keyframes floatDot {
  0% { transform: translateY(0) scale(1); opacity: 0.5; }
  50% { transform: translateY(-20px) scale(1.1); opacity: 0.8; }
  100% { transform: translateY(0) scale(1); opacity: 0.5; }
}

/* Mobile Responsive */
.mobile-nav-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .docs-sidebar {
    position: static;
    padding: 1rem;
    max-height: none;
  }
  .docs-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .docs-nav button {
    width: auto;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
  .docs-content {
    padding: 1.5rem;
    min-height: auto;
  }
  #product-docs {
    padding: 1.5rem !important;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }
}


@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }
  .nav-links {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path var(--transition-normal);
  }
  .nav-links.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  .hero h1 {
    font-size: 2.5rem;
  }
}
