/* PhotoCropperModal — global styles.
   Classes are prefixed with "petryt-cropper-" to avoid collisions with
   CropperJS's own classes (e.g. the library ships a `.cropper-modal` class
   that sets opacity:.5, which silently clobbers anything sharing that name). */

.petryt-cropper-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.75);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2000;
    padding: 1rem;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

    .petryt-cropper-backdrop.is-visible {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

.petryt-cropper-dialog {
    background-color: #ffffff;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin: auto;
    color: #1e293b;
}

.petryt-cropper-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

    .petryt-cropper-dialog-header h5 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 600;
        color: #1e293b;
    }

.petryt-cropper-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

    .petryt-cropper-close:hover {
        color: #0f172a;
    }

.petryt-cropper-dialog-body {
    padding: 1.25rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background-color: #ffffff;
}

.petryt-cropper-stage {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    background-color: #0f172a;
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .petryt-cropper-stage img {
        display: block;
        max-width: 100%;
        max-height: 100%;
    }

/* Round the CropperJS crop preview inside our stage (these classes belong to CropperJS). */
.petryt-cropper-backdrop .cropper-view-box,
.petryt-cropper-backdrop .cropper-face {
    border-radius: 50%;
}

.petryt-cropper-backdrop .cropper-view-box {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-color: rgba(255, 255, 255, 0.85);
}

.petryt-cropper-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
    text-align: center;
}

.petryt-cropper-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.petryt-cropper-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.petryt-cropper-alert {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    text-align: center;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.petryt-cropper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1.2;
}

    .petryt-cropper-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.petryt-cropper-btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
}

.petryt-cropper-btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

    .petryt-cropper-btn-primary:hover:not(:disabled) {
        background-color: #2563eb;
        border-color: #2563eb;
    }

.petryt-cropper-btn-secondary {
    background-color: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

    .petryt-cropper-btn-secondary:hover:not(:disabled) {
        background-color: #f1f5f9;
    }

.petryt-cropper-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.125rem solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: petryt-cropper-spin 0.75s linear infinite;
}

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

@media (max-width: 480px) {
    .petryt-cropper-dialog {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .petryt-cropper-stage {
        max-width: 320px;
    }
}
