/* Smooth animations control */
body.no-smooth-animations *,
body.no-smooth-animations *::before,
body.no-smooth-animations *::after {
    transition: none !important;
    animation: none !important;
}

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

:root {
  --brand-pink: #ea5297;
  --brand-pink-light: #ff9ccc;
  --brand-pink-dark: #d43d7a;
  --brand-white: #ffffff;
  --brand-dark: #1a1a1a;
  --brand-gray: #f8f9fa;
  --brand-gray-dark: #6c757d;
  --brand-gray-light: #e9ecef;
  --sidebar-width: 320px;
  --header-height: 120px; /* 60px row 1 + 60px row 2 */
  --header-row-1-height: 60px;
  --header-row-2-height: 60px;
  --layers-sidebar-width: 350px;
  --properties-sidebar-width: 320px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 12px 40px rgba(234, 82, 151, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@100;200;300;400;500;600;700;800;900&family=Montserrat:wght@100;200;300;400;500;600;700;800;900&family=Roboto:wght@100;300;400;500;700;900&family=Open+Sans:wght@300;400;600;700;800&family=Lato:wght@100;300;400;700;900&family=Poppins:wght@100;200;300;400;500;600;700;800;900&family=Playfair+Display:wght@400;500;600;700;800;900&family=Oswald:wght@200;300;400;500;600;700&family=Raleway:wght@100;200;300;400;500;600;700;800;900&family=Ubuntu:wght@300;400;500;700&family=Dancing+Script:wght@400;500;600;700&family=Pacifico&family=Bebas+Neue&family=Anton&family=Fjalla+One&family=Righteous&family=Lobster&family=Merriweather:wght@300;400;700;900&family=Source+Sans+Pro:wght@200;300;400;600;700;900&family=PT+Sans:wght@400;700&family=Nunito:wght@200;300;400;500;600;700;800;900&family=Crimson+Text:wght@400;600;700&family=Libre+Baskerville:wght@400;700&family=Arvo:wght@400;700&family=Dosis:wght@200;300;400;500;600;700;800&family=Quicksand:wght@300;400;500;600;700&family=Work+Sans:wght@100;200;300;400;500;600;700;800;900&family=Karla:wght@200;300;400;500;600;700;800&family=Rubik:wght@300;400;500;600;700;800;900&family=Fira+Sans:wght@100;200;300;400;500;600;700;800;900&family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Barlow Condensed wird bereits über @import geladen (siehe Zeile 37) */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #ea5297 0%, #ff9ccc 50%, #ffffff 100%);
  background-attachment: fixed;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Modern Header */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid rgba(234, 82, 151, 0.15);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 100;
}

.header-row-1 {
  height: var(--header-row-1-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(234, 82, 151, 0.1);
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-title {
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.header-document-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-document-input {
  padding: 8px 14px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 8px;
  font-size: 12px;
  min-width: 180px;
  max-width: 250px;
  background: var(--brand-white);
  color: var(--brand-dark);
  font-weight: 500;
  transition: all 0.2s ease;
}

.header-document-input:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--brand-gray);
  border: none;
  border-radius: 8px;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.header-action-btn:hover {
  background: var(--brand-pink);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.3);
}

.header-action-btn.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
}

.header-save-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
  flex-shrink: 0;
}

.header-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(234, 82, 151, 0.4);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-format-tabs {
  display: flex;
  gap: 4px;
  background: var(--brand-gray);
  padding: 4px;
  border-radius: 10px;
  flex-shrink: 0;
}

.format-tab-header {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-gray-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.format-tab-header:hover {
  background: rgba(255, 255, 255, 0.8);
}

.format-tab-header.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
}

.format-name {
  font-size: 10px;
  font-weight: 800;
}

.format-size {
  font-size: 9px;
  opacity: 0.9;
  font-weight: 600;
}

.header-user-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--brand-gray);
  border-radius: 8px;
  flex-shrink: 0;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--brand-dark);
  font-weight: 600;
}

.header-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--brand-gray-dark);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.header-settings-btn:hover {
  background: var(--brand-gray);
  color: var(--brand-pink);
}

.header-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--brand-pink);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.header-logout-btn:hover {
  background: var(--brand-pink);
  color: white;
}

.header-export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
  flex-shrink: 0;
}

.header-export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(234, 82, 151, 0.4);
}

.header-row-2 {
  height: var(--header-row-2-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
  border-bottom: 1px solid rgba(234, 82, 151, 0.1);
  overflow-x: auto;
  overflow-y: hidden;
}

.header-quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: max-content;
}

.header-quick-actions::-webkit-scrollbar {
  height: 4px;
}

.header-quick-actions::-webkit-scrollbar-track {
  background: transparent;
}

.header-quick-actions::-webkit-scrollbar-thumb {
  background: rgba(234, 82, 151, 0.3);
  border-radius: 2px;
}

.header-quick-actions::-webkit-scrollbar-thumb:hover {
  background: rgba(234, 82, 151, 0.5);
}

.header-empty-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--brand-gray-dark);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.6;
}

.quick-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--brand-white);
  border-radius: 8px;
  border: 1px solid rgba(234, 82, 151, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.quick-action-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-gray-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
  white-space: nowrap;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--brand-gray);
  border: none;
  border-radius: 6px;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quick-action-btn:hover {
  background: var(--brand-pink);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
}

.quick-action-btn.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
}

.quick-action-btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-light);
  border-radius: 6px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-action-btn-primary:hover {
  background: var(--brand-pink);
  color: white;
  border-color: var(--brand-pink);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
}

.quick-action-btn-danger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  flex-shrink: 0;
}

.quick-action-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.quick-action-btn-icon {
  padding: 4px 6px;
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-light);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  color: var(--brand-dark);
}

.quick-action-btn-icon:hover {
  background: var(--brand-pink-light);
  border-color: var(--brand-pink);
  color: var(--brand-white);
  transform: translateY(-1px);
}

.quick-action-btn-icon.active {
  background: var(--brand-pink);
  border-color: var(--brand-pink);
  color: var(--brand-white);
}

.quick-input-text {
  padding: 4px 8px;
  border: 1px solid var(--brand-gray-light);
  border-radius: 4px;
  font-size: 11px;
  background: var(--brand-white);
  cursor: pointer;
  min-width: 100px;
  height: 24px;
}

.quick-input-number {
  padding: 4px 6px;
  border: 1px solid var(--brand-gray-light);
  border-radius: 4px;
  font-size: 11px;
  background: var(--brand-white);
  text-align: center;
  width: 50px;
  height: 24px;
}

.quick-input-number-small {
  padding: 3px 4px;
  border: 1px solid var(--brand-gray-light);
  border-radius: 4px;
  font-size: 10px;
  background: var(--brand-white);
  text-align: center;
  height: 22px;
}

.quick-color-input {
  width: 28px;
  height: 24px;
  border: 1px solid var(--brand-gray-light);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}

.quick-select-small {
  padding: 3px 6px;
  border: 1px solid var(--brand-gray-light);
  border-radius: 4px;
  font-size: 10px;
  background: var(--brand-white);
  cursor: pointer;
  height: 22px;
}

