/* Main CSS - Global styles and layout */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Full-screen SVG container */
#diagram {
  width: 100vw;
  height: 100vh;
  background: white;
  display: block;
}

/* Back to modules button */
.back-to-birdseye {
  position: fixed;
  top: 20px;
  left: 20px;
  background: #ffffff;
  border: 2px solid #4a90e2;
  color: #4a90e2;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  z-index: 1002;
  transition: all 0.3s ease;
}

.back-to-birdseye:hover {
  background: #4a90e2;
  color: #ffffff;
}

/* View switcher (bottom-left) */
.view-display {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  user-select: none;
  font-family: Arial, sans-serif;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.view-display:hover {
  color: #333;
  background: rgba(255, 255, 255, 1);
}

/* Hide file input */
#fileInput {
  display: none;
}

/* Publish Overlay Styles */
.publish-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.publish-container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.publish-container h2 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 24px;
}

.publish-container p {
  margin: 0 0 25px 0;
  color: #666;
  font-size: 14px;
}

.publish-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  transition: border-color 0.2s;
  resize: vertical;
  width: 100%;
  min-height: 60px;
  max-height: 150px;
}

.form-group textarea:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group small {
  color: #888;
  font-size: 12px;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-shrink: 0;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.button-group button {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn {
  background: #f0f0f0;
  color: #333;
}

.cancel-btn:hover {
  background: #e0e0e0;
}

.publish-btn {
  background: #007AFF;
  color: white;
}

.publish-btn:hover {
  background: #0051D5;
}

.publish-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Settings modal specific styles */
.form-section {
  margin-bottom: 20px;
}

.form-section h3 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.checkbox-label span {
  font-weight: 600;
  color: #333;
}

.form-group input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
}

.form-group input[type="color"]:hover {
  border-color: #007AFF;
}

/* Inline color picker layout for polarity colors */
.polarity-colors-inline {
  display: flex !important;
  flex-direction: row !important;
  gap: 20px;
  align-items: flex-start;
  justify-content: flex-start;
}

.inline-color-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.inline-color-group label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  text-align: center;
}

.color-icon-square {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  padding: 2px !important;
  transition: all 0.2s ease;
}

.color-icon-square:hover {
  border-color: #007AFF !important;
  transform: scale(1.05);
}

/* Bottom footnote */
.bottom-footnote {
  position: fixed;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  font-size: 11px;
  color: #ccc;
  font-family: Arial, sans-serif;
  text-decoration: none;
  user-select: none;
}

.bottom-footnote:hover {
  color: #ccc;
}

.bottom-footnote:visited {
  color: #ccc;
}

.bottom-footnote:link {
  color: #ccc;
}