@import url('https://fonts.googleapis.com/css2?family=Geologica:wght@100..900&display=swap');

:root {
  /* Brand Colors */
  --primary: #FF7C1A;
  --secondary: #034BD3;
  --primary-hover: #e56b10;

  /* Dashboard Palette */
  --bg-body: #F5F7FB; /* Very light blue-gray for dashboard feeling */
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  
  /* Text Colors */
  --text-main: #131313;
  --text-secondary: #6B7280; /* Cool gray */
  --text-muted: #9CA3AF;

  /* Borders & Dividers */
  --border-color: #E5E7EB;
  --sidebar-border: #E5E7EB;

  /* Status Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  /* Menu Icon Colors */
  --icon-overview: #FF7C1A;
  --icon-getting-started: #726BB8;
  --icon-authentication: #A05EE2;
  --icon-sms: #51B776;
  --icon-rcs: #FF7C1A;
  --icon-whatsapp: #53B493;
  --icon-webhooks: #CA598D;
  --icon-errors: #D84561;
  --icon-limits: #F3BE30;

  /* Spacing & Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
  --border-radius: 8px;
  --transition: 200ms ease-in-out;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: 'Geologica', sans-serif;
  font-weight: 400;
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden; /* Hide body scroll, main content will scroll */
  display: flex;
}

/* --- Layout Structure --- */

.app-container {
  display: flex; /* Sidebar | Main Content */
  width: 100%;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: fixed; /* Keep sidebar fixed */
  left: 0;
  top: 0;
  z-index: 50;
  transition: transform var(--transition);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.sidebar-logo img {
  height: 32px;
  width: auto;
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

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

.sidebar-menu-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.sidebar-link:hover {
  background: linear-gradient(135deg, #181818 0%, #414141 100%);
  color: #FFFFFF;
}

.sidebar-link.active {
  background: linear-gradient(135deg, #181818 0%, #414141 100%);
  color: #FFFFFF;
  font-weight: 600;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
}

/* Icon Color Classes - Only color the icons, text stays default */
.sidebar-link-overview svg { color: var(--icon-overview); }
.sidebar-link-getting-started svg { color: var(--icon-getting-started); }
.sidebar-link-authentication svg { color: var(--icon-authentication); }
.sidebar-link-sms svg { color: var(--icon-sms); }
.sidebar-link-rcs svg { color: var(--icon-rcs); }
.sidebar-link-whatsapp svg { color: var(--icon-whatsapp); }
.sidebar-link-webhooks svg { color: var(--icon-webhooks); }
.sidebar-link-errors svg { color: var(--icon-errors); }
.sidebar-link-limits svg { color: var(--icon-limits); }

/* On hover and active, icons become white */
.sidebar-link:hover svg,
.sidebar-link.active svg {
  color: #FFFFFF;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width); /* Push content right */
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Header (Search & Actions) */
.top-header {
  height: var(--header-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-search {
  position: relative;
  width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-body);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 124, 26, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 50%;
  transition: background var(--transition);
}

.btn-icon:hover {
  background: var(--bg-body);
  color: var(--primary);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Page Content Scrollable Area */
.page-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.container {
  max-width: 1200px; /* Constrain reading width slightly */
  margin: 0 auto;
}

/* --- Components & Typography --- */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

h1 { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }
h2 { font-size: 1.5rem; font-weight: 700; margin-top: 2rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* Dashboard Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #D1D5DB;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #FFF0E6; /* Light orange */
  color: var(--primary);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
  border-bottom: none;
}

.card p {
  font-size: 0.925rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  flex: 1;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
  margin-top: auto; /* Push to bottom */
}

.card-link:hover {
  text-decoration: underline;
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); width: 280px; box-shadow: none; }
  .main-content { margin-left: 0; }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 20px rgba(0,0,0,0.1); }
  .mobile-toggle { display: block !important; }
}

/* Code Blocks */
.code-block {
  background: #1E293B; /* Dark slate */
  border-radius: var(--border-radius);
  padding: 1.5rem;
  position: relative;
  overflow-x: auto;
  margin: 1.5rem 0;
  color: #E2E8F0;
}

pre {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #ccc;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  font-family: inherit;
  border: none;
}

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

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

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

.btn-secondary:hover {
  background: var(--bg-body);
  border-color: var(--primary);
  color: var(--primary);
}

/* Endpoints */
.endpoint {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
  background: var(--bg-body);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  width: fit-content;
  border: 1px solid var(--border-color);
}

.method {
  font-weight: 700;
  text-transform: uppercase;
}

.method.post { color: var(--success); }
.method.get { color: var(--info); }
.method.delete { color: var(--error); }
.method.put { color: var(--warning); }

.path { color: var(--text-main); }

/* Logo version badge in sidebar */
.version-badge {
    background: #FFF0E6;
    color: var(--primary);
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-success { background: #DCFCE7; color: #166534; }
.status-info { background: #DBEAFE; color: #1E40AF; }
.status-warning { background: #FEF3C7; color: #92400E; }
.status-error { background: #FEE2E2; color: #991B1B; }

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  background: var(--bg-body);
}
.alert-info { background: #EFF6FF; color: #1E3A8A; }
.alert-warning { background: #FFFBEB; color: #92400E; }
.alert-error { background: #FEF2F2; color: #991B1B; }

/* Tables */
.table-container {
  overflow-x: auto;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
th {
  background: var(--bg-body);
  font-weight: 600;
  color: var(--text-main);
}
tr:last-child td { border-bottom: none; }

/* List Spacing */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
/* Playground Styles */
.playground {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin: 2rem 0;
}

.playground-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.playground-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  border: none;
}

.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.playground-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.playground-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-main);
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-sidebar);
  color: var(--text-main);
  transition: all var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 124, 26, 0.1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.form-input[readonly] {
  background: var(--bg-body);
  color: var(--text-muted);
  cursor: not-allowed;
}

#response-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#response-container .code-block {
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
}

#response-container .code-block pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#response-body {
  margin: 0;
}

#response-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 1rem;
}

#response-placeholder svg {
  opacity: 0.3;
  margin-bottom: 1rem;
}

#response-placeholder p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .playground-grid {
    grid-template-columns: 1fr;
  }
  
  .playground {
    padding: 1.5rem;
  }
}