.quick-action-label-small {
  font-size: 9px;
  font-weight: 600;
  color: var(--brand-gray-dark);
  white-space: nowrap;
}

.quick-action-select {
  padding: 6px 10px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  background: var(--brand-white);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.quick-action-select:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.quick-action-select:hover {
  border-color: var(--brand-pink-light);
}

.quick-action-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-pink);
  min-width: 45px;
  text-align: center;
  padding: 0 8px;
  white-space: nowrap;
}

/* Left Tools Sidebar */
.tools-sidebar-left {
  position: fixed;
  left: 0;
  top: var(--header-height);
  width: 60px;
  height: calc(100vh - var(--header-height));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid rgba(234, 82, 151, 0.1);
  box-shadow: var(--shadow-md);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.tools-sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
  align-items: center;
}

.tools-sidebar-left .tool-tab-header {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  margin: 0;
}

.tools-sidebar-left .tool-tab-header:hover {
  background: var(--brand-gray);
  border-color: rgba(234, 82, 151, 0.2);
  transform: translateY(-2px);
}

.tools-sidebar-left .tool-tab-header.active,
.tools-sidebar-left .tool-tab-header.dropdown-active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.3);
  border-color: var(--brand-pink);
}

.tools-sidebar-left .tool-tab-header .icon {
  width: 20px;
  height: 20px;
}

/* Template Manager Button - Special Styling */
.tools-sidebar-left .tool-tab-header-templates {
  position: relative;
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.1) 0%, rgba(255, 156, 204, 0.1) 100%);
  border: 2px solid rgba(234, 82, 151, 0.3);
}

.tools-sidebar-left .tool-tab-header-templates:hover {
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.2) 0%, rgba(255, 156, 204, 0.2) 100%);
  border-color: var(--brand-pink);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.25);
}

/* Kleiner Community-Punkt oben rechts im Icon */
.tools-sidebar-left .tool-tab-header-templates .template-community-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(234, 82, 151, 0.4);
}


.tools-divider {
  width: 32px;
  height: 1px;
  background: rgba(234, 82, 151, 0.2);
  margin: 8px 0;
}

.app-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
  pointer-events: none;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: -0.02em;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.format-tabs {
  display: flex;
  gap: 8px;
  background: var(--brand-gray);
  padding: 4px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.format-tab {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-gray-dark);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}

.format-tab:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

.format-tab.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.tab-size {
  font-size: 10px;
  opacity: 0.85;
  font-weight: 600;
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.preview-mode-selector {
  display: flex;
  gap: 4px;
  background: var(--brand-gray);
  padding: 4px;
  border-radius: var(--radius-md);
}

.preview-mode-selector .header-btn {
  padding: 8px 10px;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

.preview-mode-selector .header-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

.preview-mode-selector .header-btn.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
}

.header-btn {
  padding: 6px 10px;
  background: var(--brand-gray);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.1) 0%, rgba(255, 156, 204, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.header-btn:hover::before {
  opacity: 1;
}

.header-btn:hover {
  background: var(--brand-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--brand-pink);
}

.header-btn:active {
  transform: translateY(0);
}

.header-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.export-btn {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  box-shadow: var(--shadow-md);
}

.export-btn:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.export-btn::before {
  display: none;
}

/* Main Layout */
.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--header-height));
  gap: 1px;
  background: rgba(234, 82, 151, 0.1);
  padding-left: calc(60px + var(--properties-sidebar-width)); /* Space for left tools sidebar + properties sidebar */
  padding-right: var(--layers-sidebar-width); /* Space for right layers sidebar */
}

/* Tool Dropdowns Container */
.tool-dropdowns-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.tool-dropdown {
  display: none !important;
  position: fixed;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 2px solid rgba(234, 82, 151, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(234, 82, 151, 0.1);
  overflow: hidden;
  pointer-events: none;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
  min-width: 320px;
  max-width: 360px;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
}

.tool-dropdown.active {
  display: flex !important;
  pointer-events: all;
  opacity: 1;
  visibility: visible;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tool-dropdown-content {
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.tool-dropdown-content::-webkit-scrollbar {
  width: 6px;
}

.tool-dropdown-content::-webkit-scrollbar-track {
  background: var(--brand-gray);
  border-radius: 3px;
}

.tool-dropdown-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 3px;
}

.tool-dropdown-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--brand-pink-dark) 0%, var(--brand-pink) 100%);
}

.tool-dropdown-content h3 {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-pink);
  margin-bottom: 10px;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--brand-gray-light);
}

.tool-dropdown-content h3::before {
  content: '';
  width: 2px;
  height: 14px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 1px;
}

.tool-dropdown-content h3:not(:first-child) {
  margin-top: 16px;
}

/* Kompaktere Styles für Dropdowns */
.tool-dropdown-content .add-element-btn {
  padding: 8px 12px;
  font-size: 11px;
  margin-bottom: 10px;
}

.tool-dropdown-content .shape-btn {
  padding: 10px 8px;
  font-size: 11px;
  border-radius: 6px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tool-dropdown-content .drop-zone {
  padding: 16px 8px;
  margin-bottom: 10px;
  font-size: 11px;
}

.tool-dropdown-content .drop-zone p {
  font-size: 11px;
  margin: 4px 0;
}

.tool-dropdown-content .property-section {
  margin-bottom: 10px;
  padding: 8px;
  background: var(--brand-gray);
  border-radius: 6px;
}

.tool-dropdown-content .property-section:last-child {
  margin-bottom: 0;
}

.tool-dropdown-content .property-label {
  font-size: 10px;
  margin-bottom: 6px;
}

.tool-dropdown-content .property-range-wrapper {
  margin-bottom: 8px;
}

.tool-dropdown-content .property-select,
.tool-dropdown-content select {
  padding: 6px 8px;
  font-size: 11px;
  margin-bottom: 8px;
}

.tool-dropdown-content .property-color {
  width: 100%;
  height: 36px;
  margin-bottom: 8px;
}

.tool-dropdown-content .emoji-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-height: 160px;
  padding: 6px;
}

.tool-dropdown-content .emoji-item {
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-dropdown-content .emoji-picker input {
  padding: 8px;
  font-size: 11px;
  margin-bottom: 8px;
}

.tool-dropdown-content .template-preview {
  height: 50px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.tool-dropdown-content .template-card {
  padding: 0;
  border-radius: 6px;
}

.tool-dropdown-content .template-card span {
  font-size: 9px;
  padding: 4px 2px;
  display: block;
  text-align: center;
  font-weight: 600;
  line-height: 1.2;
}

.tool-dropdown-content .shape-btn {
  text-align: center;
  padding: 8px 4px;
  font-size: 10px;
  min-height: 36px;
}

.tool-dropdown-content .shape-btn:hover {
  transform: scale(1.05);
}

.tool-tab-header.dropdown-active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.3);
  transform: translateY(-1px);
}

