/* Content Builder Styles */

.content-builder-wrapper {
  height: calc(100vh - 200px);
  min-height: 600px;
}

/* Element Library */
.element-library-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.element-library-item:hover {
  transform: translateY(-2px);
}

.element-library-item:active {
  transform: scale(0.95);
}

/* Row Container */
.row-container {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.row-container:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Column Container */
.column-container {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Drop Zone States */
[data-content-builder-target="dropZone"] {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-content-builder-target="dropZone"]:hover {
  border-color: rgb(99, 102, 241);
  background-color: rgba(99, 102, 241, 0.05);
}

[data-content-builder-target="dropZone"].drag-over {
  border-color: rgb(99, 102, 241);
  background-color: rgba(99, 102, 241, 0.1);
  border-style: solid;
}

/* Element Item */
.element-item {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.element-item:hover {
  transform: translateY(-1px);
}

.element-item.selected {
  @apply ring-2 ring-indigo-500 border-indigo-500;
}

/* Resize Handle */
[data-content-builder-target="resizeHandle"] {
  transition: all 0.2s ease;
}

[data-content-builder-target="resizeHandle"]:hover div {
  background-color: rgb(99, 102, 241);
  width: 3px;
}

[data-content-builder-target="resizeHandle"]:active div {
  background-color: rgb(79, 70, 229);
}

/* Drag States */
.dragging {
  opacity: 0.5;
  cursor: grabbing !important;
}

.drag-ghost {
  opacity: 0.4;
  transform: rotate(2deg);
}

/* Properties Panel Animations */
[data-content-builder-target="propertiesPanel"] {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-content-builder-target="emptyState"] {
  animation: fadeIn 0.3s ease-in;
}

[data-content-builder-target="propertiesContent"] {
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Canvas Empty State */
.canvas-empty-state {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Button Hover Effects */
button[data-action*="content-builder"] {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button[data-action*="content-builder"]:hover {
  transform: translateY(-1px);
}

button[data-action*="content-builder"]:active {
  transform: translateY(0);
}

/* Row Layout Preset Buttons */
button[data-layout] svg {
  transition: all 0.2s ease;
}

button[data-layout]:hover svg {
  transform: scale(1.1);
}

button[data-layout].active {
  color: rgb(99, 102, 241);
}

/* Scrollbar Styling */
.content-builder-wrapper ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.content-builder-wrapper ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.content-builder-wrapper ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.content-builder-wrapper ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Dark Mode Scrollbar */
.dark .content-builder-wrapper ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.dark .content-builder-wrapper ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.dark .content-builder-wrapper ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Form Input Enhancements */
.content-builder-wrapper .form-input,
.content-builder-wrapper .form-select,
.content-builder-wrapper .form-textarea {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-builder-wrapper .form-input:focus,
.content-builder-wrapper .form-select:focus,
.content-builder-wrapper .form-textarea:focus {
  border-color: rgb(99, 102, 241);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Tab Active State */
.tab-active {
  color: rgb(99, 102, 241) !important;
  border-color: rgb(99, 102, 241) !important;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .content-builder-wrapper {
    flex-direction: column;
  }

  .content-builder-wrapper > div:first-child,
  .content-builder-wrapper > div:last-child {
    width: 100%;
    max-height: 300px;
  }
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-top-color: rgb(99, 102, 241);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Success/Error States */
.save-success {
  animation: successPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes successPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

/* Grid Overlay (for debugging/alignment) */
.show-grid {
  background-image: linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Element Hover-Specific Controls */
.element-hover-trigger:hover .element-controls {
  opacity: 1;
}

.container-hover-trigger:hover .container-controls {
  opacity: 1;
}

.navbar-hover-trigger:hover .navbar-controls {
  opacity: 1;
}
