/* Storyblok Asset Picker components */

.storyblok-asset-gallery {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.storyblok-asset-gallery__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f7f8fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.storyblok-asset-gallery__toolbar .field {
  margin-bottom: 0;
  min-width: 220px;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
}

.storyblok-asset-gallery__toolbar .control {
  width: 100%;
}

.storyblok-asset-gallery__breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.storyblok-asset-gallery__toolbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.storyblok-asset-gallery__breadcrumb .breadcrumb-sep {
  color: #888;
  margin: 0 0.2rem;
}

.storyblok-asset-gallery__sidebar {
  width: 260px;
  min-width: 260px;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  background: #fafafa;
}

.storyblok-asset-gallery__folder-search {
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.storyblok-asset-gallery__folder-search .field {
  margin-bottom: 0;
}

.storyblok-asset-gallery__folder-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.storyblok-asset-gallery__folder-row {
  display: flex;
  align-items: center;
}

.storyblok-asset-gallery__folder-row.is-selected .storyblok-asset-gallery__folder-item {
  font-weight: 600;
}

.storyblok-asset-gallery__folder-expand {
  cursor: pointer;
  padding: 0.2rem 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.storyblok-asset-gallery__folder-expand:hover {
  color: #3273dc;
}

.storyblok-asset-gallery__folder-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border: none;
  background: none;
  flex: 1;
  text-align: left;
  font-size: 0.9rem;
  color: #363636;
  border-bottom: 1px solid #eee;
  transition: background 0.15s;
}

.storyblok-asset-gallery__folder-item:hover {
  background: #f0f0f0;
}

.storyblok-asset-gallery__folder-item.is-selected {
  background: #e8f4ff;
  color: #3273dc;
  font-weight: 500;
}

.storyblok-asset-gallery__folder-item .fa-folder,
.storyblok-asset-gallery__folder-item .fa-folder-open {
  margin-right: 0.5rem;
  color: #888;
  flex-shrink: 0;
}

.storyblok-asset-gallery__folder-item.is-selected .fa-folder,
.storyblok-asset-gallery__folder-item.is-selected .fa-folder-open {
  color: #3273dc;
}

.storyblok-asset-gallery__folder-item .folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storyblok-asset-gallery__folder-children {
  padding-left: 1.25rem;
  border-left: 1px solid #e5e5e5;
  margin-left: 0.75rem;
}

.storyblok-asset-gallery__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0 1rem;
  overflow: hidden;
}

.storyblok-asset-gallery__main-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.storyblok-asset-gallery__folders {
  display: none;
}

.storyblok-asset-gallery__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.storyblok-asset-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.storyblok-asset-gallery__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.5rem;
  background: #fff;
}

.storyblok-asset-gallery__item.is-selectable {
  cursor: pointer;
}

.storyblok-asset-gallery__item.is-selectable:hover {
  border-color: #3273dc;
  box-shadow: 0 0 0 1px #3273dc;
}

.storyblok-asset-gallery__item img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
}

.storyblok-asset-gallery__placeholder {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 4px;
  color: #999;
  font-size: 2rem;
}

.storyblok-asset-gallery__label {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storyblok-asset-gallery__pagination {
  margin-top: 1rem;
}

.storyblok-asset-modal {
  width: calc(100% - 40px) !important;
}

.storyblok-asset-modal .modal-card {
  max-width: 2800px;
}

.storyblok-asset-modal .modal-card-body {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

.storyblok-asset-modal__upload-trigger {
  margin-left: auto;
  margin-right: 0.75rem;
}

.storyblok-asset-modal__content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.storyblok-asset-modal__upload-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2;
}

.storyblok-asset-modal__upload-overlay.is-active {
  display: flex;
}

.storyblok-asset-modal__upload-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
}

.storyblok-asset-modal__upload-panel {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  padding: 1rem;
}

.storyblok-asset-modal__upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.storyblok-asset-input {
  border: 1px dashed #ccc;
  border-radius: 4px;
  padding: 1rem;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
}

.storyblok-asset-input:hover {
  border-color: #3273dc;
  background: #f5f8ff;
}

.storyblok-asset-input__preview {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.storyblok-asset-input__preview img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.storyblok-asset-input__placeholder {
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  border-radius: 4px;
  color: #999;
  font-size: 2rem;
}

.storyblok-asset-input__info {
  display: flex;
  flex-direction: column;
}

.storyblok-asset-input__filename {
  font-weight: 500;
}

.storyblok-asset-input__hint {
  font-size: 0.8rem;
  color: #888;
}

.storyblok-asset-input__clear {
  margin-left: auto;
  flex-shrink: 0;
}

.storyblok-asset-input__empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #888;
}

.storyblok-asset-input__empty i {
  font-size: 1.25rem;
}
