:root {
  --primary-color: #4a90e2;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-color: #dee2e6;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease-in-out;
}

body {
  background-color: #f8f9fa;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

/* Main Container Styles */
.main-container {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}

/* Tab Navigation Styles */
.nav-tabs {
  background-color: #f1f5f9;
  border-bottom: none;
  padding: 0.5rem 0.5rem 0;
}

.nav-tabs .nav-item {
  margin-bottom: 0;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  color: var(--secondary-color);
  transition: var(--transition);
  margin-right: 4px;
}

.nav-tabs .nav-link:hover {
  background-color: rgba(74, 144, 226, 0.1);
  color: var(--primary-color);
}

.nav-tabs .nav-link.active {
  background-color: #fff;
  color: var(--primary-color);
  border-top: 3px solid var(--primary-color);
}

.nav-tabs .nav-link i {
  margin-right: 8px;
}

/* Tab Content Styles */
.tab-content {
  display: none;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

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

.properties-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* Control Group Styles */
.control-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.control-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.control-group h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 1rem;
}

/* Form Control Styles */
label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

.form-control {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.form-select {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

/* Button Styles */
.btn {
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background-color: #3a80d2;
  border-color: #3a80d2;
}

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

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-success:hover {
  background-color: #218838;
  border-color: #218838;
}

/* Toolbar Styles */
.toolbar {
  background-color: #f8f9fa;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.toolbar-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--secondary-color);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.toolbar-btn:hover {
  background-color: rgba(74, 144, 226, 0.1);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.toolbar-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.toolbar-group {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  padding: 0.25rem;
  border-radius: var(--border-radius);
  background-color: white;
}

/* Canvas Area Styles */
.canvas-area {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1rem;
  margin-top: 1rem;
}

/* 3D Preview Styles */
.preview-container {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1rem;
  margin-top: 1rem;
}

.preview-container h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}
\
#3d-container {
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Shape Grid Styles */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.shape-btn {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.shape-btn:hover {
  background-color: rgba(74, 144, 226, 0.1);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.shape-btn i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.shape-btn span {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

/* Social Icons Grid Styles */
.social-icons-grid,
.packaging-icons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.social-icon-btn,
.packaging-icon-btn {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.social-icon-btn:hover,
.packaging-icon-btn:hover {
  background-color: rgba(74, 144, 226, 0.1);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.social-icon-btn i,
.packaging-icon-btn i {
  font-size: 1.25rem;
  color: var(--primary-color);
}

/* Range Slider Styles */
.range-slider {
  margin-bottom: 1rem;
}

.range-slider label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.range-slider .value {
  font-size: 0.875rem;
  color: var(--secondary-color);
  font-weight: normal;
}

.form-range {
  height: 0.5rem;
}

.form-range::-webkit-slider-thumb {
  background: var(--primary-color);
}

.form-range::-moz-range-thumb {
  background: var(--primary-color);
}

/* Color Picker Styles */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.color-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: var(--dark-color);
}

/* Switch Styles */
.switch-container {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-right: 0.75rem;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* File Input Styles */
.file-input {
  margin-bottom: 1rem;
}

.file-input input {
  display: none;
}

.file-input label {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.file-input label:hover {
  background-color: #3a80d2;
}

/* Element List Styles */
.element-list {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  max-height: 200px;
  overflow-y: auto;
}

.element-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

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

.element-item:hover {
  background-color: rgba(74, 144, 226, 0.1);
}

.element-item.active {
  background-color: rgba(74, 144, 226, 0.2);
}

/* Pattern Styles */
.pattern-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pattern-category-btn {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--secondary-color);
  cursor: pointer;
  transition: var(--transition);
}

.pattern-category-btn:hover {
  background-color: rgba(74, 144, 226, 0.1);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.pattern-category-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 576px) {
  .pattern-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pattern-item {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.pattern-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.pattern-item.selected {
  border: 2px solid var(--primary-color);
}

.pattern-preview {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.pattern-preview img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pattern-item:hover .pattern-preview img {
  transform: scale(1.05);
}

.pattern-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pattern-item:hover .pattern-overlay {
  opacity: 1;
}

.pattern-overlay span {
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.875rem;
}

.pattern-info {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.pattern-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark-color);
  text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
  .toolbar {
    justify-content: center;
  }

  .toolbar-btn {
    width: 32px;
    height: 32px;
  }

  .shape-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .social-icons-grid,
  .packaging-icons-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 575.98px) {
  .nav-tabs .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .nav-tabs .nav-link i {
    margin-right: 4px;
  }

  .properties-title {
    font-size: 1.125rem;
  }

  .control-group h3 {
    font-size: 0.9375rem;
  }

  .social-icons-grid,
  .packaging-icons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Animation Controls */
.animation-controls {
  margin-top: 1rem;
}

.animation-controls label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Structure Panel Styles */
.structure-panel {
  position: fixed;
  top: 60px;
  left: 10px;
  width: 280px;
  height: calc(100vh - 80px);
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(-300px);
  transition: transform 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.structure-panel.active {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.structure-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.structure-panel-header span {
  font-weight: 600;
  font-size: 1rem;
  color: var(--dark-color);
}

.structure-panel-header button {
  background: none;
  border: none;
  color: var(--secondary-color);
  cursor: pointer;
  font-size: 1rem;
}

.structure-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1040;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background-color: #3a80d2;
  transform: scale(1.05);
}

/* Notification Styles */
#notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--success-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  z-index: 1060;
  transition: opacity 0.3s ease;
  opacity: 0;
}

/* Dark Mode Support */
body.dark-mode {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

body.dark-mode .main-container,
body.dark-mode .tab-content,
body.dark-mode .canvas-area,
body.dark-mode .preview-container {
  background-color: #2a2a2a;
}

body.dark-mode .nav-tabs {
  background-color: #222;
}

body.dark-mode .nav-tabs .nav-link {
  color: #aaa;
}

body.dark-mode .nav-tabs .nav-link.active {
  background-color: #2a2a2a;
  color: var(--primary-color);
}

body.dark-mode .properties-title,
body.dark-mode .control-group h3 {
  color: #f0f0f0;
}

body.dark-mode .control-group {
  border-bottom-color: #444;
}

body.dark-mode .toolbar,
body.dark-mode .toolbar-btn,
body.dark-mode .shape-btn,
body.dark-mode .social-icon-btn,
body.dark-mode .packaging-icon-btn {
  background-color: #333;
  border-color: #444;
  color: #aaa;
}

body.dark-mode .toolbar-btn:hover,
body.dark-mode .shape-btn:hover,
body.dark-mode .social-icon-btn:hover,
body.dark-mode .packaging-icon-btn:hover {
  background-color: rgba(74, 144, 226, 0.2);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
  background-color: #333;
  border-color: #444;
  color: #f0f0f0;
}

body.dark-mode .element-list,
body.dark-mode .element-item {
  background-color: #333;
  border-color: #444;
  color: #f0f0f0;
}

body.dark-mode .element-item:hover {
  background-color: rgba(74, 144, 226, 0.2);
}

body.dark-mode .pattern-item {
  background-color: #333;
}

body.dark-mode .pattern-info {
  border-top-color: #444;
}

body.dark-mode .pattern-name {
  color: #f0f0f0;
}

body.dark-mode .pattern-category-btn {
  background-color: #333;
  border-color: #444;
  color: #aaa;
}

body.dark-mode .structure-panel {
  background-color: #2a2a2a;
}

body.dark-mode .structure-panel-header {
  border-bottom-color: #444;
}

body.dark-mode .structure-panel-header span {
  color: #f0f0f0;
}

/* Add these styles for the dieline layers dropdown */
.toolbar-dropdown {
  position: relative;
  display: inline-block;
}

.toolbar-dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border-radius: 4px;
  padding: 8px;
  top: 100%;
  left: 0;
}

.toolbar-dropdown.active .toolbar-dropdown-content {
  display: block;
}

.dropdown-item {
  padding: 8px;
  display: flex;
  align-items: center;
}

.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 20px;
  margin-right: 10px;
  transition: all 0.3s;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2196f3;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
}

/* Highlight the exclamation icon when dieline elements are found */
#dielineLayersToggle {
  position: relative;
}

#dielineLayersToggle:after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background-color: #ff3b30;
  border-radius: 50%;
  display: block;
}

/* Specific colors for different dieline types */
#toggle-cutting_line + .toggle-slider {
  background-color: rgba(255, 0, 0, 0.3);
}

#toggle-cutting_line:checked + .toggle-slider {
  background-color: rgba(255, 0, 0, 0.8);
}

#toggle-trim_line + .toggle-slider {
  background-color: rgba(0, 255, 0, 0.3);
}

#toggle-trim_line:checked + .toggle-slider {
  background-color: rgba(0, 255, 0, 0.8);
}

#toggle-bleed_line + .toggle-slider {
  background-color: rgba(0, 0, 255, 0.3);
}

#toggle-bleed_line:checked + .toggle-slider {
  background-color: rgba(0, 0, 255, 0.8);
}

/* Dark mode support */
body.dark-mode .toolbar-dropdown-content {
  background-color: #333;
  color: #fff;
  border: 1px solid #444;
}

body.dark-mode .toggle-slider {
  background-color: #555;
}

body.dark-mode input:checked + .toggle-slider {
  background-color: #3a8bd8;
}

/* Custom Fonts Styles */
.custom-fonts-container {
  margin-top: 1rem;
}

.custom-fonts-list {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  max-height: 200px;
  overflow-y: auto;
}

.font-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.font-item:hover {
  background-color: rgba(74, 144, 226, 0.1);
}

.font-item.active {
  background-color: rgba(74, 144, 226, 0.2);
}

.font-name {
  font-weight: 500;
  flex-grow: 1;
}

.font-preview {
  font-size: 1.25rem;
  margin-right: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-actions {
  display: flex;
  gap: 0.5rem;
}

.font-actions button {
  background: none;
  border: none;
  color: var(--secondary-color);
  cursor: pointer;
  transition: var(--transition);
  padding: 0.25rem;
  border-radius: 4px;
}

.font-actions button:hover {
  background-color: rgba(74, 144, 226, 0.1);
  color: var(--primary-color);
}

.font-actions .delete-font {
  color: var(--danger-color);
}

.font-actions .delete-font:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

.empty-fonts-message {
  padding: 1rem;
  text-align: center;
  color: var(--secondary-color);
  font-style: italic;
}

/* Dark mode support for custom fonts */
body.dark-mode .font-item {
  border-bottom-color: #444;
}

body.dark-mode .font-item:hover {
  background-color: rgba(74, 144, 226, 0.2);
}

body.dark-mode .empty-fonts-message {
  color: #aaa;
}

/* Toolbar Styles */
.toolbar-container {
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.toolbar-group {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-right: 1px solid #dee2e6;
}

.toolbar-group:last-child {
  border-right: none;
}

.toolbar-group .btn {
  min-width: 36px;
  height: 36px;
}

/* Structure Panel Styles */
.structure-panel {
  position: fixed;
  top: 20px;
  right: -300px;
  width: 280px;
  height: calc(100vh - 40px);
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 1000;
}

.structure-panel.active {
  right: 20px;
}

.structure-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.structure-panel-content {
  padding: 16px;
  height: calc(100% - 60px);
  overflow-y: auto;
}

.structure-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Animation Controls */
.animation-controls {
  display: flex;
  gap: 8px;
}

.animation-timeline {
  background: #f8f9fa;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
    gap: 8px;
  }
  
  .toolbar-group {
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 0;
  }
  
  .toolbar-group:last-child {
    border-bottom: none;
  }
  
  .structure-panel {
    width: 100%;
    right: -100%;
  }
  
  .structure-panel.active {
    right: 0;
  }
}