/* Modern Sidebars */
.tools-sidebar,
/* Properties Panel - Floating/Dropdown */
.properties-panel {
  position: fixed;
  bottom: 20px;
  right: calc(var(--layers-sidebar-width) + 20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.properties-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(234, 82, 151, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.properties-toggle-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 32px rgba(234, 82, 151, 0.5);
}

.properties-toggle-btn .icon {
  width: 24px;
  height: 24px;
}

.properties-panel-content {
  width: 360px;
  max-height: calc(100vh - 120px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 2px solid rgba(234, 82, 151, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: propertiesSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.properties-panel.active .properties-panel-content {
  display: flex;
}

@keyframes propertiesSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.properties-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(234, 82, 151, 0.1);
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
}

.properties-panel-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-pink);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.properties-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--brand-gray-dark);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.properties-close-btn:hover {
  background: var(--brand-gray);
  color: var(--brand-pink);
}

.properties-panel-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.properties-panel-body::-webkit-scrollbar {
  width: 6px;
}

.properties-panel-body::-webkit-scrollbar-track {
  background: var(--brand-gray);
  border-radius: 3px;
}

.properties-panel-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 3px;
}

.properties-panel-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--brand-pink-dark) 0%, var(--brand-pink) 100%);
}

.tools-sidebar {
  border-right: 1px solid rgba(234, 82, 151, 0.1);
}

/* Layers Sidebar (Right - Fixed at Screen Edge) */
.layers-sidebar-right {
  position: fixed;
  right: 0;
  top: var(--header-height);
  width: var(--layers-sidebar-width);
  height: calc(100vh - var(--header-height));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-left: 1px solid rgba(234, 82, 151, 0.1);
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
  z-index: 90;
}

.layers-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(234, 82, 151, 0.1);
  background: var(--brand-gray);
  flex-shrink: 0;
}

.layers-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: 0;
  position: relative;
}

/* Drag & Drop Visual Feedback */
.layer-item.drag-over-above {
  border-top: 3px solid var(--brand-pink) !important;
  box-shadow: 0 -2px 8px rgba(234, 82, 151, 0.3) !important;
}

.layer-item.drag-over-below {
  border-bottom: 3px solid var(--brand-pink) !important;
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3) !important;
}

.layer-item[draggable="true"] {
  cursor: move;
  transition: all 0.2s ease;
}

.layer-item[draggable="true"]:hover {
  transform: translateX(2px);
}

.layer-item[draggable="true"]:active {
  opacity: 0.6;
}

.layer-drop-indicator {
  animation: dropIndicatorPulse 1s ease-in-out infinite;
}

@keyframes dropIndicatorPulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.7;
    transform: scaleY(1.2);
  }
}

/* Font Picker Modal */
.font-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.font-picker-content {
  background: var(--brand-white);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.font-picker-header {
  padding: 20px;
  border-bottom: 2px solid var(--brand-gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
}

.font-picker-search {
  padding: 16px 20px;
  border-bottom: 1px solid var(--brand-gray-light);
}

.font-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  max-height: 500px;
}

.font-option.selected {
  background: var(--brand-pink) !important;
  color: white !important;
}

.font-option.selected span {
  color: white !important;
}

.layers-sidebar-footer {
  flex-shrink: 0;
  border-top: 2px solid rgba(234, 82, 151, 0.1);
  background: var(--brand-gray);
}

/* Tool Tabs in Header */
.tool-tab-header {
  padding: 6px 12px;
  background: var(--brand-white);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.tool-tab-header:hover {
  background: var(--brand-gray);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tool-tab-header.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  border-color: var(--brand-pink);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Tool Tabs */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 8px;
  background: var(--brand-gray);
  border-bottom: 1px solid rgba(234, 82, 151, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.tool-tab {
  flex: 1;
  min-width: calc(50% - 3px);
  padding: 6px 6px;
  background: var(--brand-white);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tool-tab:hover {
  background: var(--brand-gray);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tool-tab.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  border-color: var(--brand-pink);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Tool Panels */
.tool-panel {
  display: none;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - var(--header-height) - 60px);
}

.tool-panel.active {
  display: block;
}

.tool-panel h3 {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-pink);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-panel h3::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 2px;
}

.tool-panel h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 8px;
  margin-top: 12px;
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tool-dropdown-content .template-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.template-card {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-light);
  position: relative;
  aspect-ratio: 1;
}

.tool-dropdown-content .template-card {
  border-radius: 6px;
}

.template-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(234, 82, 151, 0.2);
  border-color: var(--brand-pink-light);
}

.template-card:hover::before {
  opacity: 1;
}

.template-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border: 1px solid var(--brand-gray-light);
  transition: all 0.3s ease;
  position: relative;
  z-index: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.template-card:hover .template-preview {
  border-color: var(--brand-pink);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.15);
  transform: scale(1.02);
}

.template-card span {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark);
  padding: 8px 4px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
}

/* Modern Buttons */
.add-element-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

.add-element-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.add-element-btn:hover::before {
  opacity: 1;
}

.add-element-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.add-element-btn:active {
  transform: translateY(0);
}

.shape-btn {
  width: 100%;
  padding: 8px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 6px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.shape-btn:hover {
  background: var(--brand-gray);
  border-color: var(--brand-pink);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.shapes-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Drop Zone */
.drop-zone {
  padding: 24px 12px;
  border: 2px dashed var(--brand-gray-light);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 10px;
  background: var(--brand-gray);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
  opacity: 1;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--brand-pink);
  background: rgba(234, 82, 151, 0.05);
  transform: scale(1.02);
}

.drop-zone p {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.drop-hint {
  font-size: 11px;
  color: var(--brand-gray-dark);
  position: relative;
  z-index: 1;
}

/* Elements List */
.elements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.element-item {
  padding: 12px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.element-item:hover {
  background: var(--brand-gray);
  border-color: var(--brand-pink-light);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.element-item.selected {
  border-color: var(--brand-pink);
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.1) 0%, rgba(255, 156, 204, 0.1) 100%);
  box-shadow: var(--shadow-md);
}

.element-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark);
  flex: 1;
}

.element-item-actions {
  display: flex;
  gap: 4px;
}

.element-item-btn {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  color: var(--brand-gray-dark);
  transition: all 0.2s ease;
}

.element-item-btn:hover {
  background: var(--brand-pink);
  color: var(--brand-white);
  border-color: var(--brand-pink);
}

/* Modern Properties Panel */
.element-properties {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--brand-gray-light);
}

.element-properties label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 8px;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Modern Property Styles */
.property-section {
  background: var(--brand-white);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 1px solid var(--brand-gray-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.property-section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-pink-light);
}

.property-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.property-input,
.property-select,
.property-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--brand-white);
  color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.property-input:focus,
.property-select:focus,
.property-textarea:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.property-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

.property-range-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.property-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--brand-gray-light) 0%, var(--brand-gray-light) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin-bottom: 12px;
}

.property-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-dark) 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.4);
  transition: all 0.2s ease;
  border: 2px solid white;
}

.property-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.6);
}

.property-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-dark) 100%);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.4);
}

.property-value {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-pink);
  text-align: right;
  margin-top: -8px;
  margin-bottom: 4px;
}

