/* Modern styling for StampForge */

/* Base styles and variables */
:root {
  --primary-color: #4a6da7;
  --primary-light: #7b97c9;
  --primary-dark: #2d4b7a;
  --secondary-color: #ff6b6b;
  --background-color: #f8f9fa;
  --card-color: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #566573;
  --border-radius: 10px;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --accent-color: #f39c12;
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --header-font: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --body-font: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --overlay-background: rgba(0, 0, 0, 0.7);
  --loading-z-index: 50;
}

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

/* General body and HTML styling */
html, body {
    font-family: var(--body-font);
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

body {
  padding: 20px;
  background-image: linear-gradient(to bottom, #f8f9fa, #edf2f7);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--header-font);
  color: var(--primary-dark);
  margin-bottom: 16px;
  font-weight: 600;
}

h1 {
  font-size: 3.5rem;
  text-align: center;
  margin: 4px 0 34px;
  color: var(--primary-color);
  letter-spacing: -0.5px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 10px;
  color: var(--primary-dark);
}

.container {
    margin: 0 auto;
    padding: 1.5rem;
    background-color: var(--card-color);
    box-shadow: 0 0 25px rgba(0,0,0,0.06);
    border-radius: var(--border-radius);
}

.alpha-badge {
  font-size: 0.5em;
  background-color: var(--danger-color);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* Full-width viewer styles - INCREASED HEIGHT */
.full-width-viewer {
    width: 100%;
    height: auto;
    margin-bottom: 2rem;
}

/* 3D Viewer Container Styles */
#preview-container {
    position: relative;
    width: 96%;
    max-width: 1300px;
    height: 0;
    padding-bottom: 55%;
    margin: 0 auto;
    background-color: #eef2f7;
    overflow: hidden;
    border-radius: var(--border-radius);
}

/* Grid styles for XY ground plane */
.grid-xy {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#three-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--overlay-background);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    z-index: var(--loading-z-index);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    text-align: center;
    min-width: 180px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 1;
    visibility: visible;
}

#loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: loading-spinner 1s linear infinite;
    vertical-align: middle;
}

@keyframes loading-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Improved hidden class to properly hide elements */
.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Ensure loading is properly hidden when not needed */
#preview-container.loading-complete #loading {
    opacity: 0;
    visibility: hidden;
}

/* Styles for the main container of viewer and potentially other elements */
.viewer-and-shape-list-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 400px;
    margin-bottom: 2rem;
}

.shape-list-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 230px;
    max-height: calc(100% - 24px);
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: var(--border-radius);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    padding: 14px;
    overflow-y: auto;
    z-index: 5;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.shape-list-panel h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1em;
    color: var(--primary-dark);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Instructions and info sections */
