/* ==========================================
   ThreePresenter Documentation Styles
   Custom styles to complement Bootstrap
   ========================================== */

/* BASE & RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

/* HEADER */
.header {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.header p { font-size: 1.2rem; opacity: 0.9; }

/* NAVIGATION */
.nav-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  transition: background 0.3s;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.3); color: white; }

/* CONTAINER */
.container { max-width: 1400px; margin: 0 auto; padding: 0 1rem; }

/* CARDS & GRIDS */
.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
  color: inherit;
}

.card-icon { font-size: 2.5rem; margin-bottom: 1rem; color: #667eea; }
.card h3 { font-size: 1.5rem; margin-bottom: 0.75rem; color: #333; }
.card p { color: #666; line-height: 1.6; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* 3D VIEWER */
.viewer-container {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

.viewer {
  width: 100%;
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* LOADING OVERLAY */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 8px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: white; margin-top: 1rem; font-size: 1.1rem; }

/* FOOTER */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: white;
  margin-top: 3rem;
}

.footer a { color: white; text-decoration: underline; }

.footer-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* EXAMPLE SECTIONS */
.example-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
}

.example-number {
  display: inline-block;
  background: #667eea;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  font-weight: bold;
  font-size: 1.2rem;
  margin-right: 1rem;
}

.example-title { display: flex; align-items: center; flex: 1; }
.example-title h2 { font-size: 1.8rem; color: #333; margin: 0; }

.difficulty {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.difficulty.easy { background: #d4edda; color: #155724; }
.difficulty.medium { background: #fff3cd; color: #856404; }
.difficulty.advanced { background: #f8d7da; color: #721c24; }

.example-description { color: #666; margin-bottom: 1.5rem; line-height: 1.6; }

/* CODE BLOCKS */
.code-wrapper {
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.code-header {
  background: #2d2d2d;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #404040;
}

.code-title {
  color: #ccc;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-block {
  padding: 1rem;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.code-block pre {
  margin: 0;
  color: #d4d4d4;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.code-block code { color: #d4d4d4; }

/* API LINKS IN CODE */
.api-link {
  color: #4ec9b0;
  text-decoration: none;
  border-bottom: 1px dotted #4ec9b0;
  transition: all 0.2s;
}

.api-link:hover {
  color: #6ee0c7;
  border-bottom-color: #6ee0c7;
  background: rgba(78, 201, 176, 0.1);
}

/* KEY POINTS */
.key-points {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.key-points h4 { color: #667eea; margin-bottom: 0.75rem; font-size: 1rem; }
.key-points ul { margin: 0; padding-left: 1.5rem; }
.key-points li { color: #555; margin-bottom: 0.5rem; line-height: 1.5; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .header h1 { font-size: 2rem; }
  .header p { font-size: 1rem; }
  .viewer { height: 300px; }
  .grid-3 { grid-template-columns: 1fr; }
  .example-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}
/* UTILITIES */
.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Fix for Viewport Gizmo visibility */
.viewport-gizmo, .gizmo-container {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 900 !important;
}

/* EXAMPLES VIEWER */
.examples-container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 280px;
  background: #2c3e50;
  color: white;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.sidebar-header {
  padding: 20px;
  background: #1a252f;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 5px;
}

.sidebar-header p {
  font-size: 13px;
  color: #95a5a6;
}

.examples-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.example-item {
  display: block;
  padding: 12px 20px;
  color: #ecf0f1;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.example-item:hover {
  background: rgba(255,255,255,0.05);
  border-left-color: #3498db;
}

.example-item.active {
  background: rgba(52, 152, 219, 0.2);
  border-left-color: #3498db;
}

.example-item .title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 3px;
}

.example-item .description {
  font-size: 12px;
  color: #95a5a6;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-header {
  background: white;
  padding: 15px 25px;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.content-header h2 {
  font-size: 18px;
  color: #2c3e50;
  margin-bottom: 5px;
}

.content-header .breadcrumb {
  font-size: 13px;
  color: #7f8c8d;
}

.split-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-pane {
  flex: 6;
  background: white;
  border-bottom: 1px solid #ddd;
  position: relative;
  overflow: hidden;
}

.preview-pane iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.code-pane {
  flex: 4;
  background: #1e1e1e;
  overflow: auto;
  position: relative;
}

.copy-btn {
  background: #0e639c;
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-btn:hover { background: #1177bb; }
.copy-btn.copied { background: #16825d; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #7f8c8d;
  font-size: 14px;
}
