/*
  index.less
*/

/*
  LoginForm.less
*/
/* Universal selector for WordPress editor and other contexts */
.LoginForm .LoginButtonContainer {
  margin: 20px 0;
}
/* Legacy selector for admin panel compatibility */
#hivo-wordpress-plugin-container .LoginForm .LoginButtonContainer {
  margin: 20px 0;
}

/*
  LogoutForm.less
*/
#hivo-wordpress-plugin-container .LogoutForm .LogoutButtonContainer {
  margin: 20px 0;
}

/*
  Loading.less
*/
@keyframes loader {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
/* Universal selector for WordPress editor and other contexts */
.Loading {
  animation: loader 1s linear infinite;
  display: inline-block;
  width: 30px;
  height: 30px;
}
.Loading.small {
  width: 20px;
  height: 20px;
}
/* Legacy selector for admin panel compatibility */
#hivo-wordpress-plugin-container .Loading {
  animation: loader 1s linear infinite;
  display: inline-block;
  width: 30px;
  height: 30px;
}
#hivo-wordpress-plugin-container .Loading.small {
  width: 20px;
  height: 20px;
}

/*
  Upload.less
*/
#hivo-wordpress-plugin-container .Upload {
  background-color: #fff;
  padding: 10px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
#hivo-wordpress-plugin-container .Upload .uploadThumbnail {
  width: 100%;
  height: 200px;
  background-color: #ccc;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#hivo-wordpress-plugin-container .Upload .uploadName {
  word-break: break-word;
}
#hivo-wordpress-plugin-container .Upload .loadingContainer {
  text-align: center;
}
#hivo-wordpress-plugin-container .Upload .versionButton {
  margin: 0 2px 2px 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
  Library.less
*/
#hivo-wordpress-plugin-container .Library .uploadsContainer {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}
#hivo-wordpress-plugin-container .Library .Upload {
  width: 200px;
  margin: 0 4px 4px 0;
}

/*
  App.less
*/
#hivo-wordpress-plugin-container .App .bannerContainer {
  margin: 20px 0;
}