.instructions, .more-info {
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.instructions ul, .more-info ul {
  margin-left: 25px;
}

.instructions li, .more-info li {
  margin-bottom: 10px;
}

.info-section {
  margin-bottom: 24px;
}

.info-section:last-child {
  margin-bottom: 0;
}

.info-section h4 {
  color: var(--primary-color);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.info-section a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.info-section a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Quick Instructions - now below 3D viewer */
.quick-instructions {
  background-color: white;
  padding: 18px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.quick-instructions h3 {
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.quick-instructions ul {
  list-style-type: none;
}

.quick-instructions li {
  margin-bottom: 8px;
  position: relative;
  padding-left: 20px;
}

.quick-instructions li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

/* Accordion Styles */
.info-accordion {
  margin: 32px 0;
}

.accordion-item {
  margin-bottom: 16px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.accordion-header {
  background-color: var(--card-color);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.accordion-header:hover {
  background-color: #f5f7fa;
}

.accordion-header h3 {
  margin: 0;
  border: none;
  padding: 0;
  font-size: 1.2rem;
}

.accordion-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: transform 0.3s;
}

.accordion-header.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content {
  background-color: var(--card-color);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* SVG Gallery Section */
.svg-gallery-section {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.svg-gallery {
    position: relative;
    min-height: 100px;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.2rem;
}

/* Fix gallery item sizing and make clickable */
.gallery-item {
    height: 140px;
    cursor: pointer;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Make preview container have fixed dimensions */
.gallery-item-preview {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* Make SVG objects scale appropriately */
.gallery-item-preview object {
    max-width: 90%;
    max-height: 90%;
    pointer-events: none;
}

.gallery-item-title {
    height: 40px;
    padding: 6px 8px;
    font-size: 12px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    background-color: white;
    color: var(--text-primary);
}

.gallery-loading, .gallery-error {
    padding: 18px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.gallery-error {
    color: var(--danger-color);
    background-color: #ffebee;
    border-radius: 6px;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* Base Design Modal Styles */
.base-designs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  padding: 24px;
}

.base-design-card {
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.base-design-card:hover, .base-design-card.selected {
  box-shadow: 0 0 18px rgba(74, 109, 167, 0.4);
  border-color: var(--primary-color);
  transform: translateY(-4px);
}

.base-design-preview {
  width: 100%;
  height: 240px;
  background-color: #f5f7fa;
  margin-bottom: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.base-design-preview canvas {
  max-width: 100%;
  max-height: 100%;
}

.base-design-title {
  font-size: 1.05em;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: auto;
  padding: 10px 5px 5px;
}

.upload-card .base-design-preview.upload {
  border: 2px dashed var(--primary-color);
  background-color: rgba(74, 109, 167, 0.05);
}

.base-design-upload-icon {
  font-size: 3.2em;
  color: var(--primary-color);
}

.base-design-card.upload-card.selected {
  border: 2px dashed var(--primary-color);
  border-width: 3px;
  background-color: rgba(74, 109, 167, 0.08);
}

.base-design-card.upload-card .base-design-title {
  font-weight: 600;
  color: var(--primary-color);
}

.choose-base-btn {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 1.05em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.3px;
}

.choose-base-btn:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Action buttons styling */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

button, .prominent-button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.3px;
}

button:hover, .prominent-button:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

button:disabled {
  background-color: #b8c2cc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.prominent-button {
  background-color: var(--success-color);
  font-weight: 600;
}

.prominent-button:hover {
  background-color: #219653;
}

.view-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

/* Controls panel styling */
.controls-panel {
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  padding: 22px;
  box-shadow: var(--shadow);
  height: fit-content;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.file-upload {
  margin-bottom: 25px;
  background-color: #f8f9fa;
  padding: 24px;
  border-radius: 8px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  text-align: center;
}

.file-upload label[for="svgUpload"]:not(.custom-file-upload) {
  display: block;
  margin-bottom: 18px;
  font-weight: 500;
  font-size: 1.1em;
  color: var(--text-primary);
}

/* Hide the default file input */
.file-upload input[type="file"]#svgUpload {
  display: none;
}

/* Style the custom file upload button (label) */
.custom-file-upload {
  display: inline-block;
  padding: 12px 22px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.3px;
}

.custom-file-upload:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Control sections layout */
.control-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.control-section {
    flex: 1;
    min-width: 300px;
    max-width: calc(33.33% - 1.2rem);
    background-color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.control-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    font-size: 1.25rem;
}

/* Control rows */
.control-row {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}

.control-row label {
  min-width: 85px;
  margin-right: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.control-row input[type="number"],
.control-row input[type="file"],
.control-row input[type="color"],
.control-row button {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-sizing: border-box;
  font-family: var(--body-font);
}

.control-row input[type="number"]:focus,
.control-row input[type="file"]:focus,
.control-row input[type="color"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 109, 167, 0.2);
}

.control-row input[type="range"] {
  flex-grow: 1;
  height: 6px;
  -webkit-appearance: none;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
}

.control-row span {
  margin-left: 12px;
  min-width: 32px;
  font-weight: 500;
}

/* Welcome message in modal */
.welcome-message {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px;
  background-color: #f1f9f7;
  border-radius: 10px;
  border-left: 4px solid var(--success-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.welcome-message h3 {
  margin-bottom: 12px;
  color: var(--success-color);
  border-bottom: none;
}

.welcome-message p {
  color: var(--text-primary);
  font-size: 1.1em;
}

/* About and resources styles */
.about-resources {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    margin-top: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.about-resources h3 {
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary-light);
    padding-bottom: 12px;
    font-size: 1.6em;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.info-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.info-section:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.info-section h4 {
    margin-top: 0;
    margin-bottom: 14px;
    color: var(--primary-color);
    font-size: 1.2em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 8px;
}

.info-section p, .info-section ul {
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--text-primary);
}

.info-section ul {
    list-style-type: disc;
    padding-left: 22px;
    margin-top: 0;
}

.info-section li {
    margin-bottom: 10px;
}

.info-section a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.info-section a:hover, .info-section a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

.author-info {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.author-info p {
    margin-bottom: 6px;
}

.github-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 6px;
}

.highlight-section {
    background-color: rgba(232, 245, 233, 0.5);
    border-left: 4px solid var(--success-color);
}

.highlight-section h4 {
    color: #2e7d32;
}

.prominent-link {
    font-weight: bold;
    color: var(--accent-color) !important;
}

.prominent-link:hover {
    color: #d35400 !important;
    text-decoration: underline !important;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed !important;
  z-index: 1000 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  background-color: #fff;
  margin: 3% auto;
  width: 90%;
  max-width: 1000px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
  overflow: hidden;
  max-height: 90vh;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header {
  padding: 16px 24px;
  background-color: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.6rem;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
    margin-top: 20px;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: right;
    background-color: #f8f9fa;
}

.modal-footer button {
    padding: 10px 18px;
    margin-left: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.3px;
}

#applyConfigBtn {
    background-color: var(--success-color);
    color: white;
}

#applyConfigBtn:hover {
    background-color: #219653;
}

#resetConfigBtn {
    background-color: var(--danger-color);
    color: white;
}

#resetConfigBtn:hover {
    background-color: #c0392b;
}

.close {
  color: #666;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: var(--primary-dark);
}

/* Base Rotation Controls */
.rotation-controls {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.control-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.rotation-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.rotation-btn {
    padding: 10px 0;
    border: none;
    border-radius: 6px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.95em;
}

.rotation-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.rotation-btn.reset-btn {
    background-color: var(--danger-color);
}

.rotation-btn.reset-btn:hover {
    background-color: #c0392b;
}

/* SVG Properties Accordion Styling */
.accordion-header-svg {
    background-color: #f8f9fa;
    color: var(--text-primary);
    cursor: pointer;
    padding: 12px 16px;
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
    outline: none;
    font-size: 1em;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header-svg:hover {
    background-color: #edf2f7;
}

.accordion-header-svg h4 {
    margin: 0;
    font-size: 1.1em;
    color: var(--primary-dark);
    border-bottom: none;
    padding-bottom: 0;
}

.accordion-icon-svg {
    font-size: 1.2em;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.accordion-header-svg.active .accordion-icon-svg {
    transform: rotate(45deg);
}

.accordion-header-svg.active {
     border-radius: 6px 6px 0 0;
     border-bottom-color: rgba(0, 0, 0, 0.1);
     background-color: #f1f5f9;
}

.accordion-header-svg:not(.active) {
    border-radius: 6px;
    border-bottom: none;
}

.accordion-content-svg {
    padding: 0 16px;
    background-color: #fdfdfd;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    border-radius: 0 0 6px 6px;
}

.accordion-content-svg.active {
    padding-top: 18px;
    padding-bottom: 18px;
}

/* Position controls */
.position-label {
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.position-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.position-controls .control-row {
    margin-bottom: 0;
}

.position-controls .control-row label {
    min-width: 22px;
    font-weight: 600;
    margin-right: 8px;
    color: var(--primary-dark);
}

.position-controls .control-row input[type="number"] {
    min-width: 65px;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

/* Shape list styling */
.shape-list-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shape-list-item {
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    transition: box-shadow 0.2s;
}

.shape-list-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shape-main-controls, .shape-advanced-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.shape-advanced-controls {
    padding-top: 6px;
    border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

.shape-list-item:last-child {
    border-bottom: none;
}

.shape-list-item label {
    flex-grow: 1;
    margin-left: 5px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    font-weight: 500;
}

.shape-list-item input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.no-shapes-message {
    text-align: center;
    color: #888;
    padding: 24px 12px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    background-color: rgba(249, 249, 249, 0.8);
    margin-top: 10px;
    font-style: italic;
}

.shape-control-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 600;
}

.shape-control-label-inline {
    font-size: 0.85em;
    color: var(--text-primary);
    margin-left: 2px;
    margin-right: 5px;
    cursor: pointer;
}

.shape-delete-button {
    background-color: #ffeeee;
    color: var(--danger-color);
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    box-shadow: none;
}

.shape-delete-button:hover {
    background-color: #ffdddd;
    color: #b71c1c;
}

.shape-operation-select {
    padding: 3px 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 0.85em;
    max-width: 80px;
    background-color: white;
}

.shape-winding-toggle {
    padding: 3px 6px;
    background-color: #f1f5f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 5px;
    transition: background-color 0.2s;
}

.shape-winding-toggle:hover {
    background-color: #e1e8f0;
}

/* Quick Controls */
.quick-controls {
    margin-top: 16px;
    padding: 14px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.quick-controls .control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.quick-controls label {
    margin-right: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.quick-controls input[type="color"] {
    width: 65px;
    height: 34px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 2px;
    border-radius: 4px;
    cursor: pointer;
}

/* Disabled button styling */
.config-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #a0aec0;
    color: white;
    position: relative;
    box-shadow: none;
}

.config-button.disabled:hover {
    background-color: #a0aec0;
    transform: none;
    box-shadow: none;
}

/* Tooltip for disabled buttons */
.config-button.disabled:hover::after {
    content: "Work in Progress";
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Triangle pointer for tooltip */
.config-button.disabled:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #2d3748 transparent;
    z-index: 100;
}

/* Animation for modals */
@keyframes slideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Media queries for responsive layout */
@media (max-width: 992px) {
  .control-sections {
    grid-template-columns: 1fr 1fr;
  }
  
  .base-designs-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.8rem;
  }
  
  .control-sections {
    grid-template-columns: 1fr;
  }
  
  #preview-container {
    width: 98%;
    padding-bottom: 65%;
  }
  
  .shape-list-panel {
    width: 180px;
    font-size: 0.8rem;
  }
  
  .base-designs-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
  }
  
  .base-design-card {
    height: 280px;
  }
  
  .base-design-preview {
    height: 220px;
  }
  
  .container {
    width: 95%;
    padding: 1.2rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.2rem;
  }
  
  .view-buttons {
    grid-template-columns: 1fr;
  }
  
  .base-designs-grid {
    grid-template-columns: 1fr;
  }
  
  .custom-file-upload {
    padding: 10px 16px;
  }
}

@media (min-width: 1800px) {
  .base-select-content {
    margin-top: 40px;
  }
  
  .container {
    max-width: 1600px;
  }
}