.property-color {
  width: 100%;
  height: 36px;
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.property-color:hover {
  border-color: var(--brand-pink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

.property-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-pink);
  margin-right: 10px;
}

.property-checkbox-label {
  display: flex;
  align-items: center;
  margin-top: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--brand-dark);
  font-weight: 500;
}

/* Property Accordions */
.property-accordion {
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.property-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--brand-gray);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.property-accordion-header:hover {
  background: var(--brand-pink-light);
  color: white;
}

.property-accordion-header:hover .property-label {
  color: white;
}

.property-accordion-header .accordion-icon {
  font-size: 12px;
  color: var(--brand-pink);
  transition: transform 0.2s ease;
}

.property-accordion-header:hover .accordion-icon {
  color: white;
}

.property-accordion-content {
  padding: 12px;
  background: var(--brand-white);
  display: block;
}

.property-accordion-content[style*="display: none"] {
  display: none !important;
}

/* Primary Property Section */
.property-section-primary {
  border: 2px solid var(--brand-pink-light);
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
}

/* Align Buttons */
.align-btn {
  transition: all 0.2s ease;
}

.align-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.align-btn.active {
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.2);
}

.element-properties input[type="text"],
.element-properties textarea,
.element-properties select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--brand-white);
  box-shadow: var(--shadow-sm);
}

.element-properties input[type="text"]:focus,
.element-properties textarea:focus,
.element-properties select:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 4px rgba(234, 82, 151, 0.1), var(--shadow-md);
  transform: translateY(-1px);
}

.element-properties textarea {
  min-height: 60px;
  resize: vertical;
  font-family: inherit;
}

/* Modern Range Inputs */
.element-properties input[type="range"] {
  width: 100%;
  height: 6px;
  margin-bottom: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--brand-gray-light);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.element-properties input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.element-properties input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: var(--shadow-lg);
}

.element-properties input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

.element-properties input[type="range"] + span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-pink);
  text-align: right;
  margin-top: -4px;
}

.element-properties input[type="color"] {
  width: 100%;
  height: 50px;
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.element-properties input[type="color"]:hover {
  border-color: var(--brand-pink);
  box-shadow: var(--shadow-md);
  transform: scale(1.02);
}

.element-properties input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--brand-pink);
  margin-right: 8px;
}

.element-properties label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  margin-top: 12px;
  cursor: pointer;
}

.btn-danger {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: var(--brand-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 20px;
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Canvas Area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--brand-gray);
  overflow: hidden;
  position: relative;
  margin-left: 0;
}

.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 24px 25px; /* Top padding for horizontal ruler, left padding for vertical ruler */
  overflow: auto;
  position: relative;
  background: 
    radial-gradient(circle at 20% 50%, rgba(234, 82, 151, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 156, 204, 0.1) 0%, transparent 50%),
    var(--brand-gray);
}

#mainCanvas {
  display: block;
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  cursor: crosshair;
  transition: box-shadow 0.3s ease;
}

#mainCanvas:hover {
  box-shadow: 0 16px 48px rgba(234, 82, 151, 0.25);
}

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.canvas-controls {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(234, 82, 151, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.canvas-controls button {
  padding: 10px 16px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

.canvas-controls button:hover {
  background: var(--brand-gray);
  border-color: var(--brand-pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#zoomLevel {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-pink);
  min-width: 70px;
  text-align: center;
  padding: 8px 12px;
  background: var(--brand-gray);
  border-radius: var(--radius-md);
}

/* Layers List */
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-item {
  padding: 12px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  margin-bottom: 6px;
  position: relative;
}

.layer-item:hover {
  background: var(--brand-gray);
  border-color: var(--brand-pink-light);
  transform: translateX(4px);
}

.layer-item.selected {
  border-color: var(--brand-pink);
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.1) 0%, rgba(255, 156, 204, 0.1) 100%);
  box-shadow: var(--shadow-md);
}

.layer-item.locked {
  opacity: 0.6;
  background: var(--brand-gray);
}

.layer-item.locked::after {
  content: '🔒';
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 12px;
}

.layer-background {
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.05) 0%, rgba(255, 156, 204, 0.05) 100%);
  border-style: dashed;
}

.layer-item-icon {
  font-size: 14px;
  margin-right: 6px;
  width: 18px;
  text-align: center;
}

.layer-item-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  flex: 1;
}

.layer-item-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.layer-visibility-btn,
.layer-lock-btn {
  padding: 4px 6px;
  background: transparent;
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.layer-visibility-btn:hover,
.layer-lock-btn:hover {
  background: var(--brand-pink);
  color: var(--brand-white);
  border-color: var(--brand-pink);
}

/* Properties Sidebar - Left (Next to Toolbar) */
.properties-sidebar-left {
  position: fixed;
  left: 60px;
  top: var(--header-height);
  width: var(--properties-sidebar-width);
  height: calc(100vh - var(--header-height));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid rgba(234, 82, 151, 0.1);
  box-shadow: var(--shadow-md);
  z-index: 90;
  display: flex;
  flex-direction: column;
}

.properties-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(234, 82, 151, 0.1);
  background: var(--brand-gray);
  flex-shrink: 0;
}

.properties-sidebar-header h3 {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-pink);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.properties-sidebar-header h3::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 2px;
}

.properties-sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
}

.properties-sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.properties-sidebar-content::-webkit-scrollbar-track {
  background: var(--brand-gray);
  border-radius: 3px;
}

.properties-sidebar-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 3px;
}

.properties-sidebar-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--brand-pink-dark) 0%, var(--brand-pink) 100%);
}

/* Properties Buttons Grid */
/* Quick Actions - Always Visible */
.properties-quick-actions {
  padding: 16px;
  background: var(--brand-white);
  border-bottom: 1px solid var(--brand-gray-light);
}

.quick-action-row {
  margin-bottom: 16px;
}

.quick-action-row:last-child {
  margin-bottom: 0;
}

.quick-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.quick-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-input {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  font-size: 12px;
  background: var(--brand-white);
  color: var(--brand-dark);
  transition: all 0.2s ease;
}

.quick-input.full-width {
  grid-column: 1 / -1;
}

.quick-input:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.quick-range-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-range {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--brand-gray-light);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.quick-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(234, 82, 151, 0.3);
}

.quick-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(234, 82, 151, 0.3);
}

.quick-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  min-width: 40px;
  text-align: right;
}

