:root {
  --primary-color: #364266;
  --secondary-color: #364266;
  --background: #f5f5f5;
  --card-background: white;
  --text-primary: #333;
  --text-secondary: #666;
  --border-radius: 8px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Font declarations */
@font-face {
  font-family: "Minercraftory";
  src: url("https://kurojs.github.io/McView3D/assets/fonts/Minercraftory.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

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

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

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

/* Header */
.header {
  background: linear-gradient(135deg, #000, #4c22e1);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

.header h1 {
  font-family:
    "Minercraftory", "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Main content */
.main {
  padding: 3rem 0;
}

.search-section {
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.search-form {
  display: flex;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-button:hover {
  background: #2d354d;
}

/* Viewer section */
.viewer-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.viewer-container {
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

.viewer-canvas {
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
}

.actions-container h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

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

.action-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.action-button {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.action-button:hover {
  background: #551cf2;
  transform: translateY(-1px);
}

.action-button.active {
  background: #551cf2;
}

.embed-code {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  padding: 1rem;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.9rem;
  width: 100%;
  min-height: 100px;
  resize: vertical;
}

/* Copy button styles */
.copy-button {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
  vertical-align: top;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-button:hover {
  background: #f8f9fa;
  color: #333;
  border-color: #aaa;
  transform: translateY(-1px);
}

.copy-button.copied {
  background: #e8f5e8;
  color: #4caf50;
  border-color: #4caf50;
}

.copy-button::before {
  content: "\📋";
  font-size: 0.9rem;
}

.copy-button.copied::before {
  content: "\✅";
  font-size: 0.9rem;
}

.code-block-container {
  position: relative;
  margin: 0.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.code-block {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  padding: 1rem;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  margin: 0;
  flex: 1;
  word-break: break-all;
}

/* Documentation */
.docs-section {
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.docs-section h2 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.docs-section h3 {
  margin: 1.5rem 0 0.5rem 0;
  color: var(--text-secondary);
}

.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.params-table th,
.params-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.params-table code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  background: #e9ecef;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.params-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.code-block {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  padding: 1rem;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

/* Footer */
.footer {
  background: #000;
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
  font-family: "Minercraftory";
}

.footer a {
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  .viewer-section {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
  }

  .header h1 {
    font-size: 2rem;
  }

  .code-block-container {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-button {
    margin-left: 0;
    align-self: flex-end;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
}

/* Embed styles for iframe */
body.embed {
  margin: 0;
  padding: 0;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

body.embed .viewer-canvas {
  border: none;
}
