/**
 * Shared CSS for API Documentation
 * Responsive, modern design with syntax highlighting support
 */

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

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --info-color: #16a085;
  
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --bg-light: #ecf0f1;
  --bg-white: #ffffff;
  --border-color: #bdc3c7;
  
  --method-get: #61affe;
  --method-post: #49cc90;
  --method-put: #fca130;
  --method-delete: #f93e3e;
  
  --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-bottom: 3px solid var(--secondary-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
  line-height: 1.8;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

code {
  background: var(--bg-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--danger-color);
}

pre {
  background: var(--primary-color);
  color: #f8f8f2;
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.9em;
  line-height: 1.5;
}

pre code {
  color: #f8f8f2;
  background: none;
  padding: 0;
}

/* ============================================
   LAYOUT
   ============================================ */

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

.wrapper {
  display: flex;
  min-height: 100vh;
  gap: 30px;
}

.sidebar {
  width: 280px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  background: var(--primary-color);
  color: white;
  padding: 20px;
  top: 0;
  left: 0;
}

.main-content {
  flex: 1;
  margin-left: 320px;
  padding: 40px 20px;
}

@media (max-width: 768px) {
  .wrapper {
    flex-direction: column;
    gap: 0;
  }
  
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 15px;
  }
  
  .main-content {
    margin-left: 0;
    padding: 20px 15px;
  }
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
  background: var(--primary-color);
  color: white;
  padding: 30px 0;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
}

header h1 {
  color: white;
  margin-bottom: 0.3rem;
}

header p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

nav {
  margin-top: 20px;
}

nav ul {
  list-style: none;
  margin: 0;
}

nav li {
  margin: 10px 0;
}

nav a {
  color: rgba(255, 255, 255, 0.9);
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-size: 0.95rem;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  padding-left: 16px;
}

nav a.active {
  background: var(--secondary-color);
  color: white;
  font-weight: 600;
}

.nav-group-title {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 20px;
  margin-bottom: 10px;
  padding: 0 12px;
}

/* ============================================
   CARDS & BOXES
   ============================================ */

.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.endpoint-card {
  border-left: 5px solid var(--secondary-color);
}

.endpoint-card.get {
  border-left-color: var(--method-get);
}

.endpoint-card.post {
  border-left-color: var(--method-post);
}

.endpoint-card.put {
  border-left-color: var(--method-put);
}

.endpoint-card.delete {
  border-left-color: var(--method-delete);
}

.info-box {
  background: #e8f4f8;
  border-left: 4px solid var(--info-color);
  padding: 15px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.warning-box {
  background: #fef5e7;
  border-left: 4px solid var(--warning-color);
  padding: 15px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.success-box {
  background: #eafaf1;
  border-left: 4px solid var(--success-color);
  padding: 15px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.danger-box {
  background: #fadbd8;
  border-left: 4px solid var(--danger-color);
  padding: 15px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

/* ============================================
   METHOD BADGES
   ============================================ */

.method-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  margin-right: 10px;
}

.method-badge.get {
  background: var(--method-get);
  color: white;
}

.method-badge.post {
  background: var(--method-post);
  color: white;
}

.method-badge.put {
  background: var(--method-put);
  color: white;
}

.method-badge.delete {
  background: var(--method-delete);
  color: white;
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  margin-bottom: 40px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-title .icon {
  font-size: 2rem;
}

.section-title h2 {
  margin: 0;
  border: none;
  padding: 0;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

input, textarea, select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #2980b9;
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: white;
  border-color: var(--text-dark);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--bg-white);
}

thead {
  background: var(--bg-light);
}

th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background: rgba(52, 152, 219, 0.05);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin: 20px 0;
}

.tab-button {
  padding: 12px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.tab-button:hover {
  color: var(--text-dark);
  background: rgba(0, 0, 0, 0.02);
}

.tab-button.active {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-light);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================
   SCROLLING & INTERACTION
   ============================================ */

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.fade-in {
  animation: slideIn 0.3s ease-out;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .sidebar,
  .no-print {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .card {
    page-break-inside: avoid;
  }
}