.quick-color-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quick-color {
  flex: 1;
  height: 36px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-color:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.quick-palette-btn {
  padding: 8px 10px;
  background: var(--brand-pink);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-palette-btn:hover {
  background: var(--brand-pink-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(234, 82, 151, 0.3);
}

/* Expandable Sections */
.properties-expandable {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expandable-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expandable-btn:hover {
  background: var(--brand-gray);
  border-color: var(--brand-pink);
  transform: translateX(2px);
}

.expandable-btn svg:first-child {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.expandable-btn svg:last-child {
  margin-left: auto;
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.expandable-btn.active svg:last-child {
  transform: rotate(180deg);
}

.properties-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
}

.property-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: 8px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.property-btn:hover {
  background: var(--brand-pink);
  color: white;
  border-color: var(--brand-pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.3);
}

.property-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.properties-actions {
  padding: 12px;
  border-top: 1px solid rgba(234, 82, 151, 0.1);
}

.property-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: 8px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.property-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.property-action-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: #ef4444;
}

.property-action-danger:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Properties Dropdowns */
.properties-dropdowns-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

.property-dropdown {
  position: fixed;
  display: none !important;
  min-width: 280px;
  max-width: 400px;
  max-height: 80vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(234, 82, 151, 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  pointer-events: all;
  z-index: 201;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.property-dropdown.active {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.property-dropdown-content {
  padding: 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.property-dropdown-content::-webkit-scrollbar {
  width: 6px;
}

.property-dropdown-content::-webkit-scrollbar-track {
  background: transparent;
}

.property-dropdown-content::-webkit-scrollbar-thumb {
  background: rgba(234, 82, 151, 0.3);
  border-radius: 3px;
}

.property-dropdown-content::-webkit-scrollbar-thumb:hover {
  background: rgba(234, 82, 151, 0.5);
}

.property-dropdown-section {
  margin-bottom: 20px;
}

.property-dropdown-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-pink);
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.property-input-group {
  margin-bottom: 16px;
}

.property-input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.property-input-group .property-input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  font-size: 12px;
  background: var(--brand-white);
  color: var(--brand-dark);
  transition: all 0.2s ease;
}

.property-input-group .property-input:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.property-range-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.property-range {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--brand-gray-light);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.property-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(234, 82, 151, 0.3);
}

.property-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(234, 82, 151, 0.3);
}

.property-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  min-width: 40px;
  text-align: right;
}

.property-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  font-size: 12px;
  background: var(--brand-white);
  color: var(--brand-dark);
  transition: all 0.2s ease;
  resize: vertical;
  font-family: inherit;
}

.property-textarea:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.property-select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  font-size: 12px;
  background: var(--brand-white);
  color: var(--brand-dark);
  transition: all 0.2s ease;
  cursor: pointer;
}

.property-select:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.property-effect-group {
  margin-bottom: 16px;
}

.property-effect-controls {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.property-btn-small {
  padding: 8px 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  background: var(--brand-white);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.property-btn-small:hover {
  border-color: var(--brand-pink);
  background: rgba(234, 82, 151, 0.05);
}

.property-btn-small.active {
  background: var(--brand-pink);
  color: white;
  border-color: var(--brand-pink);
}

.property-button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.property-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.property-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-dark);
}

.property-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-pink);
}

#textEditInput,
.text-edit-input {
  font-family: inherit;
  line-height: 1.2;
  min-width: 200px;
  max-width: 90vw;
}

.text-edit-input:focus {
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 4px rgba(234, 82, 151, 0.2);
}

.property-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.property-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.property-checkbox-label:hover {
  background: var(--brand-gray);
}

.property-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.property-button-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.property-btn-small {
  padding: 8px 12px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: 6px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.property-btn-small:hover {
  background: var(--brand-pink);
  color: white;
  border-color: var(--brand-pink);
}

.property-btn-small.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: white;
  border-color: var(--brand-pink);
}

.properties-sidebar-content .no-selection {
  text-align: center;
  color: var(--brand-gray-dark);
  font-size: 13px;
  padding: 60px 20px;
  background: var(--brand-gray);
  border-radius: var(--radius-md);
  border: 2px dashed var(--brand-gray-light);
}

/* Legacy Properties Sidebar (for backwards compatibility) */
.properties-sidebar {
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - var(--header-height));
}

.properties-sidebar h3 {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-pink);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.properties-sidebar h3::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 2px;
}

.no-selection {
  text-align: center;
  color: var(--brand-gray-dark);
  font-size: 13px;
  padding: 60px 20px;
  background: var(--brand-gray);
  border-radius: var(--radius-md);
  border: 2px dashed var(--brand-gray-light);
}

/* Alignment Tools */
.alignment-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.align-btn {
  padding: 8px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.align-btn:hover {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  border-color: var(--brand-pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Emoji Picker */
.emoji-picker {
  margin-top: 16px;
}

#emojiSearch {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 11px;
  background: var(--brand-white);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

#emojiSearch:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 4px rgba(234, 82, 151, 0.1), var(--shadow-md);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.emoji-item {
  font-size: 20px;
  padding: 8px;
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.emoji-item:hover {
  background: linear-gradient(135deg, rgba(234, 82, 151, 0.1) 0%, rgba(255, 156, 204, 0.1) 100%);
  border-color: var(--brand-pink);
  transform: scale(1.15) translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Grid */
.canvas-wrapper.grid-enabled {
  background-image: 
    linear-gradient(rgba(234, 82, 151, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 82, 151, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--brand-white);
  padding: 32px;
  border-radius: var(--radius-xl);
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--brand-gray-dark);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--brand-gray);
  color: var(--brand-pink);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
}

.modal-content label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 8px;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-content select,
.modal-content input[type="range"] {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--brand-white);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.modal-content select:focus,
.modal-content input[type="range"]:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 4px rgba(234, 82, 151, 0.1);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-buttons button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-buttons .btn-export {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  box-shadow: var(--shadow-md);
}

.modal-buttons .btn-export:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.modal-buttons .btn-clear {
  background: var(--brand-gray);
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

.modal-buttons .btn-clear:hover {
  background: var(--brand-gray-dark);
  color: var(--brand-white);
}

/* Scrollbar Styling */
.tools-sidebar::-webkit-scrollbar,
.properties-sidebar::-webkit-scrollbar,
.canvas-wrapper::-webkit-scrollbar,
.emoji-grid::-webkit-scrollbar {
  width: 8px;
}

.tools-sidebar::-webkit-scrollbar-track,
.properties-sidebar::-webkit-scrollbar-track,
.canvas-wrapper::-webkit-scrollbar-track,
.emoji-grid::-webkit-scrollbar-track {
  background: var(--brand-gray);
  border-radius: 4px;
}

.tools-sidebar::-webkit-scrollbar-thumb,
.properties-sidebar::-webkit-scrollbar-thumb,
.canvas-wrapper::-webkit-scrollbar-thumb,
.emoji-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  border-radius: 4px;
}

.tools-sidebar::-webkit-scrollbar-thumb:hover,
.properties-sidebar::-webkit-scrollbar-thumb:hover,
.canvas-wrapper::-webkit-scrollbar-thumb:hover,
.emoji-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--brand-pink-dark) 0%, var(--brand-pink) 100%);
}

/* Background Tabs */
.background-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--brand-gray);
  padding: 4px;
  border-radius: var(--radius-md);
}

.bg-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-gray-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bg-tab:hover {
  background: rgba(255, 255, 255, 0.8);
}

.bg-tab.active {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  box-shadow: var(--shadow-sm);
}

.bg-tab-content {
  display: none;
}

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

/* Shortcuts Modal */
.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--brand-gray);
  border-radius: var(--radius-md);
  border: 2px solid var(--brand-gray-light);
}

.shortcut-key {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  background: var(--brand-white);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--brand-gray-light);
  color: var(--brand-pink);
  min-width: 120px;
  text-align: center;
}

