/*
 * SPDX-FileCopyrightText: 2025-present Tobias Kunze
 * SPDX-License-Identifier: Apache-2.0
 */

.avatar-crop-modal {
  max-width: 800px;
  width: 90vw;
  max-height: 90vh;
  padding: 0;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);

  &::backdrop {
    background-color: rgba(0, 0, 0, 0.8);
  }

  .modal-card-content {
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
  }

  .modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;

    h3 {
      margin: 0;
      font-size: 1.25rem;
    }
  }

  .avatar-crop-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
  }

  .avatar-crop-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
  }

  .avatar-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #dee2e6;
  }
}
@media (max-width: 768px) {
  .avatar-crop-modal {
    width: 95vw;
    max-height: 95vh;

    .avatar-crop-container {
      min-height: 300px;
      max-height: 400px;
    }

    .modal-card-header,
    .avatar-crop-actions {
      padding: 15px;
    }
  }
}

/* Circle overlay to show circular preview area */
.circle-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.cropper-crop-box {
  position: relative;
  border: 3px solid #3aa57c;
}
.cropper-view-box {
  outline: 3px solid #3aa57c;
  outline-offset: -3px;
}
.cropper-line {
  background-color: #3aa57c;
  opacity: 0.5;
}

.avatar-crop-widget {
  position: relative;

  .avatar-file-input {
    display: inline-block;
    width: auto;
  }
}
