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

:root {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #10b981;
  --accent-hover: #059669;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Header & Navigation */
header {
  border-bottom: 1px solid var(--border);
  background-color: rgba(9, 13, 22, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo img {
  height: 32px;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-primary);
}

.cta-button {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  max-width: 900px;
  margin: 4rem auto 2rem auto;
  text-align: center;
  padding: 0 1.5rem;
}

.badge {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-family: var(--font-title);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Dashboard Container */
.dashboard-container {
  max-width: 1200px;
  margin: 2rem auto 6rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Menu */
.sidebar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  align-self: start;
}

.sidebar-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  padding-left: 0.5rem;
}

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

.menu-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.2s, color 0.2s;
  margin-bottom: 0.25rem;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.menu-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Main Viewport Content */
.content-area {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  min-height: 500px;
}

.tool-section {
  display: none;
}

.tool-section.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

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

.tool-header {
  margin-bottom: 2rem;
}

.tool-header h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.submit-btn {
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

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

.submit-btn:disabled {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Results & Previews */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

.result-panel {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

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

.result-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.output-container {
  flex-grow: 1;
  min-height: 200px;
  background-color: #0b0f19;
  border-radius: 6px;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #a5b4fc;
}

.output-container.markdown-rendered {
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Canvas Mockup Style */
#mockup-canvas-wrapper {
  background-color: #020617;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  min-height: 300px;
  position: relative;
  overflow: hidden;
}

#mockup-canvas {
  max-width: 100%;
  max-height: 350px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 4px;
}

/* Live Preview Frame for HTML maker */
.preview-frame-container {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  height: 100%;
  min-height: 350px;
  overflow: hidden;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  min-height: 350px;
  border: none;
}

/* Rate Limit Badge */
.rate-limit-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.75rem;
}

/* Footer Section */
footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg-secondary);
  padding: 5rem 1.5rem;
  text-align: center;
}

.footer-cta h2 {
  font-family: var(--font-title);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.footer-cta p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem auto;
  font-size: 1.1rem;
}

.footer-credits {
  margin-top: 4rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}
