/* Base Reset & Variables */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --bg-dark: #022c22;
  --bg-darker: #011a13;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #064e3b;
  --glass-bg: rgba(6, 78, 59, 0.4);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-darker);
  color: var(--text-light);
  line-height: 1.6;
}

/* Glassmorphism Navigation */
.glass-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 1.5rem;
  background: rgba(1, 26, 19, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#mobile-menu-btn {
  display: none;
  background: #064e3b;
  color: white;
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

#mobile-menu {
  display: none;
  background: rgba(1, 26, 19, 0.98);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
  margin-top: 0.75rem;
}

#mobile-menu.show {
  display: block !important;
}

#mobile-menu a {
  display: block;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(6, 78, 59, 0.3);
  font-size: 0.95rem;
  transition: color 0.2s;
}

#mobile-menu a:hover {
  color: var(--primary);
}

@media (max-width: 900px) {
  #desktop-nav {
    display: none !important;
  }
  #mobile-menu-btn {
    display: block !important;
  }
}

/* Hero Section */
.hero-gradient {
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  position: relative;
  overflow: hidden;
}

/* Quick Answer SGE Box */
.quick-answer-box {
  background: var(--glass-bg);
  border: 1px solid var(--primary);
  border-left: 4px solid var(--primary);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Code Copy Card */
.code-card {
  background: linear-gradient(145deg, #064e3b, #022c22);
  border: 1px solid var(--primary);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.code-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.4);
}

/* Pulse Animation */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Blog Content Styles */
.spoke-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0;
}

.spoke-card {
  display: block;
  background: rgba(6,78,59,0.3);
  border: 1px solid #065f46;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.spoke-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.spoke-card img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid #065f46;
}

.spoke-card-content {
  padding: 1.25rem;
}

.hidden-card {
  display: none !important;
}

.blog-article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.blog-body h2 {
  font-size: 1.8rem;
  color: #34d399;
  margin: 2.5rem 0 1rem 0;
  font-weight: 800;
}

.blog-body h3 {
  font-size: 1.4rem;
  color: #a7f3d0;
  margin: 2rem 0 0.75rem 0;
}

.blog-body p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #cbd5e1;
}

.blog-body ul, .blog-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: #cbd5e1;
  font-size: 1.1rem;
}

.blog-body li {
  margin-bottom: 0.5rem;
}

.blog-tip-box {
  background: rgba(6, 78, 59, 0.5);
  border-left: 4px solid #fbbf24;
  padding: 1.25rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 2rem 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--glass-bg);
  border-radius: 0.5rem;
  overflow: hidden;
}

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

th {
  background: #064e3b;
  color: var(--text-light);
  font-weight: 700;
}

/* Toast */
#toast {
  visibility: hidden;
  min-width: 250px;
  background-color: var(--primary);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 16px;
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#toast.show {
  visibility: visible;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}

/* Mobile Utilities */
.hidden { display: none !important; }

/* Sticky CTA Mobile */
.sticky-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(2, 44, 34, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-top: 1px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
}

/* --- RESPONSIVE MOBILE CSS --- */

@media (max-width: 768px) {
  .spoke-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .spoke-card-content {
    padding: 0.75rem;
  }
  .spoke-card-content h3 {
    font-size: 0.9rem !important;
    margin-bottom: 0.25rem !important;
  }
  .spoke-card-content p {
    font-size: 0.75rem !important;
    line-height: 1.4;
  }
  
  .hero-gradient h1 {
    font-size: 2rem !important;
  }
  
  .hero-gradient {
    padding: 2rem 1rem !important;
  }

  .quick-answer-box {
    padding: 1rem;
  }

  .blog-article-container {
    padding: 1rem;
  }

  .blog-body h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem 0;
  }

  footer {
    padding: 2rem 1rem !important;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1rem !important;
  }
}

/* --- AI CHAT UI --- */
#ai-chat-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

#ai-chat-btn:hover {
  transform: scale(1.1);
}

#ai-chat-window {
  position: fixed;
  bottom: 150px;
  right: 20px;
  width: 350px;
  height: 450px;
  background: rgba(1, 26, 19, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--primary);
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

#ai-chat-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-header {
  background: var(--primary-dark);
  padding: 1rem;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.chat-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.msg.user {
  background: #064e3b;
  align-self: flex-end;
  border-bottom-right-radius: 0.2rem;
}

.msg.ai {
  background: rgba(255, 255, 255, 0.1);
  align-self: flex-start;
  border-bottom-left-radius: 0.2rem;
}

.chat-input-area {
  display: flex;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
}

#chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
  outline: none;
}

#chat-send {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 700;
}

