/* Ploinky Documentation - WhatsApp-inspired Theme */

:root {
  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f0f2f5;
  --bg-tertiary: #e9ebee;
  --bg-header: #00a884;
  --bg-header-dark: #008069;
  --bg-message-out: #d9fdd3;
  --bg-message-in: #ffffff;
  --bg-code: #f4f4f5;
  --bg-hover: #f5f6f6;
  --bg-active: #e9ebee;
  
  --text-primary: #111b21;
  --text-secondary: #667781;
  --text-tertiary: #8696a0;
  --text-header: #ffffff;
  --text-link: #00a884;
  --text-code: #d73502;
  
  --border-primary: #e9edef;
  --border-secondary: #d1d7db;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.16);
  
  --accent-green: #25d366;
  --accent-blue: #34b7f1;
  --accent-red: #ea4335;
  --accent-yellow: #fbbc04;
}

[data-theme="dark"] {
  /* Dark theme colors */
  --bg-primary: #111b21;
  --bg-secondary: #202c33;
  --bg-tertiary: #2a3942;
  --bg-header: #202c33;
  --bg-header-dark: #111b21;
  --bg-message-out: #005c4b;
  --bg-message-in: #202c33;
  --bg-code: #2a3942;
  --bg-hover: #2a3942;
  --bg-active: #323b43;
  
  --text-primary: #e9edef;
  --text-secondary: #8696a0;
  --text-tertiary: #667781;
  --text-header: #e9edef;
  --text-link: #6ab0d8; /* Less saturated blue */
  --text-code: #ff9f43;
  
  --border-primary: #2a3942;
  --border-secondary: #3b4a54;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--bg-header) 0%, var(--bg-header-dark) 100%);
  color: var(--text-header);
  padding: 1.5rem 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-header);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Navigation */
nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: var(--text-header);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

nav a:hover {
  background-color: rgba(255,255,255,0.1);
}

nav a.active {
  background-color: rgba(255,255,255,0.2);
}

/* Theme toggle */
.theme-toggle {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--text-header);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: background-color 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.3);
}

/* Main content */
main {
  min-height: calc(100vh - 80px);
  padding: 3rem 0;
}

.content-wrapper {
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Hero section */
.hero {
  padding: 1.5rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--bg-header) 0%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Animated demo */
.demo-container {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem auto;
  max-width: 800px;
  box-shadow: var(--shadow-lg);
}

.terminal {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 8px;
  font-family: 'Cascadia Code', 'SF Mono', Monaco, 'Inconsolata', 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  border-bottom: 1px solid #333;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
  flex: 1;
  text-align: center;
  color: #999;
  font-size: 12px;
}

.terminal-line {
  margin: 0.5rem 0;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

.terminal-line.prompt {
  color: #4ec9b0;
}

.terminal-line.command {
  color: #569cd6;
}

.terminal-line.output {
  color: #d4d4d4;
}

.terminal-line.success {
  color: #4ec9b0;
}

.terminal-line.info {
  color: #dcdcaa;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 1.5s steps(40, end);
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 3rem 2rem;
}

.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--bg-header) 0%, var(--accent-green) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 24px;
}

.feature-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Documentation sections */
.doc-section {
  padding: 3rem 2rem;
  border-bottom: 1px solid var(--border-primary);
}

.doc-section:last-child {
  border-bottom: none;
}

.doc-section h2 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  position: relative;
  padding-left: 1rem;
}

.doc-section h2:before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: linear-gradient(135deg, var(--bg-header) 0%, var(--accent-green) 100%);
  border-radius: 2px;
}

.doc-section h3 {
  color: var(--text-primary);
  margin: 2rem 0 1rem;
  font-size: 1.3rem;
}

.doc-section a {
  color: var(--text-link);
  text-decoration: none;
}

.doc-section a:hover {
  text-decoration: underline;
}

/* Code blocks */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  font-family: 'Cascadia Code', 'SF Mono', Monaco, 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--text-code);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Command tables */
.command-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.command-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-align: left;
  padding: 1rem;
  font-weight: 600;
}

.command-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
}

.command-table tr:hover {
  background: var(--bg-hover);
}

.command-table code {
  background: var(--bg-code);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 24px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--bg-header) 0%, var(--accent-green) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

/* Alert boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid;
}

.alert-info {
  background: rgba(52, 183, 241, 0.1);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.alert-success {
  background: rgba(37, 211, 102, 0.1);
  border-color: var(--accent-green);
  color: var(--text-primary);
}

.alert-warning {
  background: rgba(251, 188, 4, 0.1);
  border-color: var(--accent-yellow);
  color: var(--text-primary);
}

.alert-danger {
  background: rgba(234, 67, 53, 0.1);
  border-color: var(--accent-red);
  color: var(--text-primary);
}

/* Footer */
footer {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 2rem 0;
  text-align: center;
  margin-top: 4rem;
}

footer a {
  color: var(--text-link);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .command-table {
    font-size: 0.9em;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Sidebar navigation for documentation pages */
.doc-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.sidebar {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin: 0.5rem 0;
}

.sidebar a {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.sidebar a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar a.active {
  background: var(--bg-active);
  color: var(--text-link);
  font-weight: 500;
}

/* Tab navigation */
.tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 2px solid var(--border-primary);
  margin-bottom: 2rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  transition: color 0.3s ease;
}

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

.tab.active {
  color: var(--text-link);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text-link);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Copy button for code blocks */
.code-block-wrapper {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.copy-button.copied {
  background: var(--accent-green);
  color: white;
}