/*
  Upload.less
*/
.Upload {
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 320px;
  /* Ensure consistent card heights */
}
.Upload .uploadThumbnail {
  width: 100%;
  height: 200px;
  background-color: #ccc;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.Upload .uploadName {
  word-break: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 8px 0;
  font-weight: 600;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
  cursor: help;
  /* Show that hovering reveals full name */
  padding: 4px 10px;
}
.Upload .uploadName:hover {
  color: #6c5ce7;
  /* Show purple on hover to indicate interaction */
}
.Upload .loadingContainer {
  text-align: center;
  padding: 10px 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.Upload .versionButton {
  margin: 0 2px 2px 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.Upload .uploadControls {
  margin-top: auto;
  /* Push controls to bottom */
  padding-top: 15px;
  /* Inline layout for dropdown and button */
}
.Upload .uploadControls .versionAndImportContainer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.Upload .uploadControls .versionAndImportContainer .versionDropdown {
  flex: 1;
}
.Upload .uploadControls .versionAndImportContainer .versionDropdown .versionLabel {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 13px;
  color: #333;
}
.Upload .uploadControls .versionAndImportContainer .importActions {
  flex: 0 0 auto;
  margin-top: 22px;
  /* Align with dropdown input field */
}
/* Modal-specific styles */
.hivo-modal .Upload {
  margin-bottom: 20px;
  border-radius: 8px;
}
.hivo-modal .Upload .uploadThumbnail {
  border-radius: 6px 6px 0 0;
}
.hivo-modal .Upload .uploadControls {
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 0 0 6px 6px;
  border-top: 1px solid #e5e5e5;
}

/*
  Library.less
*/
.Library .uploadsContainer {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
  /* Responsive flex layout */
}
@media (max-width: 768px) {
  .Library .uploadsContainer {
    justify-content: center;
  }
}
.Library .Upload {
  flex: 0 0 auto;
  width: 250px;
  min-width: 200px;
  max-width: 300px;
  /* Allow uploads to grow if there's extra space */
}
@media (min-width: 1200px) {
  .Library .Upload {
    flex: 1 1 250px;
    max-width: 320px;
  }
}
/* Modal-specific Library styles - Enhanced flexbox */
.hivo-modal .Library {
  /* Simple pagination styling */
}
.hivo-modal .Library .uploadsContainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  /* Make all cards same height */
  gap: 20px;
  margin: 20px 0;
  padding: 0;
  /* Responsive behavior in modals */
}
@media (max-width: 600px) {
  .hivo-modal .Library .uploadsContainer {
    justify-content: center;
    gap: 15px;
  }
}
@media (min-width: 900px) {
  .hivo-modal .Library .uploadsContainer {
    justify-content: space-between;
  }
}
.hivo-modal .Library .Upload {
  box-sizing: border-box;
  flex: 1 1 250px;
  max-width: 300px;
}
.hivo-modal .Library .manage-menus {
  margin-bottom: 15px;
  color: #666;
  font-size: 14px;
}
.hivo-modal .Library .pagination-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
.hivo-modal .Library .pagination-container .pagination {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hivo-modal .Library .pagination-container .pagination .pagination-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.hivo-modal .Library .pagination-container .pagination .pagination-btn:hover:not(.disabled) {
  background: #f8f9fa;
  border-color: #2337d5;
  color: #2337d5;
}
.hivo-modal .Library .pagination-container .pagination .pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
  color: #999;
}
.hivo-modal .Library .pagination-container .pagination .page-info {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e1e5e9;
}
.safeCdnLibraryWarning {
  color: #d63638;
  background-color: #fff7cc;
  border: 1px solid #fce700;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* WordPress Image Block Integration Styles */
/* Main container */
.hivo-wordpress-image-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
/* HIVO Library Button */
.hivo-library-button {
  background: #6c5ce7;
  border: 1px solid #6c5ce7;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 40px;
  /* Shine effect on hover */
}
.hivo-library-button:hover:not(:disabled) {
  background: #5b4ed1;
  border-color: #5b4ed1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}
.hivo-library-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}
.hivo-library-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.hivo-library-button .hivo-icon {
  font-size: 16px;
}
.hivo-library-button .authenticated-indicator {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-left: 4px;
}
.hivo-library-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}
.hivo-library-button:hover::before {
  left: 100%;
}
/* User Status */
.hivo-user-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #666;
  padding: 6px 12px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e1e5e9;
}
.hivo-user-status .user-info {
  font-weight: 500;
}
.hivo-user-status .logout-button {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  padding: 0;
}
.hivo-user-status .logout-button:hover {
  color: #c82333;
}
/* Modal Backdrop */
.hivo-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}
/* Modal Base */
.hivo-modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* Modal Header */
.hivo-modal-header {
  padding: 20px;
  border-bottom: 1px solid #e1e5e9;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hivo-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d2327;
}
.hivo-modal-header .hivo-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.hivo-modal-header .hivo-modal-close:hover {
  background: #e9ecef;
  color: #333;
}
/* Modal Body */
.hivo-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
/* Login Modal Specific */
.hivo-login-modal {
  width: 400px;
}
.hivo-login-modal .hivo-login-form .hivo-form-group {
  margin-bottom: 16px;
}
.hivo-login-modal .hivo-login-form .hivo-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #1d2327;
}
.hivo-login-modal .hivo-login-form .hivo-form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.hivo-login-modal .hivo-login-form .hivo-form-group input:focus {
  outline: none;
  border-color: #6c5ce7;
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}
.hivo-login-modal .hivo-login-form .hivo-form-group input:disabled {
  background: #f8f9fa;
  color: #6c757d;
}
.hivo-login-modal .hivo-login-help {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e1e5e9;
}
.hivo-login-modal .hivo-login-help p {
  margin: 8px 0;
  font-size: 12px;
  color: #666;
}
.hivo-login-modal .hivo-login-help a {
  color: #6c5ce7;
  text-decoration: none;
}
.hivo-login-modal .hivo-login-help a:hover {
  text-decoration: underline;
}
/* Library Modal Specific */
.hivo-library-modal {
  width: 1200px;
  height: 600px;
}
.hivo-library-modal .hivo-library-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid #e1e5e9;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hivo-library-modal .hivo-library-toolbar .hivo-search-container {
  position: relative;
  flex: 1;
  max-width: 300px;
}
.hivo-library-modal .hivo-library-toolbar .hivo-search-container .hivo-search-input {
  width: 100%;
  padding: 8px 40px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  box-sizing: border-box;
}
.hivo-library-modal .hivo-library-toolbar .hivo-search-container .hivo-search-input:focus {
  outline: none;
  border-color: #6c5ce7;
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}
.hivo-library-modal .hivo-library-toolbar .hivo-search-container .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
}
.hivo-library-modal .hivo-library-toolbar .hivo-library-stats {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}
.hivo-library-modal .hivo-modal-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}
/* Images Grid */
.hivo-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.hivo-image-item {
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  overflow: hidden;
  position: relative;
}
.hivo-image-item:hover {
  border-color: #6c5ce7;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
  transform: translateY(-2px);
}
.hivo-image-item.selected {
  border-color: #6c5ce7;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}
.hivo-image-item .image-thumbnail {
  height: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  position: relative;
}
.hivo-image-item .image-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}
.hivo-image-item .image-thumbnail .image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 12px;
}
.hivo-image-item .image-thumbnail .image-placeholder span:first-child {
  font-size: 24px;
  margin-bottom: 8px;
}
.hivo-image-item .image-info {
  padding: 12px;
}
.hivo-image-item .image-info h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hivo-image-item .image-info .image-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: #666;
}
.hivo-image-item .image-info .image-meta .dimensions,
.hivo-image-item .image-info .image-meta .file-size {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
}
.hivo-image-item .selection-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #6c5ce7;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
/* Loading States */
.hivo-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
}
.hivo-loading p {
  margin: 12px 0 0 0;
  font-size: 14px;
}
.hivo-loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #666;
  font-size: 14px;
  gap: 8px;
}
/* No Images State */
.hivo-no-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #666;
}
.hivo-no-images .no-images-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.hivo-no-images h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #333;
}
.hivo-no-images p {
  margin: 0;
  font-size: 14px;
  max-width: 300px;
  line-height: 1.4;
}
/* Load More */
.hivo-load-more {
  display: flex;
  justify-content: center;
  padding: 20px;
}
/* Error Messages */
.hivo-error-message {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c53030;
  font-size: 14px;
}
.hivo-error-message .error-icon {
  font-size: 16px;
}
.hivo-error-message .hivo-button {
  margin-left: auto;
}
/* Modal Footer */
.hivo-modal-footer {
  padding: 20px;
  border-top: 1px solid #e1e5e9;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.hivo-modal-footer .selected-image-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.hivo-modal-footer .selected-image-info .selected-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #e1e5e9;
}
.hivo-modal-footer .selected-image-info .selected-details h4 {
  margin: 0 0 2px 0;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.hivo-modal-footer .selected-image-info .selected-details p {
  margin: 0;
  font-size: 11px;
  color: #666;
}
/* Modal Actions */
.hivo-modal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
/* Buttons */
.hivo-button {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  min-height: 36px;
  box-sizing: border-box;
}
.hivo-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.hivo-button.hivo-button-primary {
  background: #6c5ce7;
  border-color: #6c5ce7;
  color: white;
}
.hivo-button.hivo-button-primary:hover:not(:disabled) {
  background: #5b4ed1;
  border-color: #5b4ed1;
}
.hivo-button.hivo-button-primary:focus {
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}
.hivo-button.hivo-button-secondary {
  background: white;
  border-color: #ddd;
  color: #333;
}
.hivo-button.hivo-button-secondary:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #bbb;
}
.hivo-button.hivo-button-secondary:focus {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}
/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}
.spinner.large {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Responsive Design */
@media (max-width: 768px) {
  .hivo-library-modal {
    width: 95vw;
    height: 85vh;
  }
  .hivo-library-modal .hivo-library-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .hivo-library-modal .hivo-library-toolbar .hivo-search-container {
    max-width: none;
  }
  .hivo-library-modal .hivo-images-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
  }
  .hivo-library-modal .hivo-image-item .image-thumbnail {
    height: 100px;
  }
  .hivo-login-modal {
    width: 95vw;
    max-width: 400px;
  }
  .hivo-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .hivo-modal-footer .selected-image-info {
    justify-content: center;
  }
  .hivo-modal-footer .hivo-modal-actions {
    justify-content: center;
  }
  .hivo-button {
    flex: 1;
    justify-content: center;
  }
}