.shortcut-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
  flex: 1;
  margin-left: 16px;
}

/* Tooltips */
[title] {
  position: relative;
}

/* Template Manager */
.template-manager-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.template-manager-item {
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.template-manager-item:hover {
  border-color: var(--brand-pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.template-manager-item .template-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--brand-gray);
}

.template-manager-item .template-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 4px;
}

.template-manager-item .template-description {
  font-size: 10px;
  color: var(--brand-gray-dark);
  margin-bottom: 8px;
}

.template-manager-item .template-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.template-manager-item .template-delete {
  padding: 4px 8px;
  background: #dc3545;
  color: var(--brand-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-manager-item .template-delete:hover {
  background: #c82333;
}

/* Rulers */
/* Rulers */
.canvas-rulers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.ruler-horizontal {
  position: absolute;
  top: 0;
  left: 25px;
  right: 0;
  height: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--brand-gray-light);
  overflow: hidden;
  pointer-events: auto;
  cursor: default;
  user-select: none;
}

.ruler-vertical {
  position: absolute;
  top: 20px;
  left: 0;
  bottom: 0;
  width: 25px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--brand-gray-light);
  overflow: hidden;
  pointer-events: auto;
  cursor: default;
  user-select: none;
}

.ruler-horizontal:hover,
.ruler-vertical:hover {
  background: rgba(255, 255, 255, 0.98);
}

.ruler-mark {
  position: absolute;
  background: var(--brand-gray-dark);
}

.ruler-mark-major {
  width: 1px;
  height: 8px;
  background: var(--brand-dark);
}

.ruler-mark-minor {
  width: 1px;
  height: 4px;
  background: var(--brand-gray-dark);
  opacity: 0.6;
}

.ruler-horizontal .ruler-mark {
  top: 0;
  transform: translateX(-50%);
}

.ruler-vertical .ruler-mark {
  left: 0;
  transform: translateY(-50%);
}

.ruler-label {
  position: absolute;
  font-size: 9px;
  color: var(--brand-dark);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}

.ruler-horizontal .ruler-label {
  top: 8px;
  left: 2px;
}

.ruler-vertical .ruler-label {
  left: 8px;
  top: 2px;
  transform: rotate(-90deg);
  transform-origin: left top;
}

/* Guide indicators in rulers */
.ruler-guide-indicator {
  position: absolute;
  width: 2px;
  height: 100%;
  background: var(--brand-pink);
  opacity: 0.8;
  pointer-events: none;
  z-index: 10;
}

.ruler-horizontal .ruler-guide-indicator {
  width: 2px;
  height: 100%;
  top: 0;
  transform: translateX(-50%);
}

.ruler-vertical .ruler-guide-indicator {
  width: 100%;
  height: 2px;
  left: 0;
  transform: translateY(-50%);
}

.ruler-guide-selected {
  background: var(--brand-pink-dark);
  opacity: 1;
  width: 3px;
}

.ruler-vertical .ruler-guide-selected {
  width: 100%;
  height: 3px;
}

/* Smart Tools Buttons */
.alignment-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.align-btn {
  padding: 10px;
  background: var(--brand-white);
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.align-btn:hover {
  border-color: var(--brand-pink);
  background: var(--brand-pink-light);
  transform: translateY(-2px);
}

/* Multiple Selection */
.multi-select-indicator {
  position: absolute;
  border: 2px dashed var(--brand-pink);
  pointer-events: none;
  z-index: 1000;
}

/* Touch Support */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
}

/* Prevent text selection on buttons */
button, .btn, .property-btn {
  -webkit-user-select: none;
  user-select: none;
}

/* Responsive */
@media (max-width: 1400px) {
  :root {
    --sidebar-width: 320px;
  }
}

/* Tablet Styles */
@media (max-width: 1024px) and (min-width: 768px) {
  :root {
    --header-height: 100px;
    --header-row-1-height: 50px;
    --header-row-2-height: 50px;
    --tools-sidebar-width: 50px;
    --properties-sidebar-width: 280px;
    --layers-sidebar-width: 300px;
  }
  
  .header-row-1,
  .header-row-2 {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .header-action-btn {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  .tools-sidebar-left {
    width: var(--tools-sidebar-width);
  }
  
  .properties-sidebar-left {
    width: var(--properties-sidebar-width);
    left: var(--tools-sidebar-width);
  }
  
  .layers-sidebar-right {
    width: var(--layers-sidebar-width);
  }
  
  .app-main {
    padding-left: calc(var(--tools-sidebar-width) + var(--properties-sidebar-width));
    padding-right: var(--layers-sidebar-width);
  }
  
  .canvas-wrapper {
    padding: 20px;
  }
  
  /* Make dropdowns more touch-friendly */
  .tool-dropdown,
  .property-dropdown {
    max-width: 90vw;
    max-height: 80vh;
  }
  
  .property-dropdown-content {
    max-height: 60vh;
    padding: 16px;
  }
  
  /* Larger touch targets */
  button, .btn, .property-btn, .expandable-btn {
    min-height: 44px;
    padding: 12px 16px;
  }
  
  input, select, textarea {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Mobile Styles */
@media (max-width: 767px) {
  :root {
    --header-height: 80px;
    --header-row-1-height: 40px;
    --header-row-2-height: 40px;
    --tools-sidebar-width: 0;
    --properties-sidebar-width: 0;
    --layers-sidebar-width: 0;
  }
  
  .tools-sidebar-left,
  .properties-sidebar-left,
  .layers-sidebar-right {
    display: none;
  }
  
  .app-main {
    padding: 0;
  }
  
  .header-row-1,
  .header-row-2 {
    flex-wrap: wrap;
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .header-action-btn {
    padding: 6px 10px;
    font-size: 10px;
  }
  
  .canvas-wrapper {
    padding: 10px;
  }
}

/* Context Menu Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Project Manager Styles */
.project-manager-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.project-manager-item {
    background: white;
    border: 2px solid var(--brand-gray-light);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-manager-item:hover {
    border-color: var(--brand-pink);
    box-shadow: 0 4px 12px rgba(234, 82, 151, 0.15);
    transform: translateY(-2px);
}

.project-preview {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-sm);
    background: var(--brand-gray);
    overflow: hidden;
}

.project-info {
    flex: 1;
}

.project-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--brand-dark);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--brand-gray-dark);
    flex-wrap: wrap;
}

.project-badge {
    background: var(--brand-pink);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
}

.project-badge.local {
    background: var(--brand-gray-dark);
}

.project-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.project-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--brand-gray-light);
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--brand-dark);
}

.project-btn:hover {
    border-color: var(--brand-pink);
    background: var(--brand-pink);
    color: white;
    transform: scale(1.05);
}

.project-btn.delete:hover {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
}

.project-btn.favorite.active {
    border-color: var(--brand-pink);
    background: var(--brand-pink);
    color: white;
}

/* Color Manager Styles */
.color-manager-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 10px 0;
}

