/**
 * Framed Image - WPBakery Element Styles
 */

/* Wrapper Alignment */
.the7child-framed-image-wrapper {
  margin: 20px 0;
  clear: both;
}

.the7child-framed-image-wrapper.align-left {
  text-align: left;
}

.the7child-framed-image-wrapper.align-center {
  text-align: center;
}

.the7child-framed-image-wrapper.align-right {
  text-align: right;
}

/* Framed Image Container */
.framed-image-container {
  width: 424px;
  height: 424px;
  position: relative;
  display: inline-block;
  background: #f9f9f9;
}

.framed-image-container img.framed-image {
  position: absolute;
  left: 7px;
  top: 8px;
  right: 8px;
  bottom: 7px;
  width: 409px;
  height: 409px;
  object-fit: cover;
  display: block;
}

.framed-image-container .golden-frame {
  position: absolute;
  left: 2px;
  top: 15px;
  right: 14px;
  bottom: 2px;
  border: 2px solid var(--color-primary, #ac8834);
  pointer-events: none;
  box-sizing: border-box;
}

/* Placeholder */
.framed-image-placeholder {
  width: 424px;
  height: 424px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  border: 2px dashed #ccc;
  text-align: center;
  color: #666;
}

/* Cropper Frontend Notice */
.framed-image-cropper-frontend {
  padding: 20px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 4px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.cropper-notice {
  margin-bottom: 20px;
}

.cropper-notice p {
  margin: 5px 0;
}

/* Modal Styles */
.framed-image-modal {
  display: none;
  position: fixed;
  z-index: 999999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
}

.framed-image-modal-content {
  background-color: #fff;
  margin: 50px auto;
  padding: 0;
  border: 1px solid #888;
  width: 90%;
  max-width: 600px;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.framed-image-modal-header {
  padding: 20px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.framed-image-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.framed-image-modal-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}

.framed-image-modal-close:hover,
.framed-image-modal-close:focus {
  color: #000;
}

.framed-image-modal-body {
  padding: 20px;
}

.framed-image-modal-body p {
  margin: 0 0 15px;
  color: #666;
}

/* Cropper Container */
.cropper-container-wrapper {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.cropper-container {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--color-primary, #ac8834);
  cursor: grab;
  background: #f9f9f9;
  user-select: none;
}

.cropper-container:active {
  cursor: grabbing;
}

.cropper-container img {
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.cropper-container img:active {
  cursor: grabbing;
}

/* Cropper Controls */
.cropper-controls {
  margin-top: 20px;
}

.cropper-controls label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

.cropper-controls #zoom-value {
  color: var(--color-primary, #ac8834);
}

.cropper-controls input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
}

.cropper-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary, #ac8834);
  cursor: pointer;
}

.cropper-controls input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary, #ac8834);
  cursor: pointer;
  border: none;
}

/* Modal Footer */
.framed-image-modal-footer {
  padding: 20px;
  background: #f5f5f5;
  border-top: 1px solid #ddd;
  text-align: right;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.framed-image-modal-footer .button {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .framed-image-modal-content {
    width: 95%;
    margin: 20px auto;
  }

  .cropper-container-wrapper {
    overflow-x: auto;
  }

  .framed-image-container,
  .framed-image-placeholder {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .framed-image-container img.framed-image {
    width: calc(100% - 15px);
    height: calc(100% - 15px);
  }
}

@media (max-width: 480px) {
  .framed-image-modal-content {
    margin: 10px;
    width: calc(100% - 20px);
  }

  .framed-image-modal-header,
  .framed-image-modal-body,
  .framed-image-modal-footer {
    padding: 15px;
  }

  .framed-image-modal-header h2 {
    font-size: 18px;
  }
}