.color-manager-item {
    background: white;
    border: 2px solid var(--brand-gray-light);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.color-manager-item:hover {
    border-color: var(--brand-pink);
    box-shadow: 0 4px 12px rgba(234, 82, 151, 0.15);
    transform: translateY(-2px);
}

.color-preview {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.color-info {
    flex: 1;
    min-width: 0;
}

.color-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--brand-dark);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.color-value {
    font-size: 11px;
    color: var(--brand-gray-dark);
    font-family: monospace;
}

.color-actions {
    display: flex;
    gap: 6px;
}

.color-btn {
    width: 28px;
    height: 28px;
    border: 2px solid var(--brand-gray-light);
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--brand-dark);
}

.color-btn:hover {
    border-color: var(--brand-pink);
    background: var(--brand-pink);
    color: white;
    transform: scale(1.05);
}

.color-btn.delete {
    border-color: #ef4444;
    color: #ef4444;
}

.color-btn.delete:hover {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.color-badge {
    background: var(--brand-gray-dark);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

/* Color Picker Swatches */
.color-swatches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--brand-gray);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.color-swatch-wrapper {
    position: relative;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10;
    position: relative;
}

.color-swatch-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: none;
    gap: 2px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    padding: 2px;
    z-index: 20;
}

.color-swatch-wrapper:hover .color-swatch-actions {
    display: flex;
}

.color-swatch-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: background 0.2s ease;
}

.color-swatch-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.color-swatch-btn svg {
    width: 12px;
    height: 12px;
}

/* User Manager Styles - Fullscreen Modal like Template Manager */
.user-manager-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.user-manager-modal.show {
  opacity: 1;
  visibility: visible;
}

.user-manager-content {
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 1000px;
  height: 95%;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.user-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid var(--brand-gray-light);
  flex-shrink: 0;
  gap: 20px;
}

.user-manager-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--brand-dark);
  font-weight: 700;
}

.user-manager-tabs {
  display: flex;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.user-manager-tab {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-gray-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
}

.user-manager-tab:hover {
  background: var(--brand-gray);
  color: var(--brand-dark);
}

.user-manager-tab.active {
  background: var(--brand-pink);
  color: white;
}

.user-manager-close {
  background: transparent;
  border: none;
  color: var(--brand-gray-dark);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-manager-close:hover {
  background: var(--brand-gray);
  color: var(--brand-dark);
}

.user-manager-body {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
  overflow-x: hidden;
}

.user-tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Settings Grid Layout */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.settings-section {
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.settings-section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-pink);
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--brand-gray) 0%, var(--brand-gray-light) 100%);
  border-bottom: 1px solid var(--brand-gray-light);
}

.settings-section-header svg {
  color: var(--brand-pink);
  flex-shrink: 0;
}

.settings-section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}

.settings-section-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-option {
  margin: 0;
}

.settings-option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.settings-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-pink);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.settings-option-content {
  flex: 1;
}

.settings-option-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-dark);
  margin-bottom: 4px;
}

.settings-option-desc {
  font-size: 12px;
  color: var(--brand-gray-dark);
  line-height: 1.4;
}

.settings-slider {
  margin-top: 8px;
}

.settings-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.settings-slider-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-dark);
}

.settings-slider-value {
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-pink);
  min-width: 50px;
  text-align: right;
}

.settings-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--brand-gray-light);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.settings-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(234, 82, 151, 0.3);
  transition: all 0.2s ease;
}

.settings-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(234, 82, 151, 0.4);
}

.settings-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(234, 82, 151, 0.3);
  transition: all 0.2s ease;
}

.settings-range::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(234, 82, 151, 0.4);
}

.settings-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--brand-gray-dark);
  margin-top: 4px;
}

.settings-select {
  margin-bottom: 0;
}

.settings-select-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-dark);
  margin-bottom: 8px;
}

.settings-select-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.settings-select-input:focus {
  outline: none;
  border-color: var(--brand-pink);
}

.settings-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--brand-gray);
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.settings-action-btn:hover {
  background: var(--brand-pink);
  color: white;
  border-color: var(--brand-pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.settings-action-btn svg {
  flex-shrink: 0;
}

.settings-color-input {
  width: 50px;
  height: 40px;
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.settings-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.settings-color-input::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.settings-color-text {
  font-family: 'Courier New', monospace;
}

/* Export Modal Styles - Modern UI like User Manager */
.export-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.export-modal.show {
  opacity: 1;
  visibility: visible;
}

.export-modal-content {
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.export-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid var(--brand-gray-light);
  flex-shrink: 0;
}

.export-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--brand-dark);
  font-weight: 700;
}

.export-modal-close {
  background: transparent;
  border: none;
  color: var(--brand-gray-dark);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.export-modal-close:hover {
  background: var(--brand-gray);
  color: var(--brand-dark);
}

.export-modal-body {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
  overflow-x: hidden;
}

.export-section {
  background: var(--brand-white);
  border: 1px solid var(--brand-gray-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.export-section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-pink);
}

.export-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--brand-gray) 0%, var(--brand-gray-light) 100%);
  border-bottom: 1px solid var(--brand-gray-light);
}

.export-section-header svg {
  color: var(--brand-pink);
  flex-shrink: 0;
}

.export-section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}

.export-section-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.export-option {
  margin: 0;
}

.export-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-dark);
  margin-bottom: 8px;
}

.export-select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.export-select:focus {
  outline: none;
  border-color: var(--brand-pink);
}

.export-slider {
  margin-top: 8px;
}

.export-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.export-slider-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-dark);
}

.export-slider-value {
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-pink);
  min-width: 50px;
  text-align: right;
}

.export-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--brand-gray-light);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.export-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(234, 82, 151, 0.3);
  transition: all 0.2s ease;
}

.export-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(234, 82, 151, 0.4);
}

.export-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-pink);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(234, 82, 151, 0.3);
  transition: all 0.2s ease;
}

.export-range::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(234, 82, 151, 0.4);
}

.export-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--brand-gray-dark);
  margin-top: 4px;
}

.export-hint {
  font-size: 12px;
  color: var(--brand-gray-dark);
  margin-bottom: 12px;
}

.export-custom-size {
  display: flex;
  align-items: center;
  gap: 12px;
}

.export-input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.export-input:focus {
  outline: none;
  border-color: var(--brand-pink);
}

.export-separator {
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-gray-dark);
  flex-shrink: 0;
}

.export-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 30px;
  border-top: 1px solid var(--brand-gray-light);
  flex-shrink: 0;
}

.export-btn-primary,
.export-btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.export-btn-primary {
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.export-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.export-btn-secondary {
  background: var(--brand-gray);
  color: var(--brand-dark);
}

.export-btn-secondary:hover {
  background: var(--brand-gray-dark);
  color: white;
}

.user-tab-content .form-group {
  margin-bottom: 24px;
}

.user-tab-content .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--brand-dark);
  font-size: 14px;
}

.user-tab-content .form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--brand-gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.user-tab-content .form-group input:focus {
  outline: none;
  border-color: var(--brand-pink);
}

.user-tab-content .form-group input[readonly] {
  background: var(--brand-gray);
  cursor: not-allowed;
}

.user-tab-content .message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: none;
  font-size: 14px;
  font-weight: 500;
}

.user-tab-content .message-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.user-tab-content .message-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.user-tab-content .btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--brand-pink) 0%, var(--brand-pink-light) 100%);
  color: var(--brand-white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-tab-content .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 82, 151, 0.4);
}

.header-user-info {
  transition: all 0.2s;
}

.header-user-info:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* Context Menu Styles */
.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--brand-dark);
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    margin: 2px 4px;
}

.context-menu-item:hover:not(.disabled) {
    background: var(--brand-pink);
    color: white;
    transform: translateX(4px);
}

.context-menu-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.context-menu-item.danger {
    color: #ef4444;
}

.context-menu-item.danger:hover {
    background: #ef4444;
    color: white;
}

/* ============================================
   Template Manager Social - Instagram Style
   ============================================ */

/* Fullscreen Modal */
.template-manager-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.template-manager-container {
    width: 100%;
    height: 100%;
    max-width: 1400px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.template-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.template-manager-header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.template-manager-header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.template-manager-tabs {
    display: flex;
    gap: 8px;
}

.template-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #8e8e8e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-tab:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.template-tab.active {
    background: #1a1a1a;
    color: #fff;
}

.template-manager-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.template-save-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ea5297 0%, #ff9ccc 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 82, 151, 0.4);
}

.template-close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.template-close-btn:hover {
    background: #f5f5f5;
    transform: rotate(90deg);
}

/* Content Area */
.template-manager-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: #fafafa;
}

/* Filters */
.template-manager-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.template-search {
    position: relative;
    max-width: 400px;
}

.template-search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e8e8e;
    pointer-events: none;
}

.template-search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
}

.template-search input:focus {
    outline: none;
    border-color: #ea5297;
    box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.template-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    border-color: #ea5297;
    color: #ea5297;
}

.category-btn.active {
    background: #ea5297;
    border-color: #ea5297;
    color: #fff;
}

.template-sort {
    max-width: 200px;
}

.template-sort select {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

/* Templates Grid */
.template-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.template-card-social {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: none;
    outline: none;
}

.template-card-social:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.template-card-preview {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
    border: none;
    outline: none;
}

.template-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card-social:hover .template-card-overlay {
    opacity: 1;
}

.template-card-action {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-card-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.template-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(234, 82, 151, 0.9);
    backdrop-filter: blur(10px);
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.template-card-info {
    padding: 16px;
}

.template-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-card-description {
    font-size: 13px;
    color: #8e8e8e;
    margin: 0 0 12px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #8e8e8e;
}

.template-card-category {
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 12px;
    font-weight: 500;
}

.template-card-stats {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading & Empty States */
.template-loading,
.template-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.template-loading svg,
.template-empty svg {
    color: #8e8e8e;
    margin-bottom: 16px;
}

.template-loading p,
.template-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.template-empty p {
    font-size: 14px;
    color: #8e8e8e;
    margin: 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #ea5297;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Save Modal */
.template-save-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.template-save-content {
    background: #fff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.template-save-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #e0e0e0;
}

.template-save-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.template-save-body {
    padding: 32px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
}

.template-save-preview {
    position: sticky;
    top: 32px;
}

.template-save-preview canvas {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-save-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ea5297;
    box-shadow: 0 0 0 3px rgba(234, 82, 151, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ea5297;
}

.checkbox-hint {
    font-size: 12px;
    color: #8e8e8e;
    margin: 8px 0 0 32px;
}

.form-hint {
    font-size: 12px;
    color: #8e8e8e;
    margin: 0;
}

.template-save-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px 32px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #ea5297 0%, #ff9ccc 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 82, 151, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #1a1a1a;
}

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

/* Notifications */
.template-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 10002;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.template-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.template-notification-success {
    border-left: 4px solid #10b981;
    color: #065f46;
}

.template-notification-error {
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

/* Template Detail Modal */
.template-detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.template-detail-content {
    background: #fff;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.template-detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: all 0.2s ease;
}

.template-detail-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

.template-detail-preview-wrapper {
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.template-detail-preview {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.template-detail-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border: none;
    outline: none;
}

.template-detail-info {
    padding: 32px;
    flex: 1;
}

.template-detail-header {
    margin-bottom: 20px;
}

.template-detail-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.template-detail-creator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    margin-bottom: 16px;
}

.template-detail-creator:hover {
    opacity: 0.8;
}

.template-detail-creator-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-detail-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea5297 0%, #ff9ccc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.template-detail-creator-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.template-detail-creator-handle {
    font-size: 14px;
    color: #8e8e8e;
    margin: 0;
}

.template-detail-description {
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    margin: 0 0 24px 0;
}

.template-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.template-detail-category {
    padding: 6px 14px;
    background: #ea5297;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.template-detail-date {
    font-size: 14px;
    color: #8e8e8e;
}

.template-detail-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.template-detail-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-detail-stat:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.template-detail-stat.active {
    background: #ea5297;
    color: #fff;
}

.template-detail-stat svg {
    flex-shrink: 0;
}

.template-detail-actions {
    display: flex;
    gap: 12px;
}

.template-detail-actions .btn-primary,
.template-detail-actions .btn-danger {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Template Profile Modal */
.template-profile-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.template-profile-content {
    background: #fff;
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.template-profile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: all 0.2s ease;
}

.template-profile-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

.template-profile-header {
    padding: 40px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 32px;
}

.template-profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea5297 0%, #ff9ccc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    flex-shrink: 0;
}

.template-profile-info {
    flex: 1;
}

.template-profile-info h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.template-profile-handle {
    font-size: 18px;
    color: #8e8e8e;
    margin: 0 0 24px 0;
}

.template-profile-stats {
    display: flex;
    gap: 32px;
}

.template-profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.template-profile-stat strong {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.template-profile-stat span {
    font-size: 14px;
    color: #8e8e8e;
}

.template-profile-feed {
    padding: 40px;
}

.template-profile-feed h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
}

.template-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.template-profile-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.template-profile-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.template-profile-item-preview {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border: none;
    outline: none;
}

.template-profile-item-info {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-profile-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.template-profile-item-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #8e8e8e;
    flex-shrink: 0;
}

.template-profile-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e8e;
}

/* Enhanced Template Cards */
.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.template-card-creator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.template-card-creator:hover {
    background: #e0e0e0;
    transform: translateX(2px);
}

.template-card-creator svg {
    flex-shrink: 0;
}

.template-card-stats-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.template-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #8e8e8e;
}

.template-card-stat svg {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .template-manager-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .template-manager-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
    }
    
    .template-manager-tabs {
        width: 100%;
    }
    
    .template-tab {
        flex: 1;
        justify-content: center;
    }
    
    .template-manager-content {
        padding: 16px;
    }
    
    .template-manager-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
    
    .template-save-body {
        grid-template-columns: 1fr;
    }
    
    .template-save-preview {
        position: static;
    }
    
    .template-detail-preview-wrapper {
        min-height: auto;
    }
    
    .template-detail-info {
        padding: 24px;
    }
    
    .template-profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .template-profile-stats {
        justify-content: center;
    }
